summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/java/org/openecomp/sdc/be/auditing/impl/AuditConsumerEventFactory.java
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be/src/main/java/org/openecomp/sdc/be/auditing/impl/AuditConsumerEventFactory.java')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/auditing/impl/AuditConsumerEventFactory.java33
1 files changed, 15 insertions, 18 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/auditing/impl/AuditConsumerEventFactory.java b/catalog-be/src/main/java/org/openecomp/sdc/be/auditing/impl/AuditConsumerEventFactory.java
index 9176a1aa93..9233a1a73e 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/auditing/impl/AuditConsumerEventFactory.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/auditing/impl/AuditConsumerEventFactory.java
@@ -7,9 +7,9 @@
* Licensed 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.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdc.be.auditing.impl;
import org.openecomp.sdc.be.model.ConsumerDefinition;
@@ -36,18 +35,26 @@ public class AuditConsumerEventFactory extends AuditBaseEventFactory {
this(action, commonFields, buildConsumerName(ecompUser), buildUserName(modifier));
}
- public AuditConsumerEventFactory(AuditingActionEnum action, CommonAuditData commonFields,
- String ecompUser, String modifier, String timestamp) {
+ public AuditConsumerEventFactory(AuditingActionEnum action, CommonAuditData commonFields, String ecompUser, String modifier, String timestamp) {
this(action, commonFields, ecompUser, modifier);
this.event.setTimestamp1(timestamp);
}
- private AuditConsumerEventFactory(AuditingActionEnum action, CommonAuditData commonFields,
- String ecompUser, String modifier) {
+ private AuditConsumerEventFactory(AuditingActionEnum action, CommonAuditData commonFields, String ecompUser, String modifier) {
super(action);
event = new ConsumerEvent(getAction().getName(), commonFields, ecompUser, modifier);
}
+ static String buildConsumerName(ConsumerDefinition consumer) {
+ StringBuilder ecompUser = new StringBuilder();
+ if (consumer != null) {
+ appendIfNotEmpty(consumer.getConsumerName(), ecompUser, ",");
+ appendIfNotEmpty(consumer.getConsumerSalt(), ecompUser, ",");
+ appendIfNotEmpty(consumer.getConsumerPassword(), ecompUser, ",");
+ }
+ return ecompUser.toString();
+ }
+
@Override
public String getLogPattern() {
return LOG_STR;
@@ -55,21 +62,11 @@ public class AuditConsumerEventFactory extends AuditBaseEventFactory {
@Override
public String[] getLogMessageParams() {
- return new String[] {event.getAction(), event.getModifier(), event.getEcompUser(), event.getStatus(), event.getDesc()};
+ return new String[]{event.getAction(), event.getModifier(), event.getEcompUser(), event.getStatus(), event.getDesc()};
}
@Override
public AuditingGenericEvent getDbEvent() {
return event;
}
-
- static String buildConsumerName(ConsumerDefinition consumer) {
- StringBuilder ecompUser = new StringBuilder();
- if (consumer != null) {
- appendIfNotEmpty(consumer.getConsumerName(), ecompUser, ",");
- appendIfNotEmpty(consumer.getConsumerSalt(), ecompUser, ",");
- appendIfNotEmpty(consumer.getConsumerPassword(), ecompUser, ",");
- }
- return ecompUser.toString();
- }
}