aboutsummaryrefslogtreecommitdiffstats
path: root/ms/neng
diff options
context:
space:
mode:
Diffstat (limited to 'ms/neng')
-rw-r--r--ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/policy/PropertyOperator.java5
-rw-r--r--ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/resource/model/NameGenRequest.java5
-rw-r--r--ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/resource/model/NameGenResponse.java2
-rw-r--r--ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/service/SpringServiceImpl.java5
-rw-r--r--ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/PolicyFinderServiceImpl.java6
5 files changed, 14 insertions, 9 deletions
diff --git a/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/policy/PropertyOperator.java b/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/policy/PropertyOperator.java
index 2a73a27e..7ae27d2d 100644
--- a/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/policy/PropertyOperator.java
+++ b/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/policy/PropertyOperator.java
@@ -3,6 +3,7 @@
* ONAP : CCSDK.apps
* ================================================================================
* Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2018 IBM.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,11 +25,13 @@ import static org.onap.ccsdk.apps.ms.neng.core.policy.PolicyReader.propertyOpera
import java.lang.reflect.Method;
import java.util.Map;
+import java.util.logging.Logger;
/**
* Applies property operations while processing a policy.
*/
public class PropertyOperator {
+ private static Logger logger = Logger.getLogger(PropertyOperator.class.getName());
/**
* Apply a property found in the policy.
*
@@ -117,7 +120,7 @@ public class PropertyOperator {
}
}
} catch (Exception e) {
- e.printStackTrace();
+ logger.warning(e.getMessage());
throw e;
}
return postOp;
diff --git a/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/resource/model/NameGenRequest.java b/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/resource/model/NameGenRequest.java
index 9fa91410..e1006bee 100644
--- a/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/resource/model/NameGenRequest.java
+++ b/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/resource/model/NameGenRequest.java
@@ -3,6 +3,7 @@
* ONAP : CCSDK.apps
* ================================================================================
* Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2018 IBM.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,8 +31,8 @@ import java.util.Map;
public class NameGenRequest implements Serializable {
private static final long serialVersionUID = -8039686696076337053L;
- List<Map<String, String>> elements;
- Boolean useDb;
+ private List<Map<String, String>> elements;
+ private Boolean useDb;
public List<Map<String, String>> getElements() {
return elements;
diff --git a/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/resource/model/NameGenResponse.java b/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/resource/model/NameGenResponse.java
index 35da40c2..8ba91320 100644
--- a/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/resource/model/NameGenResponse.java
+++ b/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/resource/model/NameGenResponse.java
@@ -31,7 +31,7 @@ import java.util.Map;
*/
public class NameGenResponse implements Serializable {
private static final long serialVersionUID = -8039686696076337053L;
- private static List<Map<String, String>> elements;
+ private List<Map<String, String>> elements;
public List<Map<String, String>> getElements() {
return elements;
diff --git a/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/service/SpringServiceImpl.java b/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/service/SpringServiceImpl.java
index c5cabe51..347a2393 100644
--- a/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/service/SpringServiceImpl.java
+++ b/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/service/SpringServiceImpl.java
@@ -135,7 +135,7 @@ public class SpringServiceImpl implements SpringService {
if (e instanceof NengException) {
throw e;
} else {
- e.printStackTrace();
+ log.warning(e.getMessage());
throw new Exception("Internal error occurred while processing the request");
}
}
@@ -149,6 +149,7 @@ public class SpringServiceImpl implements SpringService {
try {
return policyDetailsRepository.findPolicyResponseByName(policyName);
} catch (Exception e) {
+ log.warning(e.getMessage());
return new PolicyDetails();
}
}
@@ -190,7 +191,7 @@ public class SpringServiceImpl implements SpringService {
if (e instanceof NengException) {
throw e;
} else {
- e.printStackTrace();
+ log.warning(e.getMessage());
throw new Exception("Internal error occurred while processing the request");
}
}
diff --git a/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/PolicyFinderServiceImpl.java b/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/PolicyFinderServiceImpl.java
index b30ac0e6..ce7e3fd5 100644
--- a/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/PolicyFinderServiceImpl.java
+++ b/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/PolicyFinderServiceImpl.java
@@ -85,8 +85,7 @@ public class PolicyFinderServiceImpl implements PolicyFinder {
GetConfigResponse getConfig(String policyName) throws Exception {
GetConfigRequest getConfigRequest = new GetConfigRequest();
getConfigRequest.setPolicyName(policyName);
- GetConfigResponse getConfigResponse = makeOutboundCall(getConfigRequest, GetConfigResponse.class);
- return getConfigResponse;
+ return (makeOutboundCall(getConfigRequest, GetConfigResponse.class));
}
<T, R> GetConfigResponse makeOutboundCall(T request, Class<R> response) throws Exception {
@@ -97,7 +96,8 @@ public class PolicyFinderServiceImpl implements PolicyFinder {
ResponseEntity<Object> resp = getRestTemplate().exchange(re, Object.class);
if (HttpStatus.OK.equals(resp.getStatusCode())) {
ObjectMapper objectmapper = new ObjectMapper();
- System.out.println(objectmapper.writeValueAsString(resp.getBody()));
+ log.info(objectmapper.writeValueAsString(resp.getBody()));
+ //System.out.println(objectmapper.writeValueAsString(resp.getBody()));
List<Map<Object, Object>> respObj = objectmapper.readValue(
objectmapper.writeValueAsString(resp.getBody()),
new TypeReference<List<Map<Object, Object>>>() {});