Replaced prinstacktrace with logger
[appc.git] / appc-inbound / appc-interfaces-service / bundle / src / main / java / org / onap / appc / interfaces / service / InterfacesServiceProviderImpl.java
index 8e114a3..caf0247 100644 (file)
@@ -2,9 +2,12 @@
  * ============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.
@@ -18,7 +21,6 @@
  * 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=========================================================
  */
 
@@ -53,7 +55,7 @@ public class InterfacesServiceProviderImpl implements InterfacesServiceService{
         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());
@@ -64,13 +66,16 @@ public class InterfacesServiceProviderImpl implements InterfacesServiceService{
         }
         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();
+    }
 }