2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Copyright (C) 2017 Amdocs
8 * =============================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=========================================================
23 package org.onap.appc.sdc.artifacts.impl;
25 import com.att.eelf.configuration.EELFLogger;
26 import com.att.eelf.configuration.EELFManager;
27 import org.onap.appc.srvcomm.messaging.event.EventSender;
28 import org.onap.appc.sdc.artifacts.ArtifactProcessor;
29 import org.onap.appc.sdc.artifacts.object.ArtifactType;
30 import org.onap.sdc.api.IDistributionClient;
31 import org.onap.sdc.api.notification.IArtifactInfo;
32 import org.onap.sdc.api.notification.INotificationData;
33 import org.onap.sdc.api.notification.IResourceInstance;
38 * Factory class for creating instance of Artifact Processor
40 public class ArtifactProcessorFactory {
42 private static final EELFLogger logger = EELFManager.getInstance().getLogger(ArtifactProcessorFactory.class);
44 public ArtifactProcessorFactory (){
49 * Provides and instance of Artifact Processor
50 * @param client an instance of IDistributionClient
51 * @param eventSender an instance of EventSender
52 * @param notification an instance of INotificationData
53 * @param resource an instance of IResourceInstance
54 * @param artifact an instance of IArtifactInfo
58 public ArtifactProcessor getArtifactProcessor(IDistributionClient client, EventSender eventSender,
59 INotificationData notification, IResourceInstance resource,
60 IArtifactInfo artifact, URI storeUri) {
62 logger.debug("Creating artifact processor for artifact type = " + artifact.getArtifactType());
63 ArtifactType artifactType = ArtifactType.getArtifactType(artifact.getArtifactType());
64 if(artifactType == null){
67 ArtifactProcessor artifactProcessor = null;
68 switch (artifactType){
70 artifactProcessor = new ConfigArtifactProcessor(client, eventSender, notification, resource,
74 artifactProcessor = new LicenseArtifactProcessor(client,eventSender,notification,resource,
80 return artifactProcessor;