Updating licenses in all files
[appc.git] / appc-dispatcher / appc-command-executor / appc-command-executor-core / src / main / java / org / openecomp / appc / executor / impl / CommandTaskFactory.java
index d017220..c9e8db9 100644 (file)
@@ -1,9 +1,9 @@
 /*-
  * ============LICENSE_START=======================================================
- * openECOMP : APP-C
+ * APPC
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
- *                                             reserved.
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017 Amdocs
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * ============LICENSE_END=========================================================
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
 package org.openecomp.appc.executor.impl;
 
 
+import org.openecomp.appc.domainmodel.lcm.RuntimeContext;
 import org.openecomp.appc.domainmodel.lcm.VNFOperation;
-import org.openecomp.appc.executor.impl.objects.CommandRequest;
 import org.openecomp.appc.lifecyclemanager.LifecycleManager;
 import org.openecomp.appc.requesthandler.RequestHandler;
 import org.openecomp.appc.workflow.WorkFlowManager;
@@ -32,10 +33,6 @@ import org.openecomp.appc.workflow.WorkFlowManager;
 
 
 public class CommandTaskFactory {
-
-//    private LCMCommandTask lcmCommandTask;
-//    private LCMReadonlyCommandTask LCMReadonlyCommandTask;
-
     private RequestHandler requestHandler;
     private WorkFlowManager workflowManager;
     private LifecycleManager lifecyclemanager;
@@ -54,11 +51,12 @@ public class CommandTaskFactory {
     }
 
 
-    public synchronized CommandTask<? extends CommandRequest> getExecutionTask(String action){
-        if (VNFOperation.Sync.toString().equals(action) || VNFOperation.Audit.toString().equals(action)){
-            return new LCMReadonlyCommandTask(requestHandler,workflowManager);
+    public synchronized CommandTask getExecutionTask(String action, RuntimeContext commandRequest){
+        if (VNFOperation.Sync.toString().equals(action) || VNFOperation.Audit.toString().equals(action) || VNFOperation.ConfigBackup.toString().equals(action) ||
+                VNFOperation.ConfigBackupDelete.toString().equals(action) || VNFOperation.ConfigExport.toString().equals(action)){
+            return new LCMReadonlyCommandTask(commandRequest, requestHandler,workflowManager);
         }else {
-            return new LCMCommandTask(requestHandler,workflowManager,
+            return new LCMCommandTask(commandRequest, requestHandler,workflowManager,
                     lifecyclemanager);
         }
     }