aboutsummaryrefslogtreecommitdiffstats
path: root/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/elk/client/ElkConnector.java
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2019-10-22 07:53:44 -0400
committerPamela Dragosh <pdragosh@research.att.com>2019-10-23 13:33:56 -0400
commit1e61676b77dd09659027b8984f050df7e8538526 (patch)
tree115053dba12b4b27a0f92de0e7648a672a66893a /ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/elk/client/ElkConnector.java
parentf18fbfc026de9cf02126f57844c37abfee607394 (diff)
Consolidate PolicyRestAdapter setup
Put common code into PolicyEngineUtils that the controllers use to populate the PolicyRestController. Also some more sonar cleanup and formatting of XML files. Shortened 120 line characters. Removed some trailing spaces from comments. Fixed up one JUnit. Licenses. Issue-ID: POLICY-2133 Change-Id: Id7d8ac3ab60331535f048ec0f26aeb17a099414e Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/elk/client/ElkConnector.java')
-rw-r--r--ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/elk/client/ElkConnector.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/elk/client/ElkConnector.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/elk/client/ElkConnector.java
index d64b71763..d3f7f4dea 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/elk/client/ElkConnector.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/elk/client/ElkConnector.java
@@ -20,9 +20,10 @@
package org.onap.policy.pap.xacml.rest.elk.client;
-
import io.searchbox.client.JestResult;
+
import java.util.Map;
+
import org.onap.policy.rest.adapter.PolicyRestAdapter;
public interface ElkConnector {
@@ -44,8 +45,7 @@ public interface ElkConnector {
public boolean delete(PolicyRestAdapter policyData) throws IllegalStateException;
- public JestResult search(PolicyIndexType type, String text)
- throws IllegalStateException, IllegalArgumentException;
+ public JestResult search(PolicyIndexType type, String text) throws IllegalStateException, IllegalArgumentException;
public JestResult search(PolicyIndexType type, String text, Map<String, String> searchKeyValue)
throws IllegalStateException, IllegalArgumentException;
@@ -54,8 +54,7 @@ public interface ElkConnector {
public ElkConnector singleton = new ElkConnectorImpl();
- public static PolicyIndexType toPolicyIndexType(String policyName)
- throws IllegalArgumentException {
+ public static PolicyIndexType toPolicyIndexType(String policyName) throws IllegalArgumentException {
if (policyName == null)
throw new IllegalArgumentException("Unsupported NULL policy name conversion");
@@ -76,8 +75,7 @@ public interface ElkConnector {
} else if (policyName.startsWith("Config")) {
return PolicyIndexType.config;
} else {
- throw new IllegalArgumentException(
- "Unsupported policy name conversion to index: " + policyName);
+ throw new IllegalArgumentException("Unsupported policy name conversion to index: " + policyName);
}
}