- setEnvironment(prop);
- // Initializing the values.
- init();
- // Check the Keys for PDP_URLs
- Collection<Object> unsorted = prop.keySet();
- @SuppressWarnings({ "rawtypes", "unchecked" })
- List<String> sorted = new ArrayList(unsorted);
- Collections.sort(sorted);
- for (String propKey : sorted) {
- if (propKey.startsWith("PDP_URL")) {
- String checkVal = prop.getProperty(propKey);
- if (checkVal == null) {
- throw new PolicyEngineException(XACMLErrorConstants.ERROR_DATA_ISSUE
- + "Properties file doesn't have the PDP_URL parameter");
- }
- if (checkVal.contains(";")) {
- pdpDefault = new ArrayList<>(Arrays.asList(checkVal.split("\\s*;\\s*")));
- int pdpCount = 0;
- while (pdpCount < pdpDefault.size()) {
- String pdpVal = pdpDefault.get(pdpCount);
- readPDPParam(pdpVal);
- pdpCount++;
- }
- } else {
- readPDPParam(checkVal);
+ }
+ if (clientID == null || clientKey == null || clientID.isEmpty() || clientKey.isEmpty()) {
+ LOGGER.error(XACMLErrorConstants.ERROR_PERMISSIONS
+ + " Cannot proceed without the CLIENT_KEY and CLIENT_ID values !!");
+ throw new PolicyEngineException(XACMLErrorConstants.ERROR_PERMISSIONS
+ + " Cannot proceed without the CLIENT_KEY and CLIENT_ID values !!");
+ } else {
+ setClientId(clientID.trim());
+ setClientKey(clientKey.trim());
+ }
+ setEnvironment(prop);
+ // Initializing the values.
+ init();
+ // Check the Keys for PDP_URLs
+ Collection<Object> unsorted = prop.keySet();
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ List<String> sorted = new ArrayList(unsorted);
+ Collections.sort(sorted);
+ for (String propKey : sorted) {
+ if (propKey.startsWith("PDP_URL")) {
+ String checkVal = prop.getProperty(propKey);
+ if (checkVal == null) {
+ throw new PolicyEngineException(XACMLErrorConstants.ERROR_DATA_ISSUE
+ + "Properties file doesn't have the PDP_URL parameter");
+ }
+ if (checkVal.contains(";")) {
+ List<String> pdpDefault = new ArrayList<>(Arrays.asList(checkVal.split("\\s*;\\s*")));
+ int pdpCount = 0;
+ while (pdpCount < pdpDefault.size()) {
+ String pdpVal = pdpDefault.get(pdpCount);
+ readPDPParam(pdpVal);
+ pdpCount++;