http://git-wip-us.apache.org/repos/asf/ambari/blob/017561f1/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/AddViewInstanceRequestAuditEvent.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/AddViewInstanceRequestAuditEvent.java b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/AddViewInstanceRequestAuditEvent.java new file mode 100644 index 0000000..25fe583 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/AddViewInstanceRequestAuditEvent.java @@ -0,0 +1,111 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.audit.request.event; + +import org.apache.ambari.server.audit.request.RequestAuditEvent; + +public class AddViewInstanceRequestAuditEvent extends RequestAuditEvent { + + public static class AddViewInstanceRequestAuditEventBuilder extends RequestAuditEventBuilder<AddViewInstanceRequestAuditEvent, AddViewInstanceRequestAuditEventBuilder> { + + private String description; + + private String name; + + private String type; + + private String displayName; + + private String version; + + public AddViewInstanceRequestAuditEventBuilder() { + super.withOperation("View addition"); + } + + @Override + protected AddViewInstanceRequestAuditEvent newAuditEvent() { + return new AddViewInstanceRequestAuditEvent(this); + } + + /** + * Appends to the event the details of the incoming request. + * @param builder builder for the audit event details. + */ + @Override + protected void buildAuditMessage(StringBuilder builder) { + super.buildAuditMessage(builder); + + builder.append(", Type(") + .append(type) + .append("), Version(") + .append(version) + .append("), Name(") + .append(name) + .append("), Display name(") + .append(displayName) + .append("), Description(") + .append(description) + .append(")"); + } + + public AddViewInstanceRequestAuditEventBuilder withDescription(String description) { + this.description = description; + return this; + } + + public AddViewInstanceRequestAuditEventBuilder withName(String name) { + this.name = name; + return this; + } + + public AddViewInstanceRequestAuditEventBuilder withType(String type) { + this.type = type; + return this; + } + + public AddViewInstanceRequestAuditEventBuilder withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + public AddViewInstanceRequestAuditEventBuilder withVersion(String version) { + this.version = version; + return this; + } + } + + protected AddViewInstanceRequestAuditEvent() { + } + + /** + * {@inheritDoc} + */ + protected AddViewInstanceRequestAuditEvent(AddViewInstanceRequestAuditEventBuilder builder) { + super(builder); + } + + /** + * Returns an builder for {@link AddViewInstanceRequestAuditEvent} + * @return a builder instance + */ + public static AddViewInstanceRequestAuditEventBuilder builder() { + return new AddViewInstanceRequestAuditEventBuilder(); + } + +}
http://git-wip-us.apache.org/repos/asf/ambari/blob/017561f1/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/AdminUserRequestAuditEvent.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/AdminUserRequestAuditEvent.java b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/AdminUserRequestAuditEvent.java new file mode 100644 index 0000000..1f91ea1 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/AdminUserRequestAuditEvent.java @@ -0,0 +1,87 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.audit.request.event; + +import org.apache.ambari.server.audit.request.RequestAuditEvent; + +public class AdminUserRequestAuditEvent extends RequestAuditEvent { + + public static class AdminUserRequestAuditEventBuilder extends RequestAuditEventBuilder<AdminUserRequestAuditEvent, AdminUserRequestAuditEventBuilder> { + + private boolean admin; + + private String username; + + public AdminUserRequestAuditEventBuilder() { + super.withOperation("Set user admin"); + } + + @Override + protected AdminUserRequestAuditEvent newAuditEvent() { + return new AdminUserRequestAuditEvent(this); + } + + /** + * Appends to the event the details of the incoming request. + * @param builder builder for the audit event details. + */ + @Override + protected void buildAuditMessage(StringBuilder builder) { + super.buildAuditMessage(builder); + + builder + .append(", Affeted username(") + .append(username) + .append("), ") + .append("Administrator(") + .append(admin ? "yes" : "no") + .append(")"); + } + + public AdminUserRequestAuditEventBuilder withAdmin(boolean admin) { + this.admin = admin; + return this; + } + + public AdminUserRequestAuditEventBuilder withAffectedUsername(String username) { + this.username = username; + return this; + } + + } + + protected AdminUserRequestAuditEvent() { + } + + /** + * {@inheritDoc} + */ + protected AdminUserRequestAuditEvent(AdminUserRequestAuditEventBuilder builder) { + super(builder); + } + + /** + * Returns an builder for {@link AdminUserRequestAuditEvent} + * @return a builder instance + */ + public static AdminUserRequestAuditEventBuilder builder() { + return new AdminUserRequestAuditEventBuilder(); + } + +} http://git-wip-us.apache.org/repos/asf/ambari/blob/017561f1/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/BlueprintExportRequestAuditEvent.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/BlueprintExportRequestAuditEvent.java b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/BlueprintExportRequestAuditEvent.java new file mode 100644 index 0000000..cc2dbef --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/BlueprintExportRequestAuditEvent.java @@ -0,0 +1,64 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.audit.request.event; + +import org.apache.ambari.server.audit.request.RequestAuditEvent; + +public class BlueprintExportRequestAuditEvent extends RequestAuditEvent { + + public static class BlueprintExportRequestAuditEventBuilder extends RequestAuditEventBuilder<BlueprintExportRequestAuditEvent, BlueprintExportRequestAuditEventBuilder> { + + public BlueprintExportRequestAuditEventBuilder() { + super.withOperation("Blueprint export"); + } + + @Override + protected BlueprintExportRequestAuditEvent newAuditEvent() { + return new BlueprintExportRequestAuditEvent(this); + } + + /** + * Appends to the event the details of the incoming request. + * @param builder builder for the audit event details. + */ + @Override + protected void buildAuditMessage(StringBuilder builder) { + super.buildAuditMessage(builder); + } + } + + protected BlueprintExportRequestAuditEvent() { + } + + /** + * {@inheritDoc} + */ + protected BlueprintExportRequestAuditEvent(BlueprintExportRequestAuditEventBuilder builder) { + super(builder); + } + + /** + * Returns an builder for {@link BlueprintExportRequestAuditEvent} + * @return a builder instance + */ + public static BlueprintExportRequestAuditEventBuilder builder() { + return new BlueprintExportRequestAuditEventBuilder(); + } + +} http://git-wip-us.apache.org/repos/asf/ambari/blob/017561f1/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/ChangeViewInstanceRequestAuditEvent.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/ChangeViewInstanceRequestAuditEvent.java b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/ChangeViewInstanceRequestAuditEvent.java new file mode 100644 index 0000000..c590e3a --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/ChangeViewInstanceRequestAuditEvent.java @@ -0,0 +1,111 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.audit.request.event; + +import org.apache.ambari.server.audit.request.RequestAuditEvent; + +public class ChangeViewInstanceRequestAuditEvent extends RequestAuditEvent { + + public static class ChangeViewInstanceRequestAuditEventBuilder extends RequestAuditEventBuilder<ChangeViewInstanceRequestAuditEvent, ChangeViewInstanceRequestAuditEventBuilder> { + + private String description; + + private String name; + + private String type; + + private String displayName; + + private String version; + + public ChangeViewInstanceRequestAuditEventBuilder() { + super.withOperation("View change"); + } + + @Override + protected ChangeViewInstanceRequestAuditEvent newAuditEvent() { + return new ChangeViewInstanceRequestAuditEvent(this); + } + + /** + * Appends to the event the details of the incoming request. + * @param builder builder for the audit event details. + */ + @Override + protected void buildAuditMessage(StringBuilder builder) { + super.buildAuditMessage(builder); + + builder.append(", Type(") + .append(type) + .append("), Version(") + .append(version) + .append("), Name(") + .append(name) + .append("), Display name(") + .append(displayName) + .append("), Description(") + .append(description) + .append(")"); + } + + public ChangeViewInstanceRequestAuditEventBuilder withDescription(String description) { + this.description = description; + return this; + } + + public ChangeViewInstanceRequestAuditEventBuilder withName(String name) { + this.name = name; + return this; + } + + public ChangeViewInstanceRequestAuditEventBuilder withType(String type) { + this.type = type; + return this; + } + + public ChangeViewInstanceRequestAuditEventBuilder withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + public ChangeViewInstanceRequestAuditEventBuilder withVersion(String version) { + this.version = version; + return this; + } + } + + protected ChangeViewInstanceRequestAuditEvent() { + } + + /** + * {@inheritDoc} + */ + protected ChangeViewInstanceRequestAuditEvent(ChangeViewInstanceRequestAuditEventBuilder builder) { + super(builder); + } + + /** + * Returns an builder for {@link ChangeViewInstanceRequestAuditEvent} + * @return a builder instance + */ + public static ChangeViewInstanceRequestAuditEventBuilder builder() { + return new ChangeViewInstanceRequestAuditEventBuilder(); + } + +} http://git-wip-us.apache.org/repos/asf/ambari/blob/017561f1/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/ClientConfigDownloadRequestAuditEvent.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/ClientConfigDownloadRequestAuditEvent.java b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/ClientConfigDownloadRequestAuditEvent.java new file mode 100644 index 0000000..b4060c7 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/ClientConfigDownloadRequestAuditEvent.java @@ -0,0 +1,86 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.audit.request.event; + +import org.apache.ambari.server.audit.request.RequestAuditEvent; + +public class ClientConfigDownloadRequestAuditEvent extends RequestAuditEvent { + + public static class ClientConfigDownloadRequestAuditEventBuilder extends RequestAuditEventBuilder<ClientConfigDownloadRequestAuditEvent, ClientConfigDownloadRequestAuditEventBuilder> { + + private String service; + + private String component; + + public ClientConfigDownloadRequestAuditEventBuilder() { + super.withOperation("Client config download"); + } + + @Override + protected ClientConfigDownloadRequestAuditEvent newAuditEvent() { + return new ClientConfigDownloadRequestAuditEvent(this); + } + + /** + * Appends to the event the details of the incoming request. + * @param builder builder for the audit event details. + */ + @Override + protected void buildAuditMessage(StringBuilder builder) { + super.buildAuditMessage(builder); + + builder.append(", Service(") + .append(service) + .append("), Component(") + .append(component) + .append(")"); + + } + + public ClientConfigDownloadRequestAuditEventBuilder withService(String service) { + this.service = service; + return this; + } + + public ClientConfigDownloadRequestAuditEventBuilder withComponent(String component) { + this.component = component; + return this; + } + + } + + protected ClientConfigDownloadRequestAuditEvent() { + } + + /** + * {@inheritDoc} + */ + protected ClientConfigDownloadRequestAuditEvent(ClientConfigDownloadRequestAuditEventBuilder builder) { + super(builder); + } + + /** + * Returns an builder for {@link ClientConfigDownloadRequestAuditEvent} + * @return a builder instance + */ + public static ClientConfigDownloadRequestAuditEventBuilder builder() { + return new ClientConfigDownloadRequestAuditEventBuilder(); + } + +} http://git-wip-us.apache.org/repos/asf/ambari/blob/017561f1/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/ClusterPrivilegeChangeRequestAuditEvent.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/ClusterPrivilegeChangeRequestAuditEvent.java b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/ClusterPrivilegeChangeRequestAuditEvent.java new file mode 100644 index 0000000..b3d61be --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/ClusterPrivilegeChangeRequestAuditEvent.java @@ -0,0 +1,109 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.audit.request.event; + +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.apache.ambari.server.audit.request.RequestAuditEvent; +import org.apache.commons.lang.StringUtils; + +public class ClusterPrivilegeChangeRequestAuditEvent extends RequestAuditEvent { + + public static class ClusterPrivilegeChangeRequestAuditEventBuilder extends RequestAuditEventBuilder<ClusterPrivilegeChangeRequestAuditEvent, ClusterPrivilegeChangeRequestAuditEventBuilder> { + + private Map<String, List<String>> users; + private Map<String, List<String>> groups; + + public ClusterPrivilegeChangeRequestAuditEventBuilder() { + super.withOperation("Role change"); + } + + @Override + protected ClusterPrivilegeChangeRequestAuditEvent newAuditEvent() { + return new ClusterPrivilegeChangeRequestAuditEvent(this); + } + + /** + * Appends to the event the details of the incoming request. + * @param builder builder for the audit event details. + */ + @Override + protected void buildAuditMessage(StringBuilder builder) { + super.buildAuditMessage(builder); + + Set<String> roleSet = new HashSet<String>(); + roleSet.addAll(users.keySet()); + roleSet.addAll(groups.keySet()); + + builder.append(", Roles("); + if(!users.isEmpty() || !groups.isEmpty()) { + builder.append(System.lineSeparator()); + } + + List<String> lines = new LinkedList<String>(); + + for(String role : roleSet) { + lines.add(role + ": "); + if(users.get(role) != null && !users.get(role).isEmpty()) { + lines.add(" Users: " + StringUtils.join(users.get(role), ", ")); + } + if(groups.get(role) != null && !groups.get(role).isEmpty()) { + lines.add(" Groups: " + StringUtils.join(groups.get(role), ", ")); + } + } + + builder.append(StringUtils.join(lines,System.lineSeparator())); + + builder.append(")"); + } + + public ClusterPrivilegeChangeRequestAuditEventBuilder withUsers(Map<String, List<String>> users) { + this.users = users; + return this; + } + + public ClusterPrivilegeChangeRequestAuditEventBuilder withGroups(Map<String, List<String>> groups) { + this.groups = groups; + return this; + } + } + + protected ClusterPrivilegeChangeRequestAuditEvent() { + } + + /** + * {@inheritDoc} + */ + protected ClusterPrivilegeChangeRequestAuditEvent(ClusterPrivilegeChangeRequestAuditEventBuilder builder) { + super(builder); + } + + /** + * Returns an builder for {@link ClusterPrivilegeChangeRequestAuditEvent} + * @return a builder instance + */ + public static ClusterPrivilegeChangeRequestAuditEventBuilder builder() { + return new ClusterPrivilegeChangeRequestAuditEventBuilder(); + } + +} http://git-wip-us.apache.org/repos/asf/ambari/blob/017561f1/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/ConfigurationChangeRequestAuditEvent.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/ConfigurationChangeRequestAuditEvent.java b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/ConfigurationChangeRequestAuditEvent.java new file mode 100644 index 0000000..5be9d7e --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/ConfigurationChangeRequestAuditEvent.java @@ -0,0 +1,90 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.audit.request.event; + +import org.apache.ambari.server.audit.request.RequestAuditEvent; + +/** + * Base class for start operation audit events. + */ +public class ConfigurationChangeRequestAuditEvent extends RequestAuditEvent { + + public static class ConfigurationChangeRequestAuditEventBuilder extends RequestAuditEventBuilder<ConfigurationChangeRequestAuditEvent, ConfigurationChangeRequestAuditEventBuilder> { + + private String versionNumber; + + private String versionNote; + + public ConfigurationChangeRequestAuditEventBuilder() { + super.withOperation("Configuration change"); + } + + @Override + protected ConfigurationChangeRequestAuditEvent newAuditEvent() { + return new ConfigurationChangeRequestAuditEvent(this); + } + + /** + * Appends to the event the details of the incoming request. + * @param builder builder for the audit event details. + */ + @Override + protected void buildAuditMessage(StringBuilder builder) { + super.buildAuditMessage(builder); + + builder + .append(", VersionNumber(V") + .append(versionNumber) + .append("), ") + .append("VersionNote(") + .append(versionNote) + .append(")"); + } + + public ConfigurationChangeRequestAuditEventBuilder withVersionNumber(String versionNumber) { + this.versionNumber = versionNumber; + return this; + } + + public ConfigurationChangeRequestAuditEventBuilder withVersionNote(String versionNote) { + this.versionNote = versionNote; + return this; + } + + } + + protected ConfigurationChangeRequestAuditEvent() { + } + + /** + * {@inheritDoc} + */ + protected ConfigurationChangeRequestAuditEvent(ConfigurationChangeRequestAuditEventBuilder builder) { + super(builder); + } + + /** + * Returns an builder for {@link ConfigurationChangeRequestAuditEvent} + * @return a builder instance + */ + public static ConfigurationChangeRequestAuditEventBuilder builder() { + return new ConfigurationChangeRequestAuditEventBuilder(); + } + +} http://git-wip-us.apache.org/repos/asf/ambari/blob/017561f1/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/CreateGroupRequestAuditEvent.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/CreateGroupRequestAuditEvent.java b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/CreateGroupRequestAuditEvent.java new file mode 100644 index 0000000..bd897a7 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/CreateGroupRequestAuditEvent.java @@ -0,0 +1,77 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.audit.request.event; + +import org.apache.ambari.server.audit.request.RequestAuditEvent; + +public class CreateGroupRequestAuditEvent extends RequestAuditEvent { + + public static class CreateGroupRequestAuditEventBuilder extends RequestAuditEventBuilder<CreateGroupRequestAuditEvent, CreateGroupRequestAuditEventBuilder> { + + private String groupName; + + public CreateGroupRequestAuditEventBuilder() { + super.withOperation("Group create"); + } + + @Override + protected CreateGroupRequestAuditEvent newAuditEvent() { + return new CreateGroupRequestAuditEvent(this); + } + + /** + * Appends to the event the details of the incoming request. + * @param builder builder for the audit event details. + */ + @Override + protected void buildAuditMessage(StringBuilder builder) { + super.buildAuditMessage(builder); + + builder + .append(", Group(") + .append(groupName) + .append(")"); + } + + public CreateGroupRequestAuditEventBuilder withGroupName(String groupName) { + this.groupName = groupName; + return this; + } + + } + + protected CreateGroupRequestAuditEvent() { + } + + /** + * {@inheritDoc} + */ + protected CreateGroupRequestAuditEvent(CreateGroupRequestAuditEventBuilder builder) { + super(builder); + } + + /** + * Returns an builder for {@link CreateGroupRequestAuditEvent} + * @return a builder instance + */ + public static CreateGroupRequestAuditEventBuilder builder() { + return new CreateGroupRequestAuditEventBuilder(); + } + +} http://git-wip-us.apache.org/repos/asf/ambari/blob/017561f1/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/CreateUserRequestAuditEvent.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/CreateUserRequestAuditEvent.java b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/CreateUserRequestAuditEvent.java new file mode 100644 index 0000000..300ed9b --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/CreateUserRequestAuditEvent.java @@ -0,0 +1,96 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.audit.request.event; + +import org.apache.ambari.server.audit.request.RequestAuditEvent; + +public class CreateUserRequestAuditEvent extends RequestAuditEvent { + + public static class CreateUserRequestAuditEventBuilder extends RequestAuditEventBuilder<CreateUserRequestAuditEvent, CreateUserRequestAuditEventBuilder> { + + private boolean admin; + + private boolean active; + + private String username; + + public CreateUserRequestAuditEventBuilder() { + super.withOperation("User create"); + } + + @Override + protected CreateUserRequestAuditEvent newAuditEvent() { + return new CreateUserRequestAuditEvent(this); + } + + /** + * Appends to the event the details of the incoming request. + * @param builder builder for the audit event details. + */ + @Override + protected void buildAuditMessage(StringBuilder builder) { + super.buildAuditMessage(builder); + + builder + .append(", Created Username(") + .append(username) + .append("), Active(") + .append(active ? "yes" : "no") + .append("), ") + .append("Administrator(") + .append(admin ? "yes" : "no") + .append(")"); + } + + public CreateUserRequestAuditEventBuilder withAdmin(boolean admin) { + this.admin = admin; + return this; + } + + public CreateUserRequestAuditEventBuilder withActive(boolean active) { + this.active = active; + return this; + } + + public CreateUserRequestAuditEventBuilder withCreatedUsername(String username) { + this.username = username; + return this; + } + + } + + protected CreateUserRequestAuditEvent() { + } + + /** + * {@inheritDoc} + */ + protected CreateUserRequestAuditEvent(CreateUserRequestAuditEventBuilder builder) { + super(builder); + } + + /** + * Returns an builder for {@link CreateUserRequestAuditEvent} + * @return a builder instance + */ + public static CreateUserRequestAuditEventBuilder builder() { + return new CreateUserRequestAuditEventBuilder(); + } + +} http://git-wip-us.apache.org/repos/asf/ambari/blob/017561f1/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/DeleteBlueprintRequestAuditEvent.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/DeleteBlueprintRequestAuditEvent.java b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/DeleteBlueprintRequestAuditEvent.java new file mode 100644 index 0000000..b8ada1e --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/DeleteBlueprintRequestAuditEvent.java @@ -0,0 +1,77 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.audit.request.event; + +import org.apache.ambari.server.audit.request.RequestAuditEvent; + +public class DeleteBlueprintRequestAuditEvent extends RequestAuditEvent { + + public static class DeleteBlueprintRequestAuditEventBuilder extends RequestAuditEventBuilder<DeleteBlueprintRequestAuditEvent, DeleteBlueprintRequestAuditEventBuilder> { + + private String blueprintName; + + public DeleteBlueprintRequestAuditEventBuilder() { + super.withOperation("Delete blueprint"); + } + + @Override + protected DeleteBlueprintRequestAuditEvent newAuditEvent() { + return new DeleteBlueprintRequestAuditEvent(this); + } + + /** + * Appends to the event the details of the incoming request. + * @param builder builder for the audit event details. + */ + @Override + protected void buildAuditMessage(StringBuilder builder) { + super.buildAuditMessage(builder); + + builder + .append(", Blueprint name(") + .append(blueprintName) + .append(")"); + } + + public DeleteBlueprintRequestAuditEventBuilder withBlueprintName(String blueprintName) { + this.blueprintName = blueprintName; + return this; + } + + } + + protected DeleteBlueprintRequestAuditEvent() { + } + + /** + * {@inheritDoc} + */ + protected DeleteBlueprintRequestAuditEvent(DeleteBlueprintRequestAuditEventBuilder builder) { + super(builder); + } + + /** + * Returns an builder for {@link DeleteBlueprintRequestAuditEvent} + * @return a builder instance + */ + public static DeleteBlueprintRequestAuditEventBuilder builder() { + return new DeleteBlueprintRequestAuditEventBuilder(); + } + +} http://git-wip-us.apache.org/repos/asf/ambari/blob/017561f1/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/DeleteGroupRequestAuditEvent.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/DeleteGroupRequestAuditEvent.java b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/DeleteGroupRequestAuditEvent.java new file mode 100644 index 0000000..3241976 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/DeleteGroupRequestAuditEvent.java @@ -0,0 +1,77 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.audit.request.event; + +import org.apache.ambari.server.audit.request.RequestAuditEvent; + +public class DeleteGroupRequestAuditEvent extends RequestAuditEvent { + + public static class DeleteGroupRequestAuditEventBuilder extends RequestAuditEventBuilder<DeleteGroupRequestAuditEvent, DeleteGroupRequestAuditEventBuilder> { + + private String groupName; + + public DeleteGroupRequestAuditEventBuilder() { + super.withOperation("Group delete"); + } + + @Override + protected DeleteGroupRequestAuditEvent newAuditEvent() { + return new DeleteGroupRequestAuditEvent(this); + } + + /** + * Appends to the event the details of the incoming request. + * @param builder builder for the audit event details. + */ + @Override + protected void buildAuditMessage(StringBuilder builder) { + super.buildAuditMessage(builder); + + builder + .append(", Group(") + .append(groupName) + .append(")"); + } + + public DeleteGroupRequestAuditEventBuilder withGroupName(String groupName) { + this.groupName = groupName; + return this; + } + + } + + protected DeleteGroupRequestAuditEvent() { + } + + /** + * {@inheritDoc} + */ + protected DeleteGroupRequestAuditEvent(DeleteGroupRequestAuditEventBuilder builder) { + super(builder); + } + + /** + * Returns an builder for {@link DeleteGroupRequestAuditEvent} + * @return a builder instance + */ + public static DeleteGroupRequestAuditEventBuilder builder() { + return new DeleteGroupRequestAuditEventBuilder(); + } + +} http://git-wip-us.apache.org/repos/asf/ambari/blob/017561f1/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/DeleteUserRequestAuditEvent.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/DeleteUserRequestAuditEvent.java b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/DeleteUserRequestAuditEvent.java new file mode 100644 index 0000000..59be3f7 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/DeleteUserRequestAuditEvent.java @@ -0,0 +1,77 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.audit.request.event; + +import org.apache.ambari.server.audit.request.RequestAuditEvent; + +public class DeleteUserRequestAuditEvent extends RequestAuditEvent { + + public static class DeleteUserRequestAuditEventBuilder extends RequestAuditEventBuilder<DeleteUserRequestAuditEvent, DeleteUserRequestAuditEventBuilder> { + + private String username; + + public DeleteUserRequestAuditEventBuilder() { + super.withOperation("User delete"); + } + + @Override + protected DeleteUserRequestAuditEvent newAuditEvent() { + return new DeleteUserRequestAuditEvent(this); + } + + /** + * Appends to the event the details of the incoming request. + * @param builder builder for the audit event details. + */ + @Override + protected void buildAuditMessage(StringBuilder builder) { + super.buildAuditMessage(builder); + + builder + .append(", Deleted Username(") + .append(username) + .append(")"); + } + + public DeleteUserRequestAuditEventBuilder withDeletedUsername(String username) { + this.username = username; + return this; + } + + } + + protected DeleteUserRequestAuditEvent() { + } + + /** + * {@inheritDoc} + */ + protected DeleteUserRequestAuditEvent(DeleteUserRequestAuditEventBuilder builder) { + super(builder); + } + + /** + * Returns an builder for {@link DeleteUserRequestAuditEvent} + * @return a builder instance + */ + public static DeleteUserRequestAuditEventBuilder builder() { + return new DeleteUserRequestAuditEventBuilder(); + } + +} http://git-wip-us.apache.org/repos/asf/ambari/blob/017561f1/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/DeleteViewInstanceRequestAuditEvent.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/DeleteViewInstanceRequestAuditEvent.java b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/DeleteViewInstanceRequestAuditEvent.java new file mode 100644 index 0000000..4d14321 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/DeleteViewInstanceRequestAuditEvent.java @@ -0,0 +1,93 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.audit.request.event; + +import org.apache.ambari.server.audit.request.RequestAuditEvent; + +public class DeleteViewInstanceRequestAuditEvent extends RequestAuditEvent { + + public static class DeleteViewInstanceRequestAuditEventBuilder extends RequestAuditEventBuilder<DeleteViewInstanceRequestAuditEvent, DeleteViewInstanceRequestAuditEventBuilder> { + + private String name; + + private String type; + + private String version; + + public DeleteViewInstanceRequestAuditEventBuilder() { + super.withOperation("View deletion"); + } + + @Override + protected DeleteViewInstanceRequestAuditEvent newAuditEvent() { + return new DeleteViewInstanceRequestAuditEvent(this); + } + + /** + * Appends to the event the details of the incoming request. + * @param builder builder for the audit event details. + */ + @Override + protected void buildAuditMessage(StringBuilder builder) { + super.buildAuditMessage(builder); + + builder.append(", Type(") + .append(type) + .append("), Version(") + .append(version) + .append("), Name(") + .append(name) + .append(")"); + } + + public DeleteViewInstanceRequestAuditEventBuilder withName(String name) { + this.name = name; + return this; + } + + public DeleteViewInstanceRequestAuditEventBuilder withType(String type) { + this.type = type; + return this; + } + + public DeleteViewInstanceRequestAuditEventBuilder withVersion(String version) { + this.version = version; + return this; + } + } + + protected DeleteViewInstanceRequestAuditEvent() { + } + + /** + * {@inheritDoc} + */ + protected DeleteViewInstanceRequestAuditEvent(DeleteViewInstanceRequestAuditEventBuilder builder) { + super(builder); + } + + /** + * Returns an builder for {@link DeleteViewInstanceRequestAuditEvent} + * @return a builder instance + */ + public static DeleteViewInstanceRequestAuditEventBuilder builder() { + return new DeleteViewInstanceRequestAuditEventBuilder(); + } + +} http://git-wip-us.apache.org/repos/asf/ambari/blob/017561f1/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/MembershipChangeRequestAuditEvent.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/MembershipChangeRequestAuditEvent.java b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/MembershipChangeRequestAuditEvent.java new file mode 100644 index 0000000..3bc5013 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/MembershipChangeRequestAuditEvent.java @@ -0,0 +1,94 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.audit.request.event; + +import java.util.List; + +import org.apache.ambari.server.audit.request.RequestAuditEvent; +import org.apache.commons.lang.StringUtils; + +public class MembershipChangeRequestAuditEvent extends RequestAuditEvent { + + public static class AddUserToGroupRequestAuditEventBuilder extends RequestAuditEventBuilder<MembershipChangeRequestAuditEvent, AddUserToGroupRequestAuditEventBuilder> { + + private List<String> userNameList; + + private String groupName; + + public AddUserToGroupRequestAuditEventBuilder() { + super.withOperation("Membership change"); + } + + @Override + protected MembershipChangeRequestAuditEvent newAuditEvent() { + return new MembershipChangeRequestAuditEvent(this); + } + + /** + * Appends to the event the details of the incoming request. + * @param builder builder for the audit event details. + */ + @Override + protected void buildAuditMessage(StringBuilder builder) { + super.buildAuditMessage(builder); + + builder.append(", Group(") + .append(groupName) + .append("), Members("); + + if(userNameList.isEmpty()) { + builder.append("<empty>"); + } + + StringUtils.join(userNameList, ", "); + + builder.append(")"); + } + + public AddUserToGroupRequestAuditEventBuilder withUserNameList(List<String> users) { + this.userNameList = users; + return this; + } + + public AddUserToGroupRequestAuditEventBuilder withGroupName(String groupName) { + this.groupName = groupName; + return this; + } + + } + + protected MembershipChangeRequestAuditEvent() { + } + + /** + * {@inheritDoc} + */ + protected MembershipChangeRequestAuditEvent(AddUserToGroupRequestAuditEventBuilder builder) { + super(builder); + } + + /** + * Returns an builder for {@link MembershipChangeRequestAuditEvent} + * @return a builder instance + */ + public static AddUserToGroupRequestAuditEventBuilder builder() { + return new AddUserToGroupRequestAuditEventBuilder(); + } + +} http://git-wip-us.apache.org/repos/asf/ambari/blob/017561f1/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/PrivilegeChangeRequestAuditEvent.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/PrivilegeChangeRequestAuditEvent.java b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/PrivilegeChangeRequestAuditEvent.java new file mode 100644 index 0000000..5820ee4 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/PrivilegeChangeRequestAuditEvent.java @@ -0,0 +1,96 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.audit.request.event; + +import org.apache.ambari.server.audit.request.RequestAuditEvent; + +public class PrivilegeChangeRequestAuditEvent extends RequestAuditEvent { + + public static class PrivilegeChangeRequestAuditEventBuilder extends RequestAuditEventBuilder<PrivilegeChangeRequestAuditEvent, PrivilegeChangeRequestAuditEventBuilder> { + + private String user; + + private String group; + + private String role; + + public PrivilegeChangeRequestAuditEventBuilder() { + super.withOperation("Role change"); + } + + @Override + protected PrivilegeChangeRequestAuditEvent newAuditEvent() { + return new PrivilegeChangeRequestAuditEvent(this); + } + + /** + * Appends to the event the details of the incoming request. + * @param builder builder for the audit event details. + */ + @Override + protected void buildAuditMessage(StringBuilder builder) { + super.buildAuditMessage(builder); + + builder.append(", Role(") + .append(role) + .append(")"); + + if(user != null) { + builder.append(", User(").append(user).append(")"); + } + if(group != null) { + builder.append(", Group(").append(group).append(")"); + } + } + + public PrivilegeChangeRequestAuditEventBuilder withUser(String user) { + this.user = user; + return this; + } + + public PrivilegeChangeRequestAuditEventBuilder withGroup(String group) { + this.group = group; + return this; + } + + public PrivilegeChangeRequestAuditEventBuilder withRole(String role) { + this.role = role; + return this; + } + } + + protected PrivilegeChangeRequestAuditEvent() { + } + + /** + * {@inheritDoc} + */ + protected PrivilegeChangeRequestAuditEvent(PrivilegeChangeRequestAuditEventBuilder builder) { + super(builder); + } + + /** + * Returns an builder for {@link PrivilegeChangeRequestAuditEvent} + * @return a builder instance + */ + public static PrivilegeChangeRequestAuditEventBuilder builder() { + return new PrivilegeChangeRequestAuditEventBuilder(); + } + +} http://git-wip-us.apache.org/repos/asf/ambari/blob/017561f1/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/RemoveUserFromGroupRequestAuditEvent.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/RemoveUserFromGroupRequestAuditEvent.java b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/RemoveUserFromGroupRequestAuditEvent.java new file mode 100644 index 0000000..34a2493 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/RemoveUserFromGroupRequestAuditEvent.java @@ -0,0 +1,83 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.audit.request.event; + +import org.apache.ambari.server.audit.request.RequestAuditEvent; + +public class RemoveUserFromGroupRequestAuditEvent extends RequestAuditEvent { + + public static class AddUserToGroupRequestAuditEventBuilder extends RequestAuditEventBuilder<RemoveUserFromGroupRequestAuditEvent, AddUserToGroupRequestAuditEventBuilder> { + + private String groupName; + private String affectedUserName; + + public AddUserToGroupRequestAuditEventBuilder() { + super.withOperation("User removal from group"); + } + + @Override + protected RemoveUserFromGroupRequestAuditEvent newAuditEvent() { + return new RemoveUserFromGroupRequestAuditEvent(this); + } + + /** + * Appends to the event the details of the incoming request. + * @param builder builder for the audit event details. + */ + @Override + protected void buildAuditMessage(StringBuilder builder) { + super.buildAuditMessage(builder); + + builder.append(", Group("); + builder.append(groupName); + builder.append("), Affected username("); + builder.append(affectedUserName); + builder.append(")"); + } + + public AddUserToGroupRequestAuditEventBuilder withGroupName(String groupName) { + this.groupName = groupName; + return this; + } + + public AddUserToGroupRequestAuditEventBuilder withAffectedUserName(String userName) { + this.affectedUserName = userName; + return this; + } + } + + protected RemoveUserFromGroupRequestAuditEvent() { + } + + /** + * {@inheritDoc} + */ + protected RemoveUserFromGroupRequestAuditEvent(AddUserToGroupRequestAuditEventBuilder builder) { + super(builder); + } + + /** + * Returns an builder for {@link RemoveUserFromGroupRequestAuditEvent} + * @return a builder instance + */ + public static AddUserToGroupRequestAuditEventBuilder builder() { + return new AddUserToGroupRequestAuditEventBuilder(); + } + +} http://git-wip-us.apache.org/repos/asf/ambari/blob/017561f1/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/UserPasswordChangeRequestAuditEvent.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/UserPasswordChangeRequestAuditEvent.java b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/UserPasswordChangeRequestAuditEvent.java new file mode 100644 index 0000000..40f5b55 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/UserPasswordChangeRequestAuditEvent.java @@ -0,0 +1,77 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.audit.request.event; + +import org.apache.ambari.server.audit.request.RequestAuditEvent; + +public class UserPasswordChangeRequestAuditEvent extends RequestAuditEvent { + + public static class UserPasswordChangeRequestAuditEventBuilder extends RequestAuditEventBuilder<UserPasswordChangeRequestAuditEvent, UserPasswordChangeRequestAuditEventBuilder> { + + private String username; + + public UserPasswordChangeRequestAuditEventBuilder() { + super.withOperation("Password change"); + } + + @Override + protected UserPasswordChangeRequestAuditEvent newAuditEvent() { + return new UserPasswordChangeRequestAuditEvent(this); + } + + /** + * Appends to the event the details of the incoming request. + * @param builder builder for the audit event details. + */ + @Override + protected void buildAuditMessage(StringBuilder builder) { + super.buildAuditMessage(builder); + + builder + .append(", Affected username(") + .append(username) + .append(")"); + } + + + public UserPasswordChangeRequestAuditEventBuilder withAffectedUsername(String username) { + this.username = username; + return this; + } + } + + protected UserPasswordChangeRequestAuditEvent() { + } + + /** + * {@inheritDoc} + */ + protected UserPasswordChangeRequestAuditEvent(UserPasswordChangeRequestAuditEventBuilder builder) { + super(builder); + } + + /** + * Returns an builder for {@link UserPasswordChangeRequestAuditEvent} + * @return a builder instance + */ + public static UserPasswordChangeRequestAuditEventBuilder builder() { + return new UserPasswordChangeRequestAuditEventBuilder(); + } + +} http://git-wip-us.apache.org/repos/asf/ambari/blob/017561f1/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/ViewPrivilegeChangeRequestAuditEvent.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/ViewPrivilegeChangeRequestAuditEvent.java b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/ViewPrivilegeChangeRequestAuditEvent.java new file mode 100644 index 0000000..55d1b96 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/event/ViewPrivilegeChangeRequestAuditEvent.java @@ -0,0 +1,139 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.audit.request.event; + +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.apache.ambari.server.audit.request.RequestAuditEvent; +import org.apache.commons.lang.StringUtils; + +public class ViewPrivilegeChangeRequestAuditEvent extends RequestAuditEvent { + + public static class ViewPrivilegeChangeRequestAuditEventBuilder extends RequestAuditEventBuilder<ViewPrivilegeChangeRequestAuditEvent, ViewPrivilegeChangeRequestAuditEventBuilder> { + + private Map<String, List<String>> users; + private Map<String, List<String>> groups; + + private String name; + + private String type; + + private String version; + + + public ViewPrivilegeChangeRequestAuditEventBuilder() { + super.withOperation("View permission change"); + } + + @Override + protected ViewPrivilegeChangeRequestAuditEvent newAuditEvent() { + return new ViewPrivilegeChangeRequestAuditEvent(this); + } + + /** + * Appends to the event the details of the incoming request. + * @param builder builder for the audit event details. + */ + @Override + protected void buildAuditMessage(StringBuilder builder) { + super.buildAuditMessage(builder); + + builder.append(", Type(") + .append(type) + .append("), Version(") + .append(version) + .append("), Name(") + .append(name) + .append(")"); + + Set<String> roleSet = new HashSet<String>(); + roleSet.addAll(users.keySet()); + roleSet.addAll(groups.keySet()); + + builder.append(", Permissions("); + if(!users.isEmpty() || !groups.isEmpty()) { + builder.append(System.lineSeparator()); + } + + List<String> lines = new LinkedList<String>(); + + for(String role : roleSet) { + lines.add(role + ": "); + if(users.get(role) != null && !users.get(role).isEmpty()) { + lines.add(" Users: " + StringUtils.join(users.get(role), ", ")); + } + if(groups.get(role) != null && !groups.get(role).isEmpty()) { + lines.add(" Groups: " + StringUtils.join(groups.get(role), ", ")); + } + } + + builder.append(StringUtils.join(lines,System.lineSeparator())); + + builder.append(")"); + } + + public ViewPrivilegeChangeRequestAuditEventBuilder withName(String name) { + this.name = name; + return this; + } + + public ViewPrivilegeChangeRequestAuditEventBuilder withType(String type) { + this.type = type; + return this; + } + + public ViewPrivilegeChangeRequestAuditEventBuilder withVersion(String version) { + this.version = version; + return this; + } + + public ViewPrivilegeChangeRequestAuditEventBuilder withUsers(Map<String, List<String>> users) { + this.users = users; + return this; + } + + public ViewPrivilegeChangeRequestAuditEventBuilder withGroups(Map<String, List<String>> groups) { + this.groups = groups; + return this; + } + } + + protected ViewPrivilegeChangeRequestAuditEvent() { + } + + /** + * {@inheritDoc} + */ + protected ViewPrivilegeChangeRequestAuditEvent(ViewPrivilegeChangeRequestAuditEventBuilder builder) { + super(builder); + } + + /** + * Returns an builder for {@link ViewPrivilegeChangeRequestAuditEvent} + * @return a builder instance + */ + public static ViewPrivilegeChangeRequestAuditEventBuilder builder() { + return new ViewPrivilegeChangeRequestAuditEventBuilder(); + } + +} http://git-wip-us.apache.org/repos/asf/ambari/blob/017561f1/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/BlueprintEventCreator.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/BlueprintEventCreator.java b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/BlueprintEventCreator.java index 07d62cf..c41d665 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/BlueprintEventCreator.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/BlueprintEventCreator.java @@ -26,9 +26,8 @@ import org.apache.ambari.server.api.services.Request; import org.apache.ambari.server.api.services.Result; import org.apache.ambari.server.api.services.ResultStatus; import org.apache.ambari.server.audit.AuditEvent; -import org.apache.ambari.server.audit.request.AddBlueprintRequestAuditEvent; -import org.apache.ambari.server.audit.request.BlueprintExportRequestAuditEvent; -import org.apache.ambari.server.audit.request.DeleteBlueprintRequestAuditEvent; +import org.apache.ambari.server.audit.request.event.AddBlueprintRequestAuditEvent; +import org.apache.ambari.server.audit.request.event.DeleteBlueprintRequestAuditEvent; import org.apache.ambari.server.audit.request.RequestAuditEventCreator; import org.apache.ambari.server.controller.spi.Resource; import org.joda.time.DateTime; http://git-wip-us.apache.org/repos/asf/ambari/blob/017561f1/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/BlueprintExportEventCreator.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/BlueprintExportEventCreator.java b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/BlueprintExportEventCreator.java index 08ec414..c97f2af 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/BlueprintExportEventCreator.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/BlueprintExportEventCreator.java @@ -20,22 +20,15 @@ package org.apache.ambari.server.audit.request.eventcreator; import java.util.Collections; import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; import java.util.Set; import org.apache.ambari.server.api.services.Request; import org.apache.ambari.server.api.services.Result; import org.apache.ambari.server.api.services.ResultStatus; import org.apache.ambari.server.audit.AuditEvent; -import org.apache.ambari.server.audit.request.AddUserToGroupRequestAuditEvent; -import org.apache.ambari.server.audit.request.BlueprintExportRequestAuditEvent; -import org.apache.ambari.server.audit.request.MembershipChangeRequestAuditEvent; -import org.apache.ambari.server.audit.request.RemoveUserFromGroupRequestAuditEvent; +import org.apache.ambari.server.audit.request.event.BlueprintExportRequestAuditEvent; import org.apache.ambari.server.audit.request.RequestAuditEventCreator; import org.apache.ambari.server.controller.spi.Resource; -import org.apache.ambari.server.controller.utilities.PropertyHelper; import org.joda.time.DateTime; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.userdetails.User; http://git-wip-us.apache.org/repos/asf/ambari/blob/017561f1/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/ConfigurationChangeEventCreator.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/ConfigurationChangeEventCreator.java b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/ConfigurationChangeEventCreator.java index e1b3bd3..e40dbdd 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/ConfigurationChangeEventCreator.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/ConfigurationChangeEventCreator.java @@ -27,7 +27,7 @@ import org.apache.ambari.server.api.services.Request; import org.apache.ambari.server.api.services.Result; import org.apache.ambari.server.api.services.ResultStatus; import org.apache.ambari.server.audit.AuditEvent; -import org.apache.ambari.server.audit.request.ConfigurationChangeRequestAuditEvent; +import org.apache.ambari.server.audit.request.event.ConfigurationChangeRequestAuditEvent; import org.apache.ambari.server.audit.request.RequestAuditEventCreator; import org.apache.ambari.server.controller.spi.Resource; import org.joda.time.DateTime; http://git-wip-us.apache.org/repos/asf/ambari/blob/017561f1/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/GroupEventCreator.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/GroupEventCreator.java b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/GroupEventCreator.java index 616cd4f..666b488 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/GroupEventCreator.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/GroupEventCreator.java @@ -20,21 +20,15 @@ package org.apache.ambari.server.audit.request.eventcreator; import java.util.Collections; import java.util.HashSet; -import java.util.Map; import java.util.Set; import org.apache.ambari.server.api.services.Request; import org.apache.ambari.server.api.services.Result; import org.apache.ambari.server.api.services.ResultStatus; import org.apache.ambari.server.audit.AuditEvent; -import org.apache.ambari.server.audit.request.ActivateUserRequestAuditEvent; -import org.apache.ambari.server.audit.request.AdminUserRequestAuditEvent; -import org.apache.ambari.server.audit.request.CreateGroupRequestAuditEvent; -import org.apache.ambari.server.audit.request.CreateUserRequestAuditEvent; -import org.apache.ambari.server.audit.request.DeleteGroupRequestAuditEvent; -import org.apache.ambari.server.audit.request.DeleteUserRequestAuditEvent; +import org.apache.ambari.server.audit.request.event.CreateGroupRequestAuditEvent; +import org.apache.ambari.server.audit.request.event.DeleteGroupRequestAuditEvent; import org.apache.ambari.server.audit.request.RequestAuditEventCreator; -import org.apache.ambari.server.audit.request.UserPasswordChangeRequestAuditEvent; import org.apache.ambari.server.controller.spi.Resource; import org.apache.ambari.server.controller.utilities.PropertyHelper; import org.joda.time.DateTime; http://git-wip-us.apache.org/repos/asf/ambari/blob/017561f1/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/MemberEventCreator.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/MemberEventCreator.java b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/MemberEventCreator.java index 5b9f254..7162250 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/MemberEventCreator.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/MemberEventCreator.java @@ -18,7 +18,6 @@ package org.apache.ambari.server.audit.request.eventcreator; -import java.util.AbstractMap; import java.util.Collections; import java.util.HashSet; import java.util.LinkedList; @@ -30,9 +29,9 @@ import org.apache.ambari.server.api.services.Request; import org.apache.ambari.server.api.services.Result; import org.apache.ambari.server.api.services.ResultStatus; import org.apache.ambari.server.audit.AuditEvent; -import org.apache.ambari.server.audit.request.AddUserToGroupRequestAuditEvent; -import org.apache.ambari.server.audit.request.MembershipChangeRequestAuditEvent; -import org.apache.ambari.server.audit.request.RemoveUserFromGroupRequestAuditEvent; +import org.apache.ambari.server.audit.request.event.AddUserToGroupRequestAuditEvent; +import org.apache.ambari.server.audit.request.event.MembershipChangeRequestAuditEvent; +import org.apache.ambari.server.audit.request.event.RemoveUserFromGroupRequestAuditEvent; import org.apache.ambari.server.audit.request.RequestAuditEventCreator; import org.apache.ambari.server.controller.spi.Resource; import org.apache.ambari.server.controller.utilities.PropertyHelper; http://git-wip-us.apache.org/repos/asf/ambari/blob/017561f1/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/PrivilegeEventCreator.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/PrivilegeEventCreator.java b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/PrivilegeEventCreator.java index a786346..fbdeaf7 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/PrivilegeEventCreator.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/PrivilegeEventCreator.java @@ -30,11 +30,8 @@ import org.apache.ambari.server.api.services.Request; import org.apache.ambari.server.api.services.Result; import org.apache.ambari.server.api.services.ResultStatus; import org.apache.ambari.server.audit.AuditEvent; -import org.apache.ambari.server.audit.request.AddUserToGroupRequestAuditEvent; -import org.apache.ambari.server.audit.request.ClusterPrivilegeChangeRequestAuditEvent; -import org.apache.ambari.server.audit.request.MembershipChangeRequestAuditEvent; -import org.apache.ambari.server.audit.request.PrivilegeChangeRequestAuditEvent; -import org.apache.ambari.server.audit.request.RemoveUserFromGroupRequestAuditEvent; +import org.apache.ambari.server.audit.request.event.ClusterPrivilegeChangeRequestAuditEvent; +import org.apache.ambari.server.audit.request.event.PrivilegeChangeRequestAuditEvent; import org.apache.ambari.server.audit.request.RequestAuditEventCreator; import org.apache.ambari.server.controller.spi.Resource; import org.apache.ambari.server.controller.utilities.PropertyHelper; http://git-wip-us.apache.org/repos/asf/ambari/blob/017561f1/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/ServiceConfigDownloadEventCreator.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/ServiceConfigDownloadEventCreator.java b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/ServiceConfigDownloadEventCreator.java index d6ea2dd..34c93eb 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/ServiceConfigDownloadEventCreator.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/ServiceConfigDownloadEventCreator.java @@ -26,8 +26,7 @@ import org.apache.ambari.server.api.services.Request; import org.apache.ambari.server.api.services.Result; import org.apache.ambari.server.api.services.ResultStatus; import org.apache.ambari.server.audit.AuditEvent; -import org.apache.ambari.server.audit.request.BlueprintExportRequestAuditEvent; -import org.apache.ambari.server.audit.request.ClientConfigDownloadRequestAuditEvent; +import org.apache.ambari.server.audit.request.event.ClientConfigDownloadRequestAuditEvent; import org.apache.ambari.server.audit.request.RequestAuditEventCreator; import org.apache.ambari.server.controller.spi.Resource; import org.joda.time.DateTime; http://git-wip-us.apache.org/repos/asf/ambari/blob/017561f1/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/UserEventCreator.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/UserEventCreator.java b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/UserEventCreator.java index a1d119e..e8386c8 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/UserEventCreator.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/UserEventCreator.java @@ -20,19 +20,18 @@ package org.apache.ambari.server.audit.request.eventcreator; import java.util.Collections; import java.util.HashSet; -import java.util.Map; import java.util.Set; import org.apache.ambari.server.api.services.Request; import org.apache.ambari.server.api.services.Result; import org.apache.ambari.server.api.services.ResultStatus; import org.apache.ambari.server.audit.AuditEvent; -import org.apache.ambari.server.audit.request.ActivateUserRequestAuditEvent; -import org.apache.ambari.server.audit.request.AdminUserRequestAuditEvent; -import org.apache.ambari.server.audit.request.CreateUserRequestAuditEvent; -import org.apache.ambari.server.audit.request.DeleteUserRequestAuditEvent; +import org.apache.ambari.server.audit.request.event.ActivateUserRequestAuditEvent; +import org.apache.ambari.server.audit.request.event.AdminUserRequestAuditEvent; +import org.apache.ambari.server.audit.request.event.CreateUserRequestAuditEvent; +import org.apache.ambari.server.audit.request.event.DeleteUserRequestAuditEvent; import org.apache.ambari.server.audit.request.RequestAuditEventCreator; -import org.apache.ambari.server.audit.request.UserPasswordChangeRequestAuditEvent; +import org.apache.ambari.server.audit.request.event.UserPasswordChangeRequestAuditEvent; import org.apache.ambari.server.controller.spi.Resource; import org.apache.ambari.server.controller.utilities.PropertyHelper; import org.joda.time.DateTime; http://git-wip-us.apache.org/repos/asf/ambari/blob/017561f1/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/ViewInstanceEventCreator.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/ViewInstanceEventCreator.java b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/ViewInstanceEventCreator.java index 31e2c1f..59f8fbf 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/ViewInstanceEventCreator.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/ViewInstanceEventCreator.java @@ -26,15 +26,10 @@ import org.apache.ambari.server.api.services.Request; import org.apache.ambari.server.api.services.Result; import org.apache.ambari.server.api.services.ResultStatus; import org.apache.ambari.server.audit.AuditEvent; -import org.apache.ambari.server.audit.request.ActivateUserRequestAuditEvent; -import org.apache.ambari.server.audit.request.AddViewInstanceRequestAuditEvent; -import org.apache.ambari.server.audit.request.AdminUserRequestAuditEvent; -import org.apache.ambari.server.audit.request.ChangeViewInstanceRequestAuditEvent; -import org.apache.ambari.server.audit.request.CreateUserRequestAuditEvent; -import org.apache.ambari.server.audit.request.DeleteUserRequestAuditEvent; -import org.apache.ambari.server.audit.request.DeleteViewInstanceRequestAuditEvent; +import org.apache.ambari.server.audit.request.event.AddViewInstanceRequestAuditEvent; +import org.apache.ambari.server.audit.request.event.ChangeViewInstanceRequestAuditEvent; +import org.apache.ambari.server.audit.request.event.DeleteViewInstanceRequestAuditEvent; import org.apache.ambari.server.audit.request.RequestAuditEventCreator; -import org.apache.ambari.server.audit.request.UserPasswordChangeRequestAuditEvent; import org.apache.ambari.server.controller.spi.Resource; import org.apache.ambari.server.controller.utilities.PropertyHelper; import org.joda.time.DateTime; http://git-wip-us.apache.org/repos/asf/ambari/blob/017561f1/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/ViewPrivilegeEventCreator.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/ViewPrivilegeEventCreator.java b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/ViewPrivilegeEventCreator.java index 7facd8d..fc57428 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/ViewPrivilegeEventCreator.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/ViewPrivilegeEventCreator.java @@ -30,11 +30,8 @@ import org.apache.ambari.server.api.services.Request; import org.apache.ambari.server.api.services.Result; import org.apache.ambari.server.api.services.ResultStatus; import org.apache.ambari.server.audit.AuditEvent; -import org.apache.ambari.server.audit.request.AddViewInstanceRequestAuditEvent; -import org.apache.ambari.server.audit.request.ChangeViewInstanceRequestAuditEvent; -import org.apache.ambari.server.audit.request.DeleteViewInstanceRequestAuditEvent; import org.apache.ambari.server.audit.request.RequestAuditEventCreator; -import org.apache.ambari.server.audit.request.ViewPrivilegeChangeRequestAuditEvent; +import org.apache.ambari.server.audit.request.event.ViewPrivilegeChangeRequestAuditEvent; import org.apache.ambari.server.controller.spi.Resource; import org.apache.ambari.server.controller.utilities.PropertyHelper; import org.joda.time.DateTime;