diff options
author | 2018-07-29 16:13:45 +0300 | |
---|---|---|
committer | 2018-07-29 16:20:34 +0300 | |
commit | 5b593496b8f1b8e8be8d7d2dbcc223332e65a49b (patch) | |
tree | 2f9dfc45191e723da69cf74be7829784e9741b94 /catalog-be/src/main/java/org/openecomp/sdc/be/auditing/impl/distribution/AuditDistributionEngineEventFactoryManager.java | |
parent | 9200382f2ce7b4bb729aa287d0878004b2d2b4f9 (diff) |
re base code
Change-Id: I12a5ca14a6d8a87e9316b9ff362eb131105f98a5
Issue-ID: SDC-1566
Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'catalog-be/src/main/java/org/openecomp/sdc/be/auditing/impl/distribution/AuditDistributionEngineEventFactoryManager.java')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/auditing/impl/distribution/AuditDistributionEngineEventFactoryManager.java | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/auditing/impl/distribution/AuditDistributionEngineEventFactoryManager.java b/catalog-be/src/main/java/org/openecomp/sdc/be/auditing/impl/distribution/AuditDistributionEngineEventFactoryManager.java new file mode 100644 index 0000000000..a03665e966 --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/auditing/impl/distribution/AuditDistributionEngineEventFactoryManager.java @@ -0,0 +1,40 @@ +package org.openecomp.sdc.be.auditing.impl.distribution; + +import org.openecomp.sdc.be.auditing.api.AuditEventFactory; +import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum; +import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData; +import org.openecomp.sdc.be.resources.data.auditing.model.DistributionTopicData; +import org.openecomp.sdc.common.util.ThreadLocalsHolder; + +public class AuditDistributionEngineEventFactoryManager { + + public static AuditEventFactory createDistributionEngineEventFactory(AuditingActionEnum action, String environmentName, + DistributionTopicData distributionTopicData, String role, String apiKey, String status) { + AuditEventFactory factory; + + switch (action) { + case CREATE_DISTRIBUTION_TOPIC: + factory = new AuditCreateTopicDistributionEngineEventFactory( + CommonAuditData.newBuilder() + .status(status) + .requestId(ThreadLocalsHolder.getUuid()) + .build(), + distributionTopicData, apiKey, environmentName, role); + break; + case ADD_KEY_TO_TOPIC_ACL: + case REMOVE_KEY_FROM_TOPIC_ACL: + factory = new AuditAddRemoveKeyDistributionEngineEventFactory(action, + CommonAuditData.newBuilder() + .status(status) + .requestId(ThreadLocalsHolder.getUuid()) + .build(), + distributionTopicData, apiKey, environmentName, role); + break; + default: + throw new UnsupportedOperationException(); + + } + return factory; + + } +} |