X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ONAP-PAP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpap%2Fxacml%2Frest%2Fcomponents%2FPolicyDbDaoTransaction.java;fp=ONAP-PAP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpap%2Fxacml%2Frest%2Fcomponents%2FPolicyDBDaoTransaction.java;h=70ca36ac7e57f1c2b1d52d3dacd0b5dad4bfb380;hb=refs%2Fchanges%2F39%2F97839%2F2;hp=250029a89f35070a2fd71d5c4ad73319a161fe80;hpb=fdfd5a00ed2805fe6138dbd0a78840c7210e8098;p=policy%2Fengine.git diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDaoTransaction.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDbDaoTransaction.java similarity index 86% rename from ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDaoTransaction.java rename to ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDbDaoTransaction.java index 250029a89..70ca36ac7 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDaoTransaction.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDbDaoTransaction.java @@ -3,6 +3,7 @@ * ONAP-PAP-REST * ================================================================================ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,14 +27,14 @@ import java.util.List; import javax.persistence.PersistenceException; -import org.onap.policy.rest.dao.PolicyDBException; +import org.onap.policy.rest.dao.PolicyDbException; import org.onap.policy.rest.jpa.GroupEntity; import org.onap.policy.rest.jpa.PdpEntity; import org.onap.policy.xacml.api.pap.OnapPDP; import org.onap.policy.xacml.api.pap.OnapPDPGroup; import org.onap.policy.xacml.std.pap.StdPDPGroup; -public interface PolicyDBDaoTransaction { +public interface PolicyDbDaoTransaction { /** * Commits (makes permanent) the current transaction. Also, notifies other PolicyDBDao instances on other PAP @@ -45,7 +46,7 @@ public interface PolicyDBDaoTransaction { public void commitTransaction(); /** - * Create or update a policy + * Create or update a policy. * * @param policy A Policy object representing the policy to store or update * @param username A string of the username you want to be stored for doing this operation @@ -53,10 +54,10 @@ public interface PolicyDBDaoTransaction { * @throws PersistenceException If a database error occurs * @throws IllegalArgumentException If the Policy's PolicyRestAdapter contains incorrect data. */ - public void createPolicy(Policy policy, String username) throws PolicyDBException; + public void createPolicy(Policy policy, String username) throws PolicyDbException; /** - * Check if the PolicyDBDaoTransaction is currently open + * Check if the PolicyDBDaoTransaction is currently open. * * @return False if the PolicyDBDao transaction has not been used or has been committed already, true if it is open. */ @@ -74,7 +75,7 @@ public interface PolicyDBDaoTransaction { public void close(); /** - * Create a new PDP group in the database + * Create a new PDP group in the database. * * @param groupID The ID to name the new group (use PolicyDBDao.createNewPDPGroupId) * @param groupName The name to use for the new group @@ -85,23 +86,22 @@ public interface PolicyDBDaoTransaction { * @throws PersistenceException If a database error occurs */ public void createGroup(String groupID, String groupName, String groupDescription, String username) - throws PolicyDBException; + throws PolicyDbException; /** - * Updates a group in the database with a new name of description + * Updates a group in the database with a new name of description. * * @param group The group with updated information. The id must match an existing group, but the name and * description can be changed. - * @param username Username of the user performing the operation * @param userId needed to store user information in policyAuditlog table during transaction. * @throws IllegalArgumentException If non-optional parameters are null or empty strings * @throws IllegalStateException If a transaction is already open * @throws PersistenceException If a database error occurs or if the group can not be found */ - public void updateGroup(OnapPDPGroup group, String requestType, String userId) throws PolicyDBException; + public void updateGroup(OnapPDPGroup group, String requestType, String userId) throws PolicyDbException; /** - * Updates a PDP in the database with new information + * Updates a PDP in the database with new information. * * @param pdp The PDP to update * @param username Username of the user performing the operation @@ -109,7 +109,7 @@ public interface PolicyDBDaoTransaction { * @throws IllegalStateException If a transaction is already open * @throws PersistenceException If a database error occurs or if the pdp can not be found */ - public void updatePdp(OnapPDP pdp, String username) throws PolicyDBException; + public void updatePdp(OnapPDP pdp, String username) throws PolicyDbException; /** * Change the default group in the database to the group provided. @@ -120,7 +120,7 @@ public interface PolicyDBDaoTransaction { * @throws IllegalStateException If a transaction is already open * @throws PersistenceException If a database error occurs */ - public void changeDefaultGroup(OnapPDPGroup group, String username) throws PolicyDBException; + public void changeDefaultGroup(OnapPDPGroup group, String username) throws PolicyDbException; /** * Moves a PDP to a new group. @@ -132,40 +132,37 @@ public interface PolicyDBDaoTransaction { * @throws IllegalStateException If a transaction is already open * @throws PersistenceException If a database error occurs */ - public void movePdp(OnapPDP pdp, OnapPDPGroup group, String username) throws PolicyDBException; + public void movePdp(OnapPDP pdp, OnapPDPGroup group, String username) throws PolicyDbException; /** - * Add a new PDP to an existing group + * Add a new PDP to an existing group. * * @param pdpID The ID to name the new PDP * @param groupID The ID of the existing group to add the PDP to * @param pdpName The name to use for the new PDP * @param pdpDescription Description of the new PDP (optional) - * @param pdpJmxPort + * @param pdpJmxPort PDP JMX port * @param username Username of the user performing the operation * @throws IllegalArgumentException If non-optional parameters are null or empty strings * @throws IllegalStateException If a transaction is already open * @throws PersistenceException If a database error occurs */ public void addPdpToGroup(String pdpID, String groupID, String pdpName, String pdpDescription, int pdpJmxPort, - String username) throws PolicyDBException; + String username) throws PolicyDbException; /** - * Add an existing policy to an existing group + * Add an existing policy to an existing group. * * @param group The ID of the existing group to add the policy to * @param policyID The ID of an existing policy - * @return - * @throws IllegalArgumentException If non-optional parameters are null or empty strings - * @throws IllegalStateException If a transaction is already open - * @throws PersistenceException If a database error occurs - * @throws PolicyDBException + * @return the PDP groups + * @throws PolicyDbException on DB exceptions */ public StdPDPGroup addPolicyToGroup(String group, String policyID, String requestType, String username) - throws PolicyDBException; + throws PolicyDbException; /** - * Delete an existing PDP groupPolicyDBException + * Delete an existing PDP groupPolicyDBException. * * @param group A PDPGroup object representing the group to delete * @param moveToGroup A PDPGroup object representing another existing group which PDPs in the group being deleted @@ -175,7 +172,7 @@ public interface PolicyDBDaoTransaction { * @throws PersistenceException If a database error occurs * @throws PAPException If an error relating to how groups are handled occurs */ - public void deleteGroup(OnapPDPGroup group, OnapPDPGroup moveToGroup, String username) throws PolicyDBException; + public void deleteGroup(OnapPDPGroup group, OnapPDPGroup moveToGroup, String username) throws PolicyDbException; /** * Removes an existing PDP from its group and deletes it. @@ -185,7 +182,7 @@ public interface PolicyDBDaoTransaction { * @throws IllegalStateException If a transaction is already open * @throws PersistenceException If a database error occurs */ - public void removePdpFromGroup(String pdpID, String username) throws PolicyDBException; + public void removePdpFromGroup(String pdpID, String username) throws PolicyDbException; public GroupEntity getGroup(long groupKey);