summaryrefslogtreecommitdiffstats
path: root/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDaoTransaction.java
diff options
context:
space:
mode:
Diffstat (limited to 'ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDaoTransaction.java')
-rw-r--r--ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDaoTransaction.java39
1 files changed, 27 insertions, 12 deletions
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
index 3cfe24524..dbb2fa830 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
@@ -33,17 +33,17 @@ import org.onap.policy.xacml.std.pap.StdPDPGroup;
public interface PolicyDBDaoTransaction {
/**
- * Commits (makes permanent) the current transaction. Also, notifies other PolicyDBDao instances
- * on other PAP servers of the update.
+ * Commits (makes permanent) the current transaction. Also, notifies other PolicyDBDao instances on other PAP
+ * servers of the update.
*
- * @throws IllegalStateException if the PolicyDBDao transaction has not been used or has been
- * committed already.
+ * @throws IllegalStateException if the PolicyDBDao transaction has not been used or has been committed already.
* @throws PersistenceException if the commit fails for some reason
*/
public void commitTransaction();
/**
* 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
* @throws IllegalStateException If a transaction is open that has not yet been committed
@@ -55,8 +55,7 @@ public interface PolicyDBDaoTransaction {
/**
* 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.
+ * @return False if the PolicyDBDao transaction has not been used or has been committed already, true if it is open.
*/
public boolean isTransactionOpen();
@@ -66,14 +65,15 @@ public interface PolicyDBDaoTransaction {
public void rollbackTransaction();
/**
- * Close the PolicyDBDaoTransaction without rolling back or doing anything. Just used to close
- * the Hibernate session.
+ * Close the PolicyDBDaoTransaction without rolling back or doing anything. Just used to close the Hibernate
+ * session.
*/
public void close();
/**
* 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
* @param groupDescription Description of the new group (optional)
@@ -87,16 +87,20 @@ public interface PolicyDBDaoTransaction {
/**
* 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 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 username) throws PolicyDBException;
+ public void updateGroup(OnapPDPGroup group, String requestType, String userId) throws PolicyDBException;
/**
* Updates a PDP in the database with new information
+ *
* @param pdp The PDP to update
* @param username Username of the user performing the operation
* @throws IllegalArgumentException If non-optional parameters are null or empty strings
@@ -107,6 +111,7 @@ public interface PolicyDBDaoTransaction {
/**
* Change the default group in the database to the group provided.
+ *
* @param group The new group which should be set as default in the database
* @param username Username of the user performing the operation
* @throws IllegalArgumentException If non-optional parameters are null or empty strings
@@ -117,6 +122,7 @@ public interface PolicyDBDaoTransaction {
/**
* Moves a PDP to a new group.
+ *
* @param pdp The PDP which is to be moved to a new group
* @param group The new group which the PDP should be added to
* @param username Username of the user performing the operation
@@ -128,6 +134,7 @@ public interface PolicyDBDaoTransaction {
/**
* 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
@@ -138,10 +145,12 @@ public interface PolicyDBDaoTransaction {
* @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;
+ public void addPdpToGroup(String pdpID, String groupID, String pdpName, String pdpDescription, int pdpJmxPort,
+ String username) throws PolicyDBException;
/**
* 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
@@ -156,8 +165,10 @@ public interface PolicyDBDaoTransaction {
/**
* 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 should be moved to
+ * @param moveToGroup A PDPGroup object representing another existing group which PDPs in the group being deleted
+ * should be moved to
* @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
@@ -167,6 +178,7 @@ public interface PolicyDBDaoTransaction {
/**
* Removes an existing PDP from its group and deletes it.
+ *
* @param pdpID The ID of the existing PDP which should be deleted
* @throws IllegalArgumentException If non-optional parameters are null or empty strings
* @throws IllegalStateException If a transaction is already open
@@ -175,7 +187,10 @@ public interface PolicyDBDaoTransaction {
public void removePdpFromGroup(String pdpID, String username) throws PolicyDBException;
public GroupEntity getGroup(long groupKey);
+
public GroupEntity getGroup(String groupId);
+
public List<?> getPdpsInGroup(long groupKey);
+
public PdpEntity getPdp(long pdpKey);
}