* ============LICENSE_START=======================================================
* ONAP : APPC
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Copyright (C) 2017 Amdocs
+ * ================================================================================
+ * Modifications Copyright (C) 2019 Ericsson
+ * Modifications Copyright (C) 2019 IBM
* =============================================================================
* 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.
*
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
* ============LICENSE_END=========================================================
*/
String action = input.getRequest().getAction();
ResponseInfoBuilder responseInfoBuilder = new ResponseInfoBuilder();
ExecuteServiceOutputBuilder executeServicebuilder = new ExecuteServiceOutputBuilder();
- ServiceExecutor serviceExecutor = new ServiceExecutor();
+ ServiceExecutor serviceExecutor = getServiceExecutor();
StatusBuilder statusBuilder = new StatusBuilder();
try{
String response = serviceExecutor.execute(action, input.getRequest().getRequestData(), input.getRequest().getRequestDataType());
}
catch(Exception e){
log.error("Error" + e.getMessage());
- e.printStackTrace();
statusBuilder.setCode("401");
- statusBuilder.setMessage("failuer");
+ statusBuilder.setMessage("failure");
}
executeServicebuilder.setResponseInfo(responseInfoBuilder.build());
executeServicebuilder.setStatus(statusBuilder.build());
RpcResult<ExecuteServiceOutput> result = RpcResultBuilder.<ExecuteServiceOutput>status(true).withResult(executeServicebuilder.build()).build();
return Futures.immediateFuture(result);
}
+
+ protected ServiceExecutor getServiceExecutor() {
+ return new ServiceExecutor();
+ }
}