aboutsummaryrefslogtreecommitdiffstats
path: root/ECOMP-PDP/src
diff options
context:
space:
mode:
Diffstat (limited to 'ECOMP-PDP/src')
-rw-r--r--ECOMP-PDP/src/main/java/org/openecomp/policy/xacml/action/FindAction.java25
-rw-r--r--ECOMP-PDP/src/main/java/org/openecomp/policy/xacml/custom/EcompFunctionDefinitionFactory.java5
-rw-r--r--ECOMP-PDP/src/main/java/org/openecomp/policy/xacml/pdp/std/functions/FunctionDefinitionCustomRegexpMatch.java10
3 files changed, 18 insertions, 22 deletions
diff --git a/ECOMP-PDP/src/main/java/org/openecomp/policy/xacml/action/FindAction.java b/ECOMP-PDP/src/main/java/org/openecomp/policy/xacml/action/FindAction.java
index 2bcb903e8..5419b8946 100644
--- a/ECOMP-PDP/src/main/java/org/openecomp/policy/xacml/action/FindAction.java
+++ b/ECOMP-PDP/src/main/java/org/openecomp/policy/xacml/action/FindAction.java
@@ -20,7 +20,6 @@
package org.openecomp.policy.xacml.action;
import java.io.BufferedReader;
-import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
@@ -35,7 +34,6 @@ import javax.json.Json;
import javax.json.JsonReader;
import org.apache.http.HttpResponse;
-import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
@@ -272,11 +270,8 @@ public class FindAction {
output = output + out;
}
response = output;
- } catch (ClientProtocolException e) {
- LOGGER.error(e.getMessage());
- response = e.getMessage();
- } catch (IOException e) {
- LOGGER.error(e.getMessage());
+ } catch (Exception e) {
+ LOGGER.error(e.getMessage()+e);
response = e.getMessage();
} finally {
httpClient.getConnectionManager().shutdown();
@@ -313,11 +308,8 @@ public class FindAction {
output = output + out;
}
response = output;
- } catch (ClientProtocolException e) {
- LOGGER.error(e.getMessage());
- response = e.getMessage();
- } catch (IOException e) {
- LOGGER.error(e.getMessage());
+ }catch (Exception e) {
+ LOGGER.error(e.getMessage() +e);
response = e.getMessage();
} finally {
httpClient.getConnectionManager().shutdown();
@@ -353,13 +345,10 @@ public class FindAction {
output = output + out;
}
response = output;
- } catch (ClientProtocolException e) {
- LOGGER.error(e.getMessage());
+ } catch (Exception e) {
+ LOGGER.error(e.getMessage() +e);
response = e.getMessage();
- } catch (IOException e) {
- LOGGER.error(e.getMessage());
- response = e.getMessage();
- } finally {
+ }finally {
httpClient.getConnectionManager().shutdown();
}
}
diff --git a/ECOMP-PDP/src/main/java/org/openecomp/policy/xacml/custom/EcompFunctionDefinitionFactory.java b/ECOMP-PDP/src/main/java/org/openecomp/policy/xacml/custom/EcompFunctionDefinitionFactory.java
index 202468feb..2cb8e67ae 100644
--- a/ECOMP-PDP/src/main/java/org/openecomp/policy/xacml/custom/EcompFunctionDefinitionFactory.java
+++ b/ECOMP-PDP/src/main/java/org/openecomp/policy/xacml/custom/EcompFunctionDefinitionFactory.java
@@ -24,6 +24,8 @@ import java.lang.reflect.Modifier;
import java.util.HashMap;
import java.util.Map;
+import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
+import org.openecomp.policy.common.logging.flexlogger.Logger;
import org.openecomp.policy.xacml.pdp.std.functions.FunctionDefinitionCustomRegexpMatch;
import com.att.research.xacml.api.Identifier;
@@ -34,6 +36,7 @@ import com.att.research.xacmlatt.pdp.policy.FunctionDefinitionFactory;
import com.att.research.xacmlatt.pdp.std.StdFunctions;
public class EcompFunctionDefinitionFactory extends FunctionDefinitionFactory {
+ private static Logger logger = FlexLogger.getLogger(EcompFunctionDefinitionFactory.class);
private static Map<Identifier,FunctionDefinition> mapFunctionDefinitions = new HashMap<>();
private static boolean needMapInit = true;
@@ -60,7 +63,7 @@ public class EcompFunctionDefinitionFactory extends FunctionDefinitionFactory {
try {
register((FunctionDefinition)(field.get(null)));
} catch (IllegalAccessException ex) {
-
+ logger.error(ex.getMessage() +ex);
}
}
}
diff --git a/ECOMP-PDP/src/main/java/org/openecomp/policy/xacml/pdp/std/functions/FunctionDefinitionCustomRegexpMatch.java b/ECOMP-PDP/src/main/java/org/openecomp/policy/xacml/pdp/std/functions/FunctionDefinitionCustomRegexpMatch.java
index 5b84ab0f6..5c11f8c43 100644
--- a/ECOMP-PDP/src/main/java/org/openecomp/policy/xacml/pdp/std/functions/FunctionDefinitionCustomRegexpMatch.java
+++ b/ECOMP-PDP/src/main/java/org/openecomp/policy/xacml/pdp/std/functions/FunctionDefinitionCustomRegexpMatch.java
@@ -22,6 +22,9 @@ package org.openecomp.policy.xacml.pdp.std.functions;
import java.util.List;
+import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
+import org.openecomp.policy.common.logging.flexlogger.Logger;
+
import com.att.research.xacml.api.DataType;
import com.att.research.xacml.api.DataTypeException;
import com.att.research.xacml.api.Identifier;
@@ -46,7 +49,7 @@ import com.att.research.xacmlatt.pdp.std.functions.FunctionDefinitionBase;
* @param <I> the java class for the data type of the function Input arguments
*/
public class FunctionDefinitionCustomRegexpMatch<I> extends FunctionDefinitionBase<Boolean, I> {
-
+ private static Logger logger = FlexLogger.getLogger(FunctionDefinitionCustomRegexpMatch.class);
/**
* Constructor - need dataTypeArgs input because of java Generic type-erasure during compilation.
@@ -70,7 +73,7 @@ public class FunctionDefinitionCustomRegexpMatch<I> extends FunctionDefinitionBa
// get the regular expression
FunctionArgument regexpArgument = arguments.get(0);
- ConvertedArgument<String> convertedArgument = new ConvertedArgument<String>(regexpArgument, DataTypes.DT_STRING, false);
+ ConvertedArgument<String> convertedArgument = new ConvertedArgument<>(regexpArgument, DataTypes.DT_STRING, false);
if ( ! convertedArgument.isOk()) {
return ExpressionResult.newError(getFunctionStatus(convertedArgument.getStatus()));
}
@@ -82,7 +85,7 @@ public class FunctionDefinitionCustomRegexpMatch<I> extends FunctionDefinitionBa
// now get the element to match
FunctionArgument elementArgument = arguments.get(1);
- ConvertedArgument<I> convertedElement = new ConvertedArgument<I>(elementArgument, this.getDataTypeArgs(), false);
+ ConvertedArgument<I> convertedElement = new ConvertedArgument<>(elementArgument, this.getDataTypeArgs(), false);
if ( ! convertedElement.isOk()) {
return ExpressionResult.newError(getFunctionStatus(convertedElement.getStatus()));
}
@@ -93,6 +96,7 @@ public class FunctionDefinitionCustomRegexpMatch<I> extends FunctionDefinitionBa
try {
elementValueString = this.getDataTypeArgs().toStringValue(elementValueObject);
} catch (DataTypeException e) {
+ logger.error(e.getMessage() +e);
String message = e.getMessage();
if (e.getCause() != null) {
message = e.getCause().getMessage();