From 8b8b54c7ace5d58e4d12b47a7b6fad67c56507a1 Mon Sep 17 00:00:00 2001 From: Gary Wu Date: Fri, 21 Apr 2017 10:22:36 -0700 Subject: Remove CommandRequest and subclasses From the last refactoring, CommandRequest ended up containing only a single CommandExecutorInput value. This change removes CommandRequest and subclasses and replaces their use with CommandExecutorInput directly The type parameter on CommandTask is also removed accordingly. Change-Id: I867df65f344fa58698a44c4b20815dbce382ad55 Signed-off-by: Gary Wu --- .../appc/executor/impl/CommandExecutorImpl.java | 43 ++++----------------- .../openecomp/appc/executor/impl/CommandTask.java | 22 +++++------ .../appc/executor/impl/CommandTaskFactory.java | 3 +- .../appc/executor/impl/ExpiredMessageHandler.java | 6 +-- .../appc/executor/impl/LCMCommandTask.java | 37 +++++++++--------- .../appc/executor/impl/LCMReadonlyCommandTask.java | 18 ++++----- .../appc/executor/impl/objects/CommandRequest.java | 44 ---------------------- .../executor/impl/objects/LCMCommandRequest.java | 32 ---------------- .../impl/objects/LCMReadOnlyCommandRequest.java | 33 ---------------- .../appc/executor/TestCommandExecutionTask.java | 28 +++++--------- 10 files changed, 58 insertions(+), 208 deletions(-) delete mode 100644 appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/objects/CommandRequest.java delete mode 100644 appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/objects/LCMCommandRequest.java delete mode 100644 appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/objects/LCMReadOnlyCommandRequest.java (limited to 'appc-dispatcher/appc-command-executor/appc-command-executor-core/src') diff --git a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandExecutorImpl.java b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandExecutorImpl.java index e351cfe12..7832b517a 100644 --- a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandExecutorImpl.java +++ b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandExecutorImpl.java @@ -33,9 +33,6 @@ import org.openecomp.appc.exceptions.APPCException; import org.openecomp.appc.executionqueue.ExecutionQueueService; import org.openecomp.appc.executionqueue.impl.ExecutionQueueServiceFactory; import org.openecomp.appc.executor.CommandExecutor; -import org.openecomp.appc.executor.impl.objects.CommandRequest; -import org.openecomp.appc.executor.impl.objects.LCMCommandRequest; -import org.openecomp.appc.executor.impl.objects.LCMReadOnlyCommandRequest; import org.openecomp.appc.executor.objects.CommandExecutorInput; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; @@ -82,43 +79,19 @@ public class CommandExecutorImpl implements CommandExecutor { if (logger.isTraceEnabled()) { logger.trace("Entering to executeCommand with CommandExecutorInput = "+ ObjectUtils.toString(commandExecutorInput)); } - CommandRequest request = getCommandRequest(commandExecutorInput); - enqueRequest(request); + enqueRequest(commandExecutorInput); if (logger.isTraceEnabled()) { logger.trace("Exiting from executeCommand"); } } - private CommandRequest getCommandRequest(CommandExecutorInput commandExecutorInput){ - if (logger.isTraceEnabled()) { - logger.trace("Entering to getCommandRequest with CommandExecutorInput = "+ ObjectUtils.toString(commandExecutorInput)); - } - CommandRequest commandRequest; - - switch(commandExecutorInput.getRuntimeContext().getRequestContext().getAction()){ - case Sync: - commandRequest = new LCMReadOnlyCommandRequest(commandExecutorInput); - break; - case Audit: - commandRequest = new LCMReadOnlyCommandRequest(commandExecutorInput); - break; - default: - commandRequest = new LCMCommandRequest(commandExecutorInput); - break; - } - if (logger.isTraceEnabled()) { - logger.trace("Exiting from getCommandRequest with (CommandRequest = "+ ObjectUtils.toString(commandRequest)+")"); - } - return commandRequest; - } - @SuppressWarnings("unchecked") - private void enqueRequest(CommandRequest request) throws APPCException{ + private void enqueRequest(CommandExecutorInput request) throws APPCException{ if (logger.isTraceEnabled()) { logger.trace("Entering to enqueRequest with CommandRequest = "+ ObjectUtils.toString(request)); } try { - CommandTask commandTask = getMessageExecutor(request.getCommandExecutorInput().getRuntimeContext().getRequestContext().getAction().name()); + CommandTask commandTask = getMessageExecutor(request.getRuntimeContext().getRequestContext().getAction().name()); commandTask.setCommandRequest(request); long remainingTTL = getRemainingTTL(request); executionQueueService.putMessage(commandTask,remainingTTL, TimeUnit.MILLISECONDS); @@ -132,17 +105,17 @@ public class CommandExecutorImpl implements CommandExecutor { } } - private long getRemainingTTL(CommandRequest request) { - Date requestTimestamp = request.getCommandExecutorInput().getRuntimeContext().getRequestContext().getCommonHeader().getTimeStamp(); - int ttl = request.getCommandExecutorInput().getRuntimeContext().getRequestContext().getCommonHeader().getFlags().getTtl(); + private long getRemainingTTL(CommandExecutorInput request) { + Date requestTimestamp = request.getRuntimeContext().getRequestContext().getCommonHeader().getTimeStamp(); + int ttl = request.getRuntimeContext().getRequestContext().getCommonHeader().getFlags().getTtl(); return ttl*1000 + requestTimestamp.getTime() - System.currentTimeMillis(); } - private CommandTask getMessageExecutor(String action){ + private CommandTask getMessageExecutor(String action){ if (logger.isTraceEnabled()) { logger.trace("Entering to getMessageExecutor with command = "+ action); } - CommandTask executionTask = executionTaskFactory.getExecutionTask(action); + CommandTask executionTask = executionTaskFactory.getExecutionTask(action); if (logger.isTraceEnabled()) { logger.trace("Exiting from getMessageExecutor"); } diff --git a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandTask.java b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandTask.java index 0037434ff..be899268b 100644 --- a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandTask.java +++ b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandTask.java @@ -33,7 +33,7 @@ import java.net.InetAddress; import org.openecomp.appc.domainmodel.lcm.RuntimeContext; import org.openecomp.appc.domainmodel.lcm.Status; -import org.openecomp.appc.executor.impl.objects.CommandRequest; +import org.openecomp.appc.executor.objects.CommandExecutorInput; import org.openecomp.appc.executor.objects.CommandResponse; import org.openecomp.appc.executor.objects.LCMCommandStatus; import org.openecomp.appc.executor.objects.Params; @@ -50,18 +50,18 @@ import org.slf4j.MDC; * This abstract class is base class for all Command tasks. All command task must inherit this class. */ -public abstract class CommandTask implements Runnable { +public abstract class CommandTask implements Runnable { protected RequestHandler requestHandler; protected WorkFlowManager workflowManager; - private CommandRequest commandRequest; + private CommandExecutorInput commandRequest; - public CommandRequest getCommandRequest() { + public CommandExecutorInput getCommandRequest() { return commandRequest; } - public void setCommandRequest(CommandRequest commandRequest) { + public void setCommandRequest(CommandExecutorInput commandRequest) { this.commandRequest = commandRequest; } @@ -78,23 +78,23 @@ public abstract class CommandTask implements Runnable { CommandTask(){ } - public void onRequestCompletion(CommandRequest request, CommandResponse response , boolean isAAIUpdated) { + public void onRequestCompletion(CommandExecutorInput request, CommandResponse response , boolean isAAIUpdated) { logger.debug("Entry: onRequestCompletion()"); - requestHandler.onRequestExecutionEnd(request.getCommandExecutorInput().getRuntimeContext(), isAAIUpdated); + requestHandler.onRequestExecutionEnd(request.getRuntimeContext(), isAAIUpdated); } - public abstract void onRequestCompletion(CommandRequest request, CommandResponse response); + public abstract void onRequestCompletion(CommandExecutorInput request, CommandResponse response); - protected CommandResponse buildCommandResponse(CommandRequest request, WorkflowResponse response) { + protected CommandResponse buildCommandResponse(CommandExecutorInput request, WorkflowResponse response) { CommandResponse commandResponse = new CommandResponse(); - commandResponse.setRuntimeContext(request.getCommandExecutorInput().getRuntimeContext()); + commandResponse.setRuntimeContext(request.getRuntimeContext()); return commandResponse; } public void execute() { - final RuntimeContext runtimeContext = commandRequest.getCommandExecutorInput().getRuntimeContext(); + final RuntimeContext runtimeContext = commandRequest.getRuntimeContext(); MDC.put(MDC_KEY_REQUEST_ID, runtimeContext.getRequestContext().getCommonHeader().getRequestId()); if (runtimeContext.getRequestContext().getActionIdentifiers().getServiceInstanceId() != null) MDC.put(MDC_SERVICE_INSTANCE_ID, runtimeContext.getRequestContext().getActionIdentifiers().getServiceInstanceId()); diff --git a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandTaskFactory.java b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandTaskFactory.java index d01722062..610f0bca3 100644 --- a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandTaskFactory.java +++ b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/CommandTaskFactory.java @@ -23,7 +23,6 @@ package org.openecomp.appc.executor.impl; 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; @@ -54,7 +53,7 @@ public class CommandTaskFactory { } - public synchronized CommandTask getExecutionTask(String action){ + public synchronized CommandTask getExecutionTask(String action){ if (VNFOperation.Sync.toString().equals(action) || VNFOperation.Audit.toString().equals(action)){ return new LCMReadonlyCommandTask(requestHandler,workflowManager); }else { diff --git a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/ExpiredMessageHandler.java b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/ExpiredMessageHandler.java index fc79c461f..500f75735 100644 --- a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/ExpiredMessageHandler.java +++ b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/ExpiredMessageHandler.java @@ -22,7 +22,7 @@ package org.openecomp.appc.executor.impl; import org.openecomp.appc.executionqueue.MessageExpirationListener; -import org.openecomp.appc.executor.impl.objects.CommandRequest; +import org.openecomp.appc.executor.objects.CommandExecutorInput; import org.openecomp.appc.requesthandler.RequestHandler; @@ -39,7 +39,7 @@ public class ExpiredMessageHandler implements MessageExpirationListener{ @Override public void onMessageExpiration(M message) { - CommandRequest commandRequest = (CommandRequest)message; - requestHandler.onRequestTTLEnd(commandRequest.getCommandExecutorInput().getRuntimeContext(), true); + CommandExecutorInput commandRequest = (CommandExecutorInput)message; + requestHandler.onRequestTTLEnd(commandRequest.getRuntimeContext(), true); } } diff --git a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/LCMCommandTask.java b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/LCMCommandTask.java index 9f7c13513..935260a10 100644 --- a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/LCMCommandTask.java +++ b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/LCMCommandTask.java @@ -27,8 +27,7 @@ import org.openecomp.appc.domainmodel.lcm.CommonHeader; import org.openecomp.appc.domainmodel.lcm.Status; import org.openecomp.appc.domainmodel.lcm.VNFOperation; import org.openecomp.appc.executor.UnstableVNFException; -import org.openecomp.appc.executor.impl.objects.CommandRequest; -import org.openecomp.appc.executor.impl.objects.LCMCommandRequest; +import org.openecomp.appc.executor.objects.CommandExecutorInput; import org.openecomp.appc.executor.objects.CommandResponse; import org.openecomp.appc.executor.objects.LCMCommandStatus; import org.openecomp.appc.executor.objects.Params; @@ -54,7 +53,7 @@ import java.util.HashMap; import java.util.Map; -public class LCMCommandTask extends CommandTask { +public class LCMCommandTask extends CommandTask { private AAIService aaiService; private LifecycleManager lifecyclemanager; @@ -91,12 +90,12 @@ public class LCMCommandTask extends CommandTask { @Override - public void onRequestCompletion(CommandRequest request, CommandResponse response) { + public void onRequestCompletion(CommandExecutorInput request, CommandResponse response) { boolean isAAIUpdated = false; try { - final int statusCode = request.getCommandExecutorInput().getRuntimeContext().getResponseContext().getStatus().getCode(); + final int statusCode = request.getRuntimeContext().getResponseContext().getStatus().getCode(); if (logger.isDebugEnabled()) { logger.debug("Workflow Execution Status = "+ statusCode); @@ -104,13 +103,13 @@ public class LCMCommandTask extends CommandTask { boolean isSuccess = statusCode == 100 || statusCode == 400; - if (isSuccess && VNFOperation.Terminate == request.getCommandExecutorInput().getRuntimeContext().getRequestContext().getAction()) { + if (isSuccess && VNFOperation.Terminate == request.getRuntimeContext().getRequestContext().getAction()) { SvcLogicContext ctx = new SvcLogicContext(); - ctx = getVnfdata(request.getCommandExecutorInput().getRuntimeContext().getVnfContext().getId(), "vnf", ctx); - isAAIUpdated = aaiService.deleteGenericVnfData(request.getCommandExecutorInput().getRuntimeContext().getVnfContext().getId(), ctx.getAttribute("vnf.resource-version")); + ctx = getVnfdata(request.getRuntimeContext().getVnfContext().getId(), "vnf", ctx); + isAAIUpdated = aaiService.deleteGenericVnfData(request.getRuntimeContext().getVnfContext().getId(), ctx.getAttribute("vnf.resource-version")); } else{ - isAAIUpdated = updateAAI(request.getCommandExecutorInput().getRuntimeContext().getVnfContext().getId() , false, isSuccess); + isAAIUpdated = updateAAI(request.getRuntimeContext().getVnfContext().getId() , false, isSuccess); } logger.debug("isAAIUpdated = " + isAAIUpdated); } @@ -125,20 +124,20 @@ public class LCMCommandTask extends CommandTask { @Override public void run() { - LCMCommandRequest request = (LCMCommandRequest)getCommandRequest(); + CommandExecutorInput request = getCommandRequest(); boolean isAAIUpdated; - final String vnfId = request.getCommandExecutorInput().getRuntimeContext().getVnfContext().getId(); - final String vnfType = request.getCommandExecutorInput().getRuntimeContext().getVnfContext().getType(); + final String vnfId = request.getRuntimeContext().getVnfContext().getId(); + final String vnfType = request.getRuntimeContext().getVnfContext().getType(); try { - final CommonHeader commonHeader = request.getCommandExecutorInput().getRuntimeContext().getRequestContext().getCommonHeader(); + final CommonHeader commonHeader = request.getRuntimeContext().getRequestContext().getCommonHeader(); final boolean forceFlag = commonHeader.getFlags().isForce(); UniqueRequestIdentifier requestIdentifier = new UniqueRequestIdentifier(commonHeader.getOriginatorId(), commonHeader.getRequestId(), commonHeader.getSubRequestId()); String requestIdentifierString = requestIdentifier.toIdentifierString(); requestHandler.onRequestExecutionStart(vnfId,false, requestIdentifierString, forceFlag); - final String currentStatus = request.getCommandExecutorInput().getRuntimeContext().getVnfContext().getStatus(); - final VNFOperation action = request.getCommandExecutorInput().getRuntimeContext().getRequestContext().getAction(); + final String currentStatus = request.getRuntimeContext().getVnfContext().getStatus(); + final VNFOperation action = request.getRuntimeContext().getRequestContext().getAction(); final String nextState = lifecyclemanager.getNextState(vnfType, currentStatus, action.name()); @@ -148,18 +147,18 @@ public class LCMCommandTask extends CommandTask { } catch (NoTransitionDefinedException e) { logger.error("Error getting Next State for AAI Update: " + e.getMessage(), e); Params params = new Params().addParam("actionName",e.event).addParam("currentState",e.currentState); - request.getCommandExecutorInput().getRuntimeContext().getResponseContext().setStatus(LCMCommandStatus.NO_TRANSITION_DEFINE_FAILURE.toStatus(params)); + request.getRuntimeContext().getResponseContext().setStatus(LCMCommandStatus.NO_TRANSITION_DEFINE_FAILURE.toStatus(params)); isAAIUpdated = false; } catch (UnstableVNFException e) { logger.error(e.getMessage(), e); Params params = new Params().addParam("vnfId",vnfId); - request.getCommandExecutorInput().getRuntimeContext().getResponseContext().setStatus(LCMCommandStatus.UNSTABLE_VNF_FAILURE.toStatus(params)); + request.getRuntimeContext().getResponseContext().setStatus(LCMCommandStatus.UNSTABLE_VNF_FAILURE.toStatus(params)); isAAIUpdated = false; }catch (Exception e) { logger.error("Error before Request Execution starts.", e); String errorMsg = StringUtils.isEmpty(e.getMessage()) ? e.toString() : e.getMessage(); Params params = new Params().addParam("errorMsg",errorMsg); - request.getCommandExecutorInput().getRuntimeContext().getResponseContext().setStatus(LCMCommandStatus.UNEXPECTED_FAILURE.toStatus(params)); + request.getRuntimeContext().getResponseContext().setStatus(LCMCommandStatus.UNEXPECTED_FAILURE.toStatus(params)); isAAIUpdated = false; } @@ -169,7 +168,7 @@ public class LCMCommandTask extends CommandTask { String errorMsg = "Error updating A& AI before Workflow execution"; logger.error(errorMsg); WorkflowResponse response = new WorkflowResponse(); - response.setResponseContext(request.getCommandExecutorInput().getRuntimeContext().getResponseContext()); + response.setResponseContext(request.getRuntimeContext().getResponseContext()); CommandResponse commandResponse = super.buildCommandResponse(request, response); this.onRequestCompletion(request,commandResponse); } diff --git a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/LCMReadonlyCommandTask.java b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/LCMReadonlyCommandTask.java index 201662a6c..755f70c31 100644 --- a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/LCMReadonlyCommandTask.java +++ b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/openecomp/appc/executor/impl/LCMReadonlyCommandTask.java @@ -26,9 +26,7 @@ import org.apache.commons.lang3.StringUtils; import org.openecomp.appc.domainmodel.lcm.CommonHeader; import org.openecomp.appc.domainmodel.lcm.Status; import org.openecomp.appc.executor.UnstableVNFException; -import org.openecomp.appc.executor.impl.objects.CommandRequest; -import org.openecomp.appc.executor.impl.objects.LCMCommandRequest; -import org.openecomp.appc.executor.impl.objects.LCMReadOnlyCommandRequest; +import org.openecomp.appc.executor.objects.CommandExecutorInput; import org.openecomp.appc.executor.objects.CommandResponse; import org.openecomp.appc.executor.objects.LCMCommandStatus; import org.openecomp.appc.executor.objects.Params; @@ -38,7 +36,7 @@ import org.openecomp.appc.workflow.WorkFlowManager; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; -public class LCMReadonlyCommandTask extends CommandTask { +public class LCMReadonlyCommandTask extends CommandTask { private static final EELFLogger logger = EELFManager.getInstance().getLogger(LCMReadonlyCommandTask.class); @@ -50,30 +48,30 @@ public class LCMReadonlyCommandTask extends CommandTask task = factory.getExecutionTask("Configure"); + CommandTask task = factory.getExecutionTask("Configure"); assertEquals(LCMCommandTask.class,task.getClass() ); task = factory.getExecutionTask("Sync"); assertEquals(LCMReadonlyCommandTask.class,task.getClass() ); @@ -144,28 +141,28 @@ public class TestCommandExecutionTask { @Test public void testOnRequestCompletion(){ Mockito.doNothing().when(requestHandler).onRequestTTLEnd((RuntimeContext) anyObject(),anyBoolean()); - LCMCommandRequest request = getLCMCommandRequest("FIREWALL",30,new Date(), "11" ,setTTLInFlags("30"), VNFOperation.Configure, "1", "1.0"); + CommandExecutorInput request = getLCMCommandRequest("FIREWALL",30,new Date(), "11" ,setTTLInFlags("30"), VNFOperation.Configure, "1", "1.0"); CommandResponse response = getCommandResponse(VNFOperation.Configure, true, "11", "","1"); executionTask.onRequestCompletion(request, response); } @Test public void testRunGetConfig(){ - LCMReadOnlyCommandRequest request = getConfigCommandRequest("FIREWALL",30,new Date(), "11" ,setTTLInFlags("30"),VNFOperation.Sync, "1", "1.0"); + CommandExecutorInput request = getConfigCommandRequest("FIREWALL",30,new Date(), "11" ,setTTLInFlags("30"),VNFOperation.Sync, "1", "1.0"); LCMReadonlyCommandTask.setCommandRequest(request); LCMReadonlyCommandTask.run(); } @Test public void testRun(){ - LCMCommandRequest request = getLCMCommandRequest("FIREWALL",30,new Date(), "11" ,setTTLInFlags("30"),VNFOperation.Sync, "1", "1.0"); + CommandExecutorInput request = getLCMCommandRequest("FIREWALL",30,new Date(), "11" ,setTTLInFlags("30"),VNFOperation.Sync, "1", "1.0"); executionTask.setCommandRequest(request); executionTask.run(); } @Test public void testRunNegative(){ - LCMCommandRequest request = getLCMCommandRequest("FIREWALL",30,new Date(), "11" ,setTTLInFlags("30"),VNFOperation.Sync, "1", "1.0"); + CommandExecutorInput request = getLCMCommandRequest("FIREWALL",30,new Date(), "11" ,setTTLInFlags("30"),VNFOperation.Sync, "1", "1.0"); executionTask.setCommandRequest(request); executionTask.run(); } @@ -208,7 +205,6 @@ public class TestCommandExecutionTask { String requestId = "1"; CommandExecutorInput commandExecutorInput = pouplateCommandExecutorInput("FIREWALL",30, "1.0", timeStamp, API_VERSION, requestId, ORIGINATOR_ID, "", VNFOperation.Configure, "33", ""); - CommandRequest request = new CommandRequest(commandExecutorInput); } @@ -221,22 +217,16 @@ public class TestCommandExecutionTask { } - private LCMReadOnlyCommandRequest getConfigCommandRequest(String vnfType , Integer ttl , Date timeStamp, String requestId, + private CommandExecutorInput getConfigCommandRequest(String vnfType , Integer ttl , Date timeStamp, String requestId, Map flags, VNFOperation command , String vnfId, String vnfVersion ){ - CommandExecutorInput commandExecutorInput = pouplateCommandExecutorInput(vnfType, ttl, vnfVersion, timeStamp, API_VERSION, requestId, ORIGINATOR_ID, "", command, vnfId, ""); - LCMReadOnlyCommandRequest request = new LCMReadOnlyCommandRequest(commandExecutorInput); - - return request; + return pouplateCommandExecutorInput(vnfType, ttl, vnfVersion, timeStamp, API_VERSION, requestId, ORIGINATOR_ID, "", command, vnfId, ""); } - private LCMCommandRequest getLCMCommandRequest(String vnfType , Integer ttl ,Date timeStamp, String requestId, + private CommandExecutorInput getLCMCommandRequest(String vnfType , Integer ttl ,Date timeStamp, String requestId, Map flags, VNFOperation command , String vnfId, String vnfVersion ){ - CommandExecutorInput commandExecutorInput = pouplateCommandExecutorInput(vnfType, ttl, vnfVersion, timeStamp, API_VERSION, requestId, ORIGINATOR_ID, "", command, vnfId, ""); - LCMCommandRequest request = new LCMCommandRequest(commandExecutorInput); - - return request; + return pouplateCommandExecutorInput(vnfType, ttl, vnfVersion, timeStamp, API_VERSION, requestId, ORIGINATOR_ID, "", command, vnfId, ""); } public WorkflowResponse getWorkflowResponse (){ -- cgit 1.2.3-korg