2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
20 package org.openecomp.sdc.be.auditing.impl.resourceadmin;
22 import org.openecomp.sdc.be.auditing.impl.AuditBaseEventFactory;
23 import org.openecomp.sdc.be.model.User;
24 import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
25 import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent;
26 import org.openecomp.sdc.be.resources.data.auditing.ResourceAdminEvent;
27 import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
28 import org.openecomp.sdc.be.resources.data.auditing.model.ResourceCommonInfo;
29 import org.openecomp.sdc.be.resources.data.auditing.model.ResourceVersionInfo;
31 public abstract class AuditResourceAdminEventFactory extends AuditBaseEventFactory {
33 protected final ResourceAdminEvent event;
35 AuditResourceAdminEventFactory(AuditingActionEnum action, CommonAuditData commonFields, ResourceCommonInfo resourceCommonInfo,
36 ResourceVersionInfo prevParams, ResourceVersionInfo currParams, String invariantUuid, User modifier,
37 String artifactData, String comment, String did, String toscaNodeType) {
38 this(action, commonFields, resourceCommonInfo, prevParams, currParams, invariantUuid, AuditBaseEventFactory.buildUserName(modifier),
39 artifactData, AuditBaseEventFactory.replaceNullNameWithEmpty(comment), did, toscaNodeType);
42 AuditResourceAdminEventFactory(AuditingActionEnum action, CommonAuditData commonFields, ResourceCommonInfo resourceCommonInfo,
43 ResourceVersionInfo prevParams, ResourceVersionInfo currParams, String invariantUuid, String modifier,
44 String artifactData, String comment, String did, String toscaNodeType, String timestamp) {
45 this(action, commonFields, resourceCommonInfo, prevParams, currParams, invariantUuid, modifier, artifactData, comment, did, toscaNodeType);
46 this.event.setTimestamp1(timestamp);
49 private AuditResourceAdminEventFactory(AuditingActionEnum action, CommonAuditData commonFields, ResourceCommonInfo resourceCommonInfo,
50 ResourceVersionInfo prevParams, ResourceVersionInfo currParams, String invariantUuid, String modifier,
51 String artifactData, String comment, String did, String toscaNodeType) {
53 this.event = new ResourceAdminEvent(getAction().getName(), commonFields, resourceCommonInfo, prevParams, currParams, invariantUuid, modifier,
54 artifactData, comment, did, toscaNodeType);
58 public AuditingGenericEvent getDbEvent() {