diff options
Diffstat (limited to 'ONAP-PAP-REST/src/main')
18 files changed, 128 insertions, 126 deletions
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/DictionaryNames.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/DictionaryNames.java index 2bb2e95bb..0e1cc521a 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/DictionaryNames.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/DictionaryNames.java @@ -36,7 +36,7 @@ public enum DictionaryNames { VSCLAction, ClosedLoopService, ClosedLoopSite, - PEPOptions, + PepOptions, VarbindDictionary, BRMSParamDictionary, BRMSControllerDictionary, diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/Heartbeat.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/Heartbeat.java index 81e7c6778..920c3dd87 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/Heartbeat.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/Heartbeat.java @@ -23,7 +23,7 @@ package org.onap.policy.pap.xacml.rest; import com.att.research.xacml.api.pap.PAPException; import com.att.research.xacml.api.pap.PDPStatus; import com.att.research.xacml.util.XACMLProperties; - +import com.google.common.annotations.VisibleForTesting; import java.net.ConnectException; import java.net.HttpURLConnection; import java.net.MalformedURLException; @@ -33,7 +33,6 @@ import java.net.UnknownHostException; import java.util.HashMap; import java.util.HashSet; import java.util.Set; - import org.onap.policy.common.logging.eelf.MessageCodes; import org.onap.policy.common.logging.eelf.PolicyLogger; import org.onap.policy.common.logging.flexlogger.FlexLogger; @@ -88,9 +87,9 @@ public class Heartbeat implements Runnable { public Heartbeat(PAPPolicyEngine papEngine2) { papEngine = papEngine2; this.heartbeatInterval = - Integer.parseInt(XACMLProperties.getProperty(XacmlRestProperties.PROP_PAP_HEARTBEAT_INTERVAL, "10000")); + Integer.parseInt(XACMLProperties.getProperty(XacmlRestProperties.PROP_PAP_HEARTBEAT_INTERVAL, "10000")); this.heartbeatTimeout = - Integer.parseInt(XACMLProperties.getProperty(XacmlRestProperties.PROP_PAP_HEARTBEAT_TIMEOUT, "10000")); + Integer.parseInt(XACMLProperties.getProperty(XacmlRestProperties.PROP_PAP_HEARTBEAT_TIMEOUT, "10000")); } @Override @@ -127,7 +126,8 @@ public class Heartbeat implements Runnable { } } - private void getPdpsFromGroup() { + @VisibleForTesting + protected void getPdpsFromGroup() { try { for (OnapPDPGroup g : papEngine.getOnapPDPGroups()) { for (OnapPDP p : g.getOnapPdps()) { @@ -136,11 +136,12 @@ public class Heartbeat implements Runnable { } } catch (PAPException e) { PolicyLogger.error(MessageCodes.ERROR_SYSTEM_ERROR, e, XACMLPAPSERVLET, - "Heartbeat unable to read PDPs from PAPEngine"); + "Heartbeat unable to read PDPs from PAPEngine"); } } - private void notifyEachPdp() { + @VisibleForTesting + protected void notifyEachPdp() { HashMap<String, URL> idToUrlMap = new HashMap<>(); for (OnapPDP pdp : pdps) { // Check for shutdown @@ -163,14 +164,15 @@ public class Heartbeat implements Runnable { } } catch (MalformedURLException e) { PolicyLogger.error(MessageCodes.ERROR_DATA_ISSUE, e, XACMLPAPSERVLET, - " PDP id '" + fullUrlString + "' is not a valid URL"); + " PDP id '" + fullUrlString + "' is not a valid URL"); } } updatePdpStatus(pdp, openPdpConnection(pdpUrl, pdp)); } } - private String openPdpConnection(URL pdpUrl, OnapPDP pdp) { + @VisibleForTesting + protected String openPdpConnection(URL pdpUrl, OnapPDP pdp) { // Do a GET with type HeartBeat String newStatus = ""; HttpURLConnection connection = null; @@ -197,25 +199,25 @@ public class Heartbeat implements Runnable { // anything else is an unexpected result newStatus = PDPStatus.Status.UNKNOWN.toString(); PolicyLogger.error(MessageCodes.ERROR_SYSTEM_ERROR + " Heartbeat connect response code " - + connection.getResponseCode() + ": " + pdp.getId()); + + connection.getResponseCode() + ": " + pdp.getId()); } } } catch (UnknownHostException e) { newStatus = PDPStatus.Status.NO_SUCH_HOST.toString(); PolicyLogger.error(MessageCodes.ERROR_SYSTEM_ERROR, e, XACMLPAPSERVLET, - HEARTBEATSTRING + pdp.getId() + "' NO_SUCH_HOST"); + HEARTBEATSTRING + pdp.getId() + "' NO_SUCH_HOST"); } catch (SocketTimeoutException e) { newStatus = PDPStatus.Status.CANNOT_CONNECT.toString(); PolicyLogger.error(MessageCodes.ERROR_SYSTEM_ERROR, e, XACMLPAPSERVLET, - HEARTBEATSTRING + pdp.getId() + "' connection timeout"); + HEARTBEATSTRING + pdp.getId() + "' connection timeout"); } catch (ConnectException e) { newStatus = PDPStatus.Status.CANNOT_CONNECT.toString(); PolicyLogger.error(MessageCodes.ERROR_SYSTEM_ERROR, e, XACMLPAPSERVLET, - HEARTBEATSTRING + pdp.getId() + "' cannot connect"); + HEARTBEATSTRING + pdp.getId() + "' cannot connect"); } catch (Exception e) { newStatus = PDPStatus.Status.UNKNOWN.toString(); PolicyLogger.error(MessageCodes.ERROR_SYSTEM_ERROR, e, XACMLPAPSERVLET, - HEARTBEATSTRING + pdp.getId() + "' connect exception"); + HEARTBEATSTRING + pdp.getId() + "' connect exception"); } finally { // cleanup the connection if (connection != null) @@ -224,7 +226,8 @@ public class Heartbeat implements Runnable { return newStatus; } - private void updatePdpStatus(OnapPDP pdp, String newStatus) { + @VisibleForTesting + protected void updatePdpStatus(OnapPDP pdp, String newStatus) { if (!pdp.getStatus().getStatus().toString().equals(newStatus)) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("previous status='" + pdp.getStatus().getStatus() + "' new Status='" + newStatus + "'"); @@ -233,7 +236,7 @@ public class Heartbeat implements Runnable { getPAPInstance().setPDPSummaryStatus(pdp, newStatus); } catch (PAPException e) { PolicyLogger.error(MessageCodes.ERROR_PROCESS_FLOW, e, XACMLPAPSERVLET, - "Unable to set state for PDP '" + pdp.getId()); + "Unable to set state for PDP '" + pdp.getId()); } } } diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/UpdateOthersPAPS.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/UpdateOthersPAPS.java index 2bb4229a6..1b25c3b9f 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/UpdateOthersPAPS.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/UpdateOthersPAPS.java @@ -48,7 +48,7 @@ import org.onap.policy.rest.XacmlRestProperties; import org.onap.policy.rest.dao.CommonClassDao; import org.onap.policy.rest.jpa.ActionBodyEntity; import org.onap.policy.rest.jpa.ConfigurationDataEntity; -import org.onap.policy.rest.jpa.PolicyDBDaoEntity; +import org.onap.policy.rest.jpa.PolicyDbDaoEntity; import org.onap.policy.utils.PeCryptoUtils; import org.onap.policy.xacml.api.XACMLErrorConstants; import org.springframework.beans.factory.annotation.Autowired; @@ -103,11 +103,11 @@ public class UpdateOthersPAPS { body.setOldPolicyName(request.getParameter("oldPolicyName")); String currentPap = XacmlRestProperties.getProperty("xacml.rest.pap.url"); - List<Object> getPAPUrls = commonClassDao.getData(PolicyDBDaoEntity.class); + List<Object> getPAPUrls = commonClassDao.getData(PolicyDbDaoEntity.class); if (getPAPUrls != null && !getPAPUrls.isEmpty()) { for (int i = 0; i < getPAPUrls.size(); i++) { - PolicyDBDaoEntity papId = (PolicyDBDaoEntity) getPAPUrls.get(i); - String papUrl = papId.getPolicyDBDaoUrl(); + PolicyDbDaoEntity papId = (PolicyDbDaoEntity) getPAPUrls.get(i); + String papUrl = papId.getPolicyDbDaoUrl(); if (!papUrl.equals(currentPap)) { String userName = papId.getUsername(); String password = papId.getPassword(); diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateBrmsParamPolicy.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateBrmsParamPolicy.java index 36ab893fe..ffb902bc4 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateBrmsParamPolicy.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateBrmsParamPolicy.java @@ -22,7 +22,7 @@ package org.onap.policy.pap.xacml.rest.components; import com.att.research.xacml.api.pap.PAPException; import com.att.research.xacml.std.IdentifierImpl; - +import com.google.common.annotations.VisibleForTesting; import java.io.File; import java.io.IOException; import java.io.PrintWriter; @@ -41,9 +41,7 @@ import java.util.Map.Entry; import java.util.UUID; import java.util.regex.Matcher; import java.util.regex.Pattern; - import javax.script.SimpleBindings; - import oasis.names.tc.xacml._3_0.core.schema.wd_17.AdviceExpressionType; import oasis.names.tc.xacml._3_0.core.schema.wd_17.AdviceExpressionsType; import oasis.names.tc.xacml._3_0.core.schema.wd_17.AllOfType; @@ -57,7 +55,6 @@ import oasis.names.tc.xacml._3_0.core.schema.wd_17.ObjectFactory; import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType; import oasis.names.tc.xacml._3_0.core.schema.wd_17.RuleType; import oasis.names.tc.xacml._3_0.core.schema.wd_17.TargetType; - import org.apache.commons.io.FilenameUtils; import org.onap.policy.common.logging.eelf.MessageCodes; import org.onap.policy.common.logging.eelf.PolicyLogger; @@ -131,7 +128,7 @@ public class CreateBrmsParamPolicy extends Policy { out.close(); } catch (Exception e) { PolicyLogger.error(MessageCodes.ERROR_PROCESS_FLOW, e, "CreateBrmsParamPolicy", - "Exception saving configuration file"); + "Exception saving configuration file"); } } @@ -148,6 +145,7 @@ public class CreateBrmsParamPolicy extends Policy { } // Validations for Config form + @Override public boolean validateConfigForm() { // Validating mandatory Fields. @@ -184,7 +182,7 @@ public class CreateBrmsParamPolicy extends Policy { private String getValueFromDictionary(String templateName) { String ruleTemplate = null; CommonClassDaoImpl dbConnection = new CommonClassDaoImpl(); - String queryString = "from BRMSParamTemplate where param_template_name= :templateName"; + String queryString = "from BrmsParamTemplate where param_template_name= :templateName"; SimpleBindings params = new SimpleBindings(); params.put("templateName", templateName); List<Object> result = dbConnection.getDataByQuery(queryString, params); @@ -252,7 +250,7 @@ public class CreateBrmsParamPolicy extends Policy { } } String param = - params.toString().replace("declare Params", "").replace("end", "").replaceAll("\\s+", ""); + params.toString().replace("declare Params", "").replace("end", "").replaceAll("\\s+", ""); String[] components = param.split(":"); String caption = ""; for (int i = 0; i < components.length; i++) { @@ -283,7 +281,7 @@ public class CreateBrmsParamPolicy extends Policy { } } catch (Exception e) { PolicyLogger.error(MessageCodes.ERROR_SYSTEM_ERROR, e, "CreateBrmsParamPolicy", - "Exception parsing file in findType"); + "Exception parsing file in findType"); } } return mapFieldType; @@ -327,7 +325,7 @@ public class CreateBrmsParamPolicy extends Policy { try { body.append("/* Autogenerated Code Please Don't change/remove this comment section. This is for the UI " - + "purpose. \n\t " + "<$%BRMSParamTemplate=" + templateValue + "%$> \n"); + + "purpose. \n\t " + "<$%BRMSParamTemplate=" + templateValue + "%$> \n"); body.append("<%$Values="); for (Map.Entry<String, String> entry : ruleAndUIValue.entrySet()) { String uiKey = entry.getKey(); @@ -339,7 +337,7 @@ public class CreateBrmsParamPolicy extends Policy { body.append(valueFromDictionary + "\n"); } catch (Exception e) { PolicyLogger.error(MessageCodes.ERROR_PROCESS_FLOW, e, "CreateBrmsParamPolicy", - "Exception saving policy"); + "Exception saving policy"); } saveConfigurations(policyName, body.toString()); @@ -407,7 +405,7 @@ public class CreateBrmsParamPolicy extends Policy { accessURI = new URI(ACTION_ID); } catch (URISyntaxException e) { PolicyLogger.error(MessageCodes.ERROR_DATA_ISSUE, e, "CreateBrmsParamPolicy", - "Exception creating ACCESS URI"); + "Exception creating ACCESS URI"); } accessAttributeDesignator.setCategory(CATEGORY_ACTION); accessAttributeDesignator.setDataType(STRING_DATATYPE); @@ -429,7 +427,7 @@ public class CreateBrmsParamPolicy extends Policy { configURI = new URI(RESOURCE_ID); } catch (URISyntaxException e) { PolicyLogger.error(MessageCodes.ERROR_DATA_ISSUE, e, "CreateBrmsParamPolicy", - "Exception creating Config URI"); + "Exception creating Config URI"); } configAttributeDesignator.setCategory(CATEGORY_RESOURCE); @@ -461,7 +459,8 @@ public class CreateBrmsParamPolicy extends Policy { } // Data required for Advice part is setting here. - private AdviceExpressionsType getAdviceExpressions(int version, String fileName) { + @VisibleForTesting + protected AdviceExpressionsType getAdviceExpressions(int version, String fileName) { // Policy Config ID Assignment AdviceExpressionsType advices = new AdviceExpressionsType(); @@ -546,8 +545,8 @@ public class CreateBrmsParamPolicy extends Policy { // Adding Controller Information. if (policyAdapter.getBrmsController() != null) { BRMSDictionaryController brmsDicitonaryController = new BRMSDictionaryController(); - advice.getAttributeAssignmentExpression().add(createResponseAttributes( - "controller:" + policyAdapter.getBrmsController(), + advice.getAttributeAssignmentExpression() + .add(createResponseAttributes("controller:" + policyAdapter.getBrmsController(), brmsDicitonaryController.getControllerDataByID(policyAdapter.getBrmsController()).getController())); } @@ -561,14 +560,14 @@ public class CreateBrmsParamPolicy extends Policy { key.append(dependencyName + ","); } advice.getAttributeAssignmentExpression() - .add(createResponseAttributes("dependencies:" + key.toString(), dependencies.toString())); + .add(createResponseAttributes("dependencies:" + key.toString(), dependencies.toString())); } // Dynamic Field Config Attributes. Map<String, String> dynamicFieldConfigAttributes = policyAdapter.getDynamicFieldConfigAttributes(); for (Entry<String, String> map : dynamicFieldConfigAttributes.entrySet()) { advice.getAttributeAssignmentExpression() - .add(createResponseAttributes("key:" + map.getKey(), map.getValue())); + .add(createResponseAttributes("key:" + map.getKey(), map.getValue())); } // Risk Attributes diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateNewMicroServiceModel.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateNewMicroServiceModel.java index 573f274f2..ea5e8aa43 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateNewMicroServiceModel.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateNewMicroServiceModel.java @@ -275,7 +275,7 @@ public class CreateNewMicroServiceModel { newModel.setDependency("[]"); if (mainClass.getSubClass() != null) { String value = new Gson().toJson(mainClass.getSubClass()); - newModel.setSub_attributes(value); + newModel.setSubAttributes(value); } if (mainClass.getAttribute() != null) { @@ -289,7 +289,7 @@ public class CreateNewMicroServiceModel { String refAttributes = mainClass.getRefAttribute().toString().replace("{", "").replace("}", ""); int equalsIndex = refAttributes.indexOf("="); String refAttributesAfterFirstEquals = refAttributes.substring(equalsIndex + 1); - this.newModel.setRef_attributes(refAttributesAfterFirstEquals); + this.newModel.setRefAttributes(refAttributesAfterFirstEquals); } if (mainClass.getEnumType() != null) { @@ -328,14 +328,14 @@ public class CreateNewMicroServiceModel { } subAttribute = utils.createSubAttributes(dependency, classMap, this.newModel.getModelName()); - this.newModel.setSub_attributes(subAttribute); + this.newModel.setSubAttributes(subAttribute); if (mainClass.getAttribute() != null && !mainClass.getAttribute().isEmpty()) { this.newModel.setAttributes(mainClass.getAttribute().toString().replace("{", "").replace("}", "")); } if (mainClass.getRefAttribute() != null && !mainClass.getRefAttribute().isEmpty()) { this.newModel - .setRef_attributes(mainClass.getRefAttribute().toString().replace("{", "").replace("}", "")); + .setRefAttributes(mainClass.getRefAttribute().toString().replace("{", "").replace("}", "")); } if (mainClass.getEnumType() != null && !mainClass.getEnumType().isEmpty()) { @@ -368,8 +368,8 @@ public class CreateNewMicroServiceModel { model.setDependency(this.newModel.getDependency()); model.setDescription(this.newModel.getDescription()); model.setEnumValues(this.newModel.getEnumValues()); - model.setRef_attributes(this.newModel.getRef_attributes()); - model.setSub_attributes(this.newModel.getSub_attributes()); + model.setRefAttributes(this.newModel.getRefAttributes()); + model.setSubAttributes(this.newModel.getSubAttributes()); model.setDataOrderInfo(this.newModel.getDataOrderInfo()); model.setDecisionModel(this.newModel.isDecisionModel()); model.setRuleFormation(this.newModel.getRuleFormation()); diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/HandleIncomingNotifications.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/HandleIncomingNotifications.java index 4e4c02672..72e6f488a 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/HandleIncomingNotifications.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/HandleIncomingNotifications.java @@ -250,12 +250,12 @@ public class HandleIncomingNotifications { } else if (localGroup == null) { // creating a new group try { - PolicyDbDao.getPolicyDbDaoInstance().getPapEngine().newGroup(groupRecord.getgroupName(), + PolicyDbDao.getPolicyDbDaoInstance().getPapEngine().newGroup(groupRecord.getGroupName(), groupRecord.getDescription()); } catch (NullPointerException | PAPException e) { PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, PolicyDbDao.POLICYDBDAO_VAR, "Caught PAPException trying to create pdp group with " - + "papEngine.newGroup(groupRecord.getgroupName(), groupRecord.getDescription());"); + + "papEngine.newGroup(groupRecord.getGroupName(), groupRecord.getDescription());"); throw new PAPException("Could not create group " + groupRecord); } try { @@ -311,11 +311,11 @@ public class HandleIncomingNotifications { needToUpdate = true; } if (!PolicyDbDao.stringEquals(localGroupClone.getId(), groupRecord.getGroupId()) - || !PolicyDbDao.stringEquals(localGroupClone.getName(), groupRecord.getgroupName())) { + || !PolicyDbDao.stringEquals(localGroupClone.getName(), groupRecord.getGroupName())) { // changing ids // we do not want to change the id, the papEngine will do this // for us, it needs to know the old id - localGroupClone.setName(groupRecord.getgroupName()); + localGroupClone.setName(groupRecord.getGroupName()); needToUpdate = true; } if (!PolicyDbDao.stringEquals(localGroupClone.getDescription(), groupRecord.getDescription())) { diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/NotifyOtherPaps.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/NotifyOtherPaps.java index cd290c66c..e9db043bf 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/NotifyOtherPaps.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/NotifyOtherPaps.java @@ -35,13 +35,13 @@ import java.util.UUID; import org.onap.policy.common.logging.flexlogger.FlexLogger; import org.onap.policy.common.logging.flexlogger.Logger; import org.onap.policy.rest.XacmlRestProperties; -import org.onap.policy.rest.jpa.PolicyDBDaoEntity; +import org.onap.policy.rest.jpa.PolicyDbDaoEntity; import org.onap.policy.utils.PeCryptoUtils; public class NotifyOtherPaps { private static final Logger LOGGER = FlexLogger.getLogger(NotifyOtherPaps.class); - private List<PolicyDBDaoEntity> failedPaps = null; + private List<PolicyDbDaoEntity> failedPaps = null; public void notifyOthers(long entityId, String entityType) { notifyOthers(entityId, entityType, null); @@ -104,8 +104,8 @@ public class NotifyOtherPaps { @Override public void run() { PolicyDbDao dao = new PolicyDbDao(); - PolicyDBDaoEntity dbdEntity = (PolicyDBDaoEntity) obj; - String otherPap = dbdEntity.getPolicyDBDaoUrl(); + PolicyDbDaoEntity dbdEntity = (PolicyDbDaoEntity) obj; + String otherPap = dbdEntity.getPolicyDbDaoUrl(); String txt; try { txt = PeCryptoUtils.decrypt(dbdEntity.getPassword()); diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDbDao.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDbDao.java index e0db53e8b..9af380b05 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDbDao.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDbDao.java @@ -59,7 +59,7 @@ import org.onap.policy.rest.jpa.ConfigurationDataEntity; import org.onap.policy.rest.jpa.DatabaseLockEntity; import org.onap.policy.rest.jpa.GroupEntity; import org.onap.policy.rest.jpa.PdpEntity; -import org.onap.policy.rest.jpa.PolicyDBDaoEntity; +import org.onap.policy.rest.jpa.PolicyDbDaoEntity; import org.onap.policy.rest.jpa.PolicyEntity; import org.onap.policy.utils.PeCryptoUtils; import org.onap.policy.xacml.api.XACMLErrorConstants; @@ -212,14 +212,14 @@ public class PolicyDbDao { /** * Gets the list of other registered PolicyDBDaos from the database. * - * @return List (type PolicyDBDaoEntity) of other PolicyDBDaos + * @return List (type PolicyDbDaoEntity) of other PolicyDBDaos */ private List<?> getRemotePolicyDbDaoList() { logger.debug("getRemotePolicyDBDaoList() as getRemotePolicyDBDaoList() called"); List<?> policyDbDaoEntityList = new LinkedList<>(); Session session = sessionfactory.openSession(); try { - Criteria cr = session.createCriteria(PolicyDBDaoEntity.class); + Criteria cr = session.createCriteria(PolicyDbDaoEntity.class); policyDbDaoEntityList = cr.list(); } catch (Exception e) { PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, POLICYDBDAO_VAR, @@ -328,7 +328,7 @@ public class PolicyDbDao { } /** - * Register the PolicyDBDao instance in the PolicyDBDaoEntity table. + * Register the PolicyDBDao instance in the PolicyDbDaoEntity table. * * @return Boolean, were we able to register? */ @@ -370,19 +370,19 @@ public class PolicyDbDao { } } logger.debug("\nPolicyDBDao.register. Database locking and concurrency control is initialized\n"); - PolicyDBDaoEntity foundPolicyDbDaoEntity = null; - Criteria cr = session.createCriteria(PolicyDBDaoEntity.class); - cr.add(Restrictions.eq("policyDBDaoUrl", url[0])); + PolicyDbDaoEntity foundPolicyDbDaoEntity = null; + Criteria cr = session.createCriteria(PolicyDbDaoEntity.class); + cr.add(Restrictions.eq("policyDbDaoUrl", url[0])); List<?> data = cr.list(); if (!data.isEmpty()) { - foundPolicyDbDaoEntity = (PolicyDBDaoEntity) data.get(0); + foundPolicyDbDaoEntity = (PolicyDbDaoEntity) data.get(0); } // encrypt the password String txt = PeCryptoUtils.encrypt(url[2]); if (foundPolicyDbDaoEntity == null) { - PolicyDBDaoEntity newPolicyDbDaoEntity = new PolicyDBDaoEntity(); - newPolicyDbDaoEntity.setPolicyDBDaoUrl(url[0]); + PolicyDbDaoEntity newPolicyDbDaoEntity = new PolicyDbDaoEntity(); + newPolicyDbDaoEntity.setPolicyDbDaoUrl(url[0]); newPolicyDbDaoEntity.setDescription("PAP server at " + url[0]); newPolicyDbDaoEntity.setUsername(url[1]); newPolicyDbDaoEntity.setPassword(txt); diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDbDaoTransactionInstance.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDbDaoTransactionInstance.java index 882169a34..67214acf2 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDbDaoTransactionInstance.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDbDaoTransactionInstance.java @@ -1008,7 +1008,7 @@ public class PolicyDbDaoTransactionInstance implements PolicyDbDaoTransaction { } if (group.getName() != null - && !PolicyDbDao.stringEquals(group.getName(), groupToUpdateInDb.getgroupName())) { + && !PolicyDbDao.stringEquals(group.getName(), groupToUpdateInDb.getGroupName())) { // we need to check if the new id exists in the database String newGrpId = PolicyDbDao.createNewPdpGroupId(group.getName()); Query checkGroupQuery = session.createQuery(PolicyDbDao.GROUPENTITY_SELECT); diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/ClosedLoopDictionaryController.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/ClosedLoopDictionaryController.java index 0b94b40bc..16e8e2e2c 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/ClosedLoopDictionaryController.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/ClosedLoopDictionaryController.java @@ -38,7 +38,7 @@ import org.onap.policy.rest.dao.CommonClassDao; import org.onap.policy.rest.jpa.ClosedLoopD2Services; import org.onap.policy.rest.jpa.ClosedLoopSite; import org.onap.policy.rest.jpa.OnapName; -import org.onap.policy.rest.jpa.PEPOptions; +import org.onap.policy.rest.jpa.PepOptions; import org.onap.policy.rest.jpa.UserInfo; import org.onap.policy.rest.jpa.VNFType; import org.onap.policy.rest.jpa.VSCLAction; @@ -134,7 +134,7 @@ public class ClosedLoopDictionaryController { produces = MediaType.APPLICATION_JSON_VALUE) public void getPEPOptionsDictionaryByNameEntityData(HttpServletResponse response) { DictionaryUtils utils = getDictionaryUtilsInstance(); - utils.getDataByEntity(response, pepOptionDatas, pepName, PEPOptions.class); + utils.getDataByEntity(response, pepOptionDatas, pepName, PepOptions.class); } @RequestMapping( @@ -143,7 +143,7 @@ public class ClosedLoopDictionaryController { produces = MediaType.APPLICATION_JSON_VALUE) public void getPEPOptionsDictionaryEntityData(HttpServletResponse response) { DictionaryUtils utils = getDictionaryUtilsInstance(); - utils.getData(response, pepOptionDatas, PEPOptions.class); + utils.getData(response, pepOptionDatas, PepOptions.class); } @RequestMapping( @@ -336,15 +336,15 @@ public class ClosedLoopDictionaryController { ObjectMapper mapper = new ObjectMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); JsonNode root = mapper.readTree(request.getReader()); - PEPOptions pEPOptions; + PepOptions pEPOptions; GridData gridData; String userId = null; if (fromAPI) { - pEPOptions = mapper.readValue(root.get(dictionaryFields).toString(), PEPOptions.class); + pEPOptions = mapper.readValue(root.get(dictionaryFields).toString(), PepOptions.class); gridData = mapper.readValue(root.get(dictionaryFields).toString(), GridData.class); userId = "API"; } else { - pEPOptions = mapper.readValue(root.get("pepOptionsDictionaryData").toString(), PEPOptions.class); + pEPOptions = mapper.readValue(root.get("pepOptionsDictionaryData").toString(), PepOptions.class); gridData = mapper.readValue(root.get("pepOptionsDictionaryData").toString(), GridData.class); userId = root.get(userid).textValue(); } @@ -355,10 +355,10 @@ public class ClosedLoopDictionaryController { } List<Object> duplicateData = - commonClassDao.checkDuplicateEntry(pEPOptions.getPepName(), pepName, PEPOptions.class); + commonClassDao.checkDuplicateEntry(pEPOptions.getPepName(), pepName, PepOptions.class); boolean duplicateflag = false; if (!duplicateData.isEmpty()) { - PEPOptions data = (PEPOptions) duplicateData.get(0); + PepOptions data = (PepOptions) duplicateData.get(0); if (request.getParameter(operation) != null && "update".equals(request.getParameter(operation))) { pEPOptions.setId(data.getId()); } else if ((request.getParameter(operation) != null @@ -377,7 +377,7 @@ public class ClosedLoopDictionaryController { pEPOptions.setModifiedDate(new Date()); commonClassDao.update(pEPOptions); } - responseString = mapper.writeValueAsString(commonClassDao.getData(PEPOptions.class)); + responseString = mapper.writeValueAsString(commonClassDao.getData(PepOptions.class)); } else { responseString = duplicateResponseString; } diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/DictionaryController.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/DictionaryController.java index 5de2dfbc2..e2e2e3872 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/DictionaryController.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/DictionaryController.java @@ -211,7 +211,7 @@ public class DictionaryController { UserInfo userInfo = utils.getUserInfo(userId); List<Object> duplicateData = - commonClassDao.checkDuplicateEntry(onapData.getOnapName(), onapName, OnapName.class); + commonClassDao.checkDuplicateEntry(onapData.getName(), onapName, OnapName.class); boolean duplicateflag = false; if (!duplicateData.isEmpty()) { OnapName data = (OnapName) duplicateData.get(0); diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/DictionaryImportController.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/DictionaryImportController.java index 7400eb0c8..ef475039d 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/DictionaryImportController.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/DictionaryImportController.java @@ -56,7 +56,7 @@ import org.onap.policy.rest.jpa.DescriptiveScope; import org.onap.policy.rest.jpa.GroupServiceList; import org.onap.policy.rest.jpa.MicroServiceModels; import org.onap.policy.rest.jpa.OnapName; -import org.onap.policy.rest.jpa.PEPOptions; +import org.onap.policy.rest.jpa.PepOptions; import org.onap.policy.rest.jpa.PrefixList; import org.onap.policy.rest.jpa.ProtocolList; import org.onap.policy.rest.jpa.SecurityZone; @@ -213,7 +213,7 @@ public class DictionaryImportController { for (int j = 0; j < rows.length; j++) { if ("onap_name".equalsIgnoreCase(dictSheet.get(0)[j]) || "Onap Name".equalsIgnoreCase(dictSheet.get(0)[j])) { - attribute.setOnapName(rows[j]); + attribute.setName(rows[j]); } if (DESCRIPTION.equalsIgnoreCase(dictSheet.get(0)[j])) { attribute.setDescription(rows[j]); @@ -252,10 +252,10 @@ public class DictionaryImportController { attribute.setEnumValues(rows[j]); } if ("Ref Attributes".equalsIgnoreCase(dictSheet.get(0)[j])) { - attribute.setRef_attributes(rows[j]); + attribute.setRefAttributes(rows[j]); } if ("Sub Attributes".equalsIgnoreCase(dictSheet.get(0)[j])) { - attribute.setSub_attributes(rows[j]); + attribute.setSubAttributes(rows[j]); } if ("annotations".equalsIgnoreCase(dictSheet.get(0)[j])) { attribute.setAnnotation(rows[j]); @@ -295,10 +295,10 @@ public class DictionaryImportController { attribute.setEnumValues(rows[j]); } if ("Ref Attributes".equalsIgnoreCase(dictSheet.get(0)[j])) { - attribute.setRef_attributes(rows[j]); + attribute.setRefAttributes(rows[j]); } if ("Sub Attributes".equalsIgnoreCase(dictSheet.get(0)[j])) { - attribute.setSub_attributes(rows[j]); + attribute.setSubAttributes(rows[j]); } if ("annotations".equalsIgnoreCase(dictSheet.get(0)[j])) { attribute.setAnnotation(rows[j]); @@ -389,9 +389,9 @@ public class DictionaryImportController { commonClassDao.save(attribute); } } - if (dictionaryName.startsWith("PEPOptions")) { + if (dictionaryName.startsWith("PepOptions")) { for (int i = 1; i < dictSheet.size(); i++) { - PEPOptions attribute = new PEPOptions(); + PepOptions attribute = new PepOptions(); UserInfo userinfo = new UserInfo(); userinfo.setUserLoginId(userId); attribute.setUserCreatedBy(userinfo); @@ -801,7 +801,7 @@ public class DictionaryImportController { case VSCLAction: case ClosedLoopService: case ClosedLoopSite: - case PEPOptions: + case PepOptions: case VarbindDictionary: case BRMSParamDictionary: case BRMSControllerDictionary: diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/FirewallDictionaryController.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/FirewallDictionaryController.java index 8dda4ddc7..39a12c81a 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/FirewallDictionaryController.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/FirewallDictionaryController.java @@ -42,8 +42,8 @@ import org.onap.policy.pap.xacml.rest.util.DictionaryUtils; import org.onap.policy.rest.dao.CommonClassDao; import org.onap.policy.rest.jpa.ActionList; import org.onap.policy.rest.jpa.AddressGroup; -import org.onap.policy.rest.jpa.FWTag; -import org.onap.policy.rest.jpa.FWTagPicker; +import org.onap.policy.rest.jpa.FwTag; +import org.onap.policy.rest.jpa.FwTagPicker; import org.onap.policy.rest.jpa.FirewallDictionaryList; import org.onap.policy.rest.jpa.GroupServiceList; import org.onap.policy.rest.jpa.PortList; @@ -1013,7 +1013,7 @@ public class FirewallDictionaryController { produces = MediaType.APPLICATION_JSON_VALUE) public void getTagPickerNameEntityDataByName(HttpServletResponse response) { DictionaryUtils utils = getDictionaryUtilsInstance(); - utils.getDataByEntity(response, fwTagPickerDatas, tagPickerName, FWTagPicker.class); + utils.getDataByEntity(response, fwTagPickerDatas, tagPickerName, FwTagPicker.class); } @RequestMapping( @@ -1022,7 +1022,7 @@ public class FirewallDictionaryController { produces = MediaType.APPLICATION_JSON_VALUE) public void getTagPickerDictionaryEntityData(HttpServletResponse response) { DictionaryUtils utils = getDictionaryUtilsInstance(); - utils.getData(response, fwTagPickerDatas, FWTagPicker.class); + utils.getData(response, fwTagPickerDatas, FwTagPicker.class); } @RequestMapping(value = {"/fw_dictionary/save_fwTagPicker"}, method = {RequestMethod.POST}) @@ -1034,15 +1034,15 @@ public class FirewallDictionaryController { ObjectMapper mapper = new ObjectMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); JsonNode root = mapper.readTree(request.getReader()); - FWTagPicker fwTagPicker; + FwTagPicker fwTagPicker; TagGridValues data; String userId = ""; if (fromAPI) { - fwTagPicker = mapper.readValue(root.get(dictionaryFields).toString(), FWTagPicker.class); + fwTagPicker = mapper.readValue(root.get(dictionaryFields).toString(), FwTagPicker.class); data = mapper.readValue(root.get(dictionaryFields).toString(), TagGridValues.class); userId = "API"; } else { - fwTagPicker = mapper.readValue(root.get("fwTagPickerDictionaryData").toString(), FWTagPicker.class); + fwTagPicker = mapper.readValue(root.get("fwTagPickerDictionaryData").toString(), FwTagPicker.class); data = mapper.readValue(root.get("fwTagPickerDictionaryData").toString(), TagGridValues.class); userId = root.get(userid).textValue(); } @@ -1051,10 +1051,10 @@ public class FirewallDictionaryController { UserInfo userInfo = utils.getUserInfo(userId); List<Object> duplicateData = commonClassDao.checkDuplicateEntry(fwTagPicker.getTagPickerName(), - tagPickerName, FWTagPicker.class); + tagPickerName, FwTagPicker.class); boolean duplicateflag = false; if (!duplicateData.isEmpty()) { - FWTagPicker data1 = (FWTagPicker) duplicateData.get(0); + FwTagPicker data1 = (FwTagPicker) duplicateData.get(0); if (request.getParameter(operation) != null && "update".equals(request.getParameter(operation))) { fwTagPicker.setId(data1.getId()); } else if ((request.getParameter(operation) != null @@ -1073,7 +1073,7 @@ public class FirewallDictionaryController { fwTagPicker.setModifiedDate(new Date()); commonClassDao.update(fwTagPicker); } - responseString = mapper.writeValueAsString(commonClassDao.getData(FWTagPicker.class)); + responseString = mapper.writeValueAsString(commonClassDao.getData(FwTagPicker.class)); } else { responseString = duplicateResponseString; } @@ -1092,7 +1092,7 @@ public class FirewallDictionaryController { public void removeFirewallTagPickerDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException { DictionaryUtils utils = getDictionaryUtilsInstance(); - utils.removeData(request, response, fwTagPickerDatas, FWTagPicker.class); + utils.removeData(request, response, fwTagPickerDatas, FwTagPicker.class); } @RequestMapping( @@ -1101,7 +1101,7 @@ public class FirewallDictionaryController { produces = MediaType.APPLICATION_JSON_VALUE) public void getTagDictionaryEntityData(HttpServletResponse response) { DictionaryUtils utils = getDictionaryUtilsInstance(); - utils.getData(response, fwTagDatas, FWTag.class); + utils.getData(response, fwTagDatas, FwTag.class); } @RequestMapping( @@ -1110,7 +1110,7 @@ public class FirewallDictionaryController { produces = MediaType.APPLICATION_JSON_VALUE) public void getTagNameEntityDataByName(HttpServletResponse response) { DictionaryUtils utils = getDictionaryUtilsInstance(); - utils.getDataByEntity(response, fwTagDatas, "fwTagName", FWTag.class); + utils.getDataByEntity(response, fwTagDatas, "fwTagName", FwTag.class); } @RequestMapping(value = {"/fw_dictionary/save_fwTag"}, method = {RequestMethod.POST}) @@ -1122,15 +1122,15 @@ public class FirewallDictionaryController { ObjectMapper mapper = new ObjectMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); JsonNode root = mapper.readTree(request.getReader()); - FWTag fwTag; + FwTag fwTag; TagGridValues tagGridValues; String userId = ""; if (fromAPI) { - fwTag = mapper.readValue(root.get(dictionaryFields).toString(), FWTag.class); + fwTag = mapper.readValue(root.get(dictionaryFields).toString(), FwTag.class); tagGridValues = mapper.readValue(root.get(dictionaryFields).toString(), TagGridValues.class); userId = "API"; } else { - fwTag = mapper.readValue(root.get("fwTagDictionaryData").toString(), FWTag.class); + fwTag = mapper.readValue(root.get("fwTagDictionaryData").toString(), FwTag.class); tagGridValues = mapper.readValue(root.get("fwTagDictionaryData").toString(), TagGridValues.class); userId = root.get(userid).textValue(); } @@ -1138,10 +1138,10 @@ public class FirewallDictionaryController { UserInfo userInfo = utils.getUserInfo(userId); List<Object> duplicateData = - commonClassDao.checkDuplicateEntry(fwTag.getFwTagName(), "fwTagName", FWTag.class); + commonClassDao.checkDuplicateEntry(fwTag.getFwTagName(), "fwTagName", FwTag.class); boolean duplicateflag = false; if (!duplicateData.isEmpty()) { - FWTag data = (FWTag) duplicateData.get(0); + FwTag data = (FwTag) duplicateData.get(0); if (request.getParameter(operation) != null && "update".equals(request.getParameter(operation))) { fwTag.setId(data.getId()); } else if ((request.getParameter(operation) != null @@ -1160,7 +1160,7 @@ public class FirewallDictionaryController { fwTag.setModifiedDate(new Date()); commonClassDao.update(fwTag); } - responseString = mapper.writeValueAsString(commonClassDao.getData(FWTag.class)); + responseString = mapper.writeValueAsString(commonClassDao.getData(FwTag.class)); } else { responseString = duplicateResponseString; } @@ -1179,7 +1179,7 @@ public class FirewallDictionaryController { public void removeFirewallTagDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException { DictionaryUtils utils = getDictionaryUtilsInstance(); - utils.removeData(request, response, fwTagDatas, FWTag.class); + utils.removeData(request, response, fwTagDatas, FwTag.class); } } diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/MicroServiceDictionaryController.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/MicroServiceDictionaryController.java index dfd7af48d..b9e1ce1ce 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/MicroServiceDictionaryController.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/MicroServiceDictionaryController.java @@ -658,7 +658,7 @@ public class MicroServiceDictionaryController { MSAttributeObject mainClass = classMap.get(this.newModel.getModelName()); this.newModel.setDependency("[]"); String value = new Gson().toJson(mainClass.getSubClass()); - this.newModel.setSub_attributes(value); + this.newModel.setSubAttributes(value); String attributes = mainClass.getAttribute().toString().replace("{", "").replace("}", ""); int equalsIndexForAttributes = attributes.indexOf('='); String atttributesAfterFirstEquals = attributes.substring(equalsIndexForAttributes + 1); @@ -666,7 +666,7 @@ public class MicroServiceDictionaryController { String refAttributes = mainClass.getRefAttribute().toString().replace("{", "").replace("}", ""); int equalsIndex = refAttributes.indexOf("="); String refAttributesAfterFirstEquals = refAttributes.substring(equalsIndex + 1); - this.newModel.setRef_attributes(refAttributesAfterFirstEquals); + this.newModel.setRefAttributes(refAttributesAfterFirstEquals); this.newModel.setEnumValues(mainClass.getEnumType().toString().replace("{", "").replace("}", "")); this.newModel .setAnnotation(mainClass.getMatchingSet().toString().replace("{", "").replace("}", "")); @@ -713,10 +713,10 @@ public class MicroServiceDictionaryController { } } microServiceModels.setAttributes(this.newModel.getAttributes()); - microServiceModels.setRef_attributes(this.newModel.getRef_attributes()); + microServiceModels.setRefAttributes(this.newModel.getRefAttributes()); microServiceModels.setDependency(this.newModel.getDependency()); microServiceModels.setModelName(this.newModel.getModelName()); - microServiceModels.setSub_attributes(this.newModel.getSub_attributes()); + microServiceModels.setSubAttributes(this.newModel.getSubAttributes()); microServiceModels.setVersion(this.newModel.getVersion()); microServiceModels.setEnumValues(this.newModel.getEnumValues()); microServiceModels.setAnnotation(this.newModel.getAnnotation()); @@ -798,9 +798,9 @@ public class MicroServiceDictionaryController { } if (mainClass != null) { this.newModel.setDependency(mainClass.getDependency()); - this.newModel.setSub_attributes(subAttribute); + this.newModel.setSubAttributes(subAttribute); this.newModel.setAttributes(mainClass.getAttribute().toString().replace("{", "").replace("}", "")); - this.newModel.setRef_attributes(mainClass.getRefAttribute().toString().replace("{", "").replace("}", "")); + this.newModel.setRefAttributes(mainClass.getRefAttribute().toString().replace("{", "").replace("}", "")); this.newModel.setEnumValues(mainClass.getEnumType().toString().replace("{", "").replace("}", "")); this.newModel.setAnnotation(mainClass.getMatchingSet().toString().replace("{", "").replace("}", "")); } diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/elk/client/PolicyElasticSearchController.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/elk/client/PolicyElasticSearchController.java index ad6b9cf8e..f21ac60c8 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/elk/client/PolicyElasticSearchController.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/elk/client/PolicyElasticSearchController.java @@ -58,7 +58,7 @@ import org.onap.policy.rest.jpa.GroupPolicyScopeList; import org.onap.policy.rest.jpa.MicroServiceLocation; import org.onap.policy.rest.jpa.MicroServiceModels; import org.onap.policy.rest.jpa.OnapName; -import org.onap.policy.rest.jpa.PEPOptions; +import org.onap.policy.rest.jpa.PepOptions; import org.onap.policy.rest.jpa.RiskType; import org.onap.policy.rest.jpa.SafePolicyWarning; import org.onap.policy.rest.jpa.TermList; @@ -340,7 +340,7 @@ public class PolicyElasticSearchController { break; case onapName: OnapName onapName = mapper.readValue(root.get("data").toString(), OnapName.class); - value = onapName.getOnapName(); + value = onapName.getName(); policyList = searchElkDatabase(all, "onapName", value); break; case actionPolicy: @@ -356,7 +356,7 @@ public class PolicyElasticSearchController { policyList = searchElkDatabase(config, "ruleName", value); break; case pepOptions: - PEPOptions pEPOptions = mapper.readValue(root.get("data").toString(), PEPOptions.class); + PepOptions pEPOptions = mapper.readValue(root.get("data").toString(), PepOptions.class); value = pEPOptions.getPepName(); policyList = searchElkDatabase(closedloop, "jsonBodyData.pepName", value); break; diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/handler/DictionaryHandlerImpl.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/handler/DictionaryHandlerImpl.java index 65c50b1c0..f16c2031c 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/handler/DictionaryHandlerImpl.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/handler/DictionaryHandlerImpl.java @@ -56,7 +56,7 @@ public class DictionaryHandlerImpl implements DictionaryHandler { case "VNFType": dictionary.getVnfType(response); break; - case "PEPOptions": + case "PepOptions": dictionary.getPEPOptions(response); break; case "Varbind": @@ -206,7 +206,7 @@ public class DictionaryHandlerImpl implements DictionaryHandler { case "VNFType": result = dictionary.saveVnfType(request, response); break; - case "PEPOptions": + case "PepOptions": result = dictionary.savePEPOptions(request, response); break; case "Varbind": diff --git a/ONAP-PAP-REST/src/main/resources/META-INF/drop.ddl b/ONAP-PAP-REST/src/main/resources/META-INF/drop.ddl index 062169345..d28a00dde 100644 --- a/ONAP-PAP-REST/src/main/resources/META-INF/drop.ddl +++ b/ONAP-PAP-REST/src/main/resources/META-INF/drop.ddl @@ -20,7 +20,7 @@ DROP TABLE IF EXISTS ConfigurationDataEntity DROP TABLE IF EXISTS PolicyEntity -DROP TABLE IF EXISTS PolicyDBDaoEntity +DROP TABLE IF EXISTS PolicyDbDaoEntity DROP TABLE IF EXISTS ActionBodyEntity DROP SEQUENCE IF EXISTS seqPolicy DROP SEQUENCE IF EXISTS seqConfig diff --git a/ONAP-PAP-REST/src/main/resources/META-INF/persistence.xml b/ONAP-PAP-REST/src/main/resources/META-INF/persistence.xml index 7be95014d..0280219a7 100644 --- a/ONAP-PAP-REST/src/main/resources/META-INF/persistence.xml +++ b/ONAP-PAP-REST/src/main/resources/META-INF/persistence.xml @@ -22,7 +22,7 @@ <persistence-unit name="XACML-PAP-REST"> <class>org.onap.policy.rest.jpa.PolicyEntity</class> <class>org.onap.policy.rest.jpa.ConfigurationDataEntity</class> - <class>org.onap.policy.rest.jpa.PolicyDBDaoEntity</class> + <class>org.onap.policy.rest.jpa.PolicyDbDaoEntity</class> <class>org.onap.policy.rest.jpa.GroupEntity</class> <class>org.onap.policy.rest.jpa.PdpEntity</class> <class>org.onap.policy.rest.jpa.ActionBodyEntity</class> @@ -40,7 +40,7 @@ <class>org.onap.policy.rest.jpa.ActionPolicyDict</class> <class>org.onap.policy.rest.jpa.DecisionSettings</class> <class>org.onap.policy.rest.jpa.MicroServiceModels</class> - <class>org.onap.policy.rest.jpa.BRMSParamTemplate</class> + <class>org.onap.policy.rest.jpa.BrmsParamTemplate</class> <class>org.onap.policy.rest.jpa.PolicyEditorScopes</class> <!-- unique to PolicyEngineUtils - will be audited from PAP --> <class>org.onap.policy.jpa.BackUpMonitorEntity</class> @@ -109,7 +109,7 @@ <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> <class>org.onap.policy.rest.jpa.PolicyEntity</class> <class>org.onap.policy.rest.jpa.ConfigurationDataEntity</class> - <class>org.onap.policy.rest.jpa.PolicyDBDaoEntity</class> + <class>org.onap.policy.rest.jpa.PolicyDbDaoEntity</class> <class>org.onap.policy.rest.jpa.GroupEntity</class> <class>org.onap.policy.rest.jpa.PdpEntity</class> <class>org.onap.policy.rest.jpa.ActionBodyEntity</class> @@ -131,11 +131,11 @@ <class>org.onap.policy.rest.jpa.ActionList</class> <class>org.onap.policy.rest.jpa.AddressGroup</class> <class>org.onap.policy.rest.jpa.AttributeAssignment</class> - <class>org.onap.policy.rest.jpa.BRMSParamTemplate</class> + <class>org.onap.policy.rest.jpa.BrmsParamTemplate</class> <class>org.onap.policy.rest.jpa.ClosedLoopD2Services</class> <class>org.onap.policy.rest.jpa.ClosedLoopSite</class> - <class>org.onap.policy.rest.jpa.DCAEUsers</class> - <class>org.onap.policy.rest.jpa.DCAEuuid</class> + <class>org.onap.policy.rest.jpa.DcaeUsers</class> + <class>org.onap.policy.rest.jpa.Dcaeuuid</class> <class>org.onap.policy.rest.jpa.DescriptiveScope</class> <class>org.onap.policy.rest.jpa.OnapName</class> <class>org.onap.policy.rest.jpa.EnforcingType</class> @@ -146,12 +146,12 @@ <class>org.onap.policy.rest.jpa.MicroServiceLocation</class> <class>org.onap.policy.rest.jpa.Obadvice</class> <class>org.onap.policy.rest.jpa.ObadviceExpression</class> - <class>org.onap.policy.rest.jpa.PEPOptions</class> - <class>org.onap.policy.rest.jpa.PIPConfigParam</class> - <class>org.onap.policy.rest.jpa.PIPConfiguration</class> - <class>org.onap.policy.rest.jpa.PIPResolver</class> - <class>org.onap.policy.rest.jpa.PIPResolverParam</class> - <class>org.onap.policy.rest.jpa.PIPType</class> + <class>org.onap.policy.rest.jpa.PepOptions</class> + <class>org.onap.policy.rest.jpa.PipConfigParam</class> + <class>org.onap.policy.rest.jpa.PipConfiguration</class> + <class>org.onap.policy.rest.jpa.PipResolver</class> + <class>org.onap.policy.rest.jpa.PipResolverParam</class> + <class>org.onap.policy.rest.jpa.PipType</class> <class>org.onap.policy.rest.jpa.PolicyAlgorithms</class> <class>org.onap.policy.rest.jpa.PolicyManagement</class> <class>org.onap.policy.rest.jpa.PolicyScopeService</class> |