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.distribution;
22 import org.openecomp.sdc.be.auditing.api.AuditEventFactory;
23 import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
24 import org.openecomp.sdc.be.resources.data.auditing.model.CommonAuditData;
25 import org.openecomp.sdc.be.resources.data.auditing.model.DistributionTopicData;
26 import org.openecomp.sdc.common.util.ThreadLocalsHolder;
28 public class AuditDistributionEngineEventFactoryManager {
30 public static AuditEventFactory createDistributionEngineEventFactory(AuditingActionEnum action, String environmentName,
31 DistributionTopicData distributionTopicData, String role, String apiKey,
33 AuditEventFactory factory;
35 case CREATE_DISTRIBUTION_TOPIC:
36 factory = new AuditCreateTopicDistributionEngineEventFactory(
37 CommonAuditData.newBuilder().status(status).requestId(ThreadLocalsHolder.getUuid()).build(), distributionTopicData, apiKey,
38 environmentName, role);
40 case ADD_KEY_TO_TOPIC_ACL:
41 case REMOVE_KEY_FROM_TOPIC_ACL:
42 factory = new AuditAddRemoveKeyDistributionEngineEventFactory(action,
43 CommonAuditData.newBuilder().status(status).requestId(ThreadLocalsHolder.getUuid()).build(), distributionTopicData, apiKey,
44 environmentName, role);
47 throw new UnsupportedOperationException();