public interface PolicyDBDaoTransaction
Modifier and Type | Method and Description |
---|---|
void |
addPdpToGroup(String pdpID,
String groupID,
String pdpName,
String pdpDescription,
int pdpJmxPort,
String username)
Add a new PDP to an existing group
|
void |
addPolicyToGroup(String group,
String policyID,
String username)
Add an existing policy to an existing group
|
void |
changeDefaultGroup(org.openecomp.policy.xacml.api.pap.EcompPDPGroup group,
String username)
Change the default group in the database to the group provided.
|
void |
clonePolicy(String oldPolicyPath,
String newPolicyPath,
String username) |
void |
close()
Close the PolicyDBDaoTransaction without rolling back or doing anything.
|
void |
commitTransaction()
Commits (makes permanent) the current transaction.
|
void |
createGroup(String groupID,
String groupName,
String groupDescription,
String username)
Create a new PDP group in the database
|
void |
createPolicy(Policy policy,
String username)
Create or update a policy
|
void |
createPolicy(String filePath,
String username)
Create or update a policy
|
void |
deleteGroup(org.openecomp.policy.xacml.api.pap.EcompPDPGroup group,
org.openecomp.policy.xacml.api.pap.EcompPDPGroup moveToGroup,
String username)
Delete an existing PDP group
|
void |
deletePolicy(String policyToDelete)
Delete an existing policy
|
org.openecomp.policy.rest.jpa.GroupEntity |
getGroup(long groupKey) |
org.openecomp.policy.rest.jpa.GroupEntity |
getGroup(String groupId) |
org.openecomp.policy.rest.jpa.PdpEntity |
getPdp(long pdpKey) |
List<?> |
getPdpsInGroup(long groupKey) |
boolean |
isTransactionOpen()
Check if the PolicyDBDaoTransaction is currently open
|
void |
movePdp(org.openecomp.policy.xacml.api.pap.EcompPDP pdp,
org.openecomp.policy.xacml.api.pap.EcompPDPGroup group,
String username)
Moves a PDP to a new group.
|
void |
removePdpFromGroup(String pdpID,
String username)
Removes an existing PDP from its group and deletes it.
|
void |
renamePolicy(String oldPath,
String newPath,
String username) |
void |
rollbackTransaction()
Rollback (undo) the current transaction.
|
void |
updateGroup(org.openecomp.policy.xacml.api.pap.EcompPDPGroup group,
String username)
Updates a group in the database with a new name of description
|
void |
updatePdp(org.openecomp.policy.xacml.api.pap.EcompPDP pdp,
String username)
Updates a PDP in the database with new information
|
void commitTransaction()
IllegalStateException
- if the PolicyDBDao transaction has not been used or has been committed already.javax.persistence.PersistenceException
- if the commit fails for some reasonvoid createPolicy(Policy policy, String username) throws IllegalStateException, javax.persistence.PersistenceException, IllegalArgumentException
policy
- A Policy object representing the policy to store or updateusername
- A string of the username you want to be stored for doing this operationIllegalStateException
- If a transaction is open that has not yet been committedjavax.persistence.PersistenceException
- If a database error occursIllegalArgumentException
- If the Policy's PolicyRestAdapter contains incorrect data.void createPolicy(String filePath, String username) throws IllegalStateException, javax.persistence.PersistenceException, IllegalArgumentException
filePath
- The file path of the policy xml fileusername
- A string of the username you want to be stored for doing this operationIllegalStateException
- If a transaction is open that has not yet been committedjavax.persistence.PersistenceException
- If a database error occursIllegalArgumentException
- If the file path is incorrect, or if it refers to a Config policyboolean isTransactionOpen()
void deletePolicy(String policyToDelete) throws IllegalStateException, javax.persistence.PersistenceException, IllegalArgumentException
policyToDelete
- The file path of the policy to deleteIllegalArgumentException
- If the file path given can not be parsedIllegalStateException
- If a transaction is open that has not yet been committedjavax.persistence.PersistenceException
- If a database error occursvoid rollbackTransaction()
void close()
void createGroup(String groupID, String groupName, String groupDescription, String username) throws IllegalArgumentException, IllegalStateException, javax.persistence.PersistenceException
groupID
- The ID to name the new group (use PolicyDBDao.createNewPDPGroupId)groupName
- The name to use for the new groupgroupDescription
- Description of the new group (optional)username
- Username of the user performing the operationIllegalArgumentException
- If non-optional parameters are null or empty stringsIllegalStateException
- If a transaction is already openjavax.persistence.PersistenceException
- If a database error occursvoid updateGroup(org.openecomp.policy.xacml.api.pap.EcompPDPGroup group, String username) throws IllegalArgumentException, IllegalStateException, javax.persistence.PersistenceException
group
- The group with updated information. The id must match an existing group, but the name and description can be changed.username
- Username of the user performing the operationIllegalArgumentException
- If non-optional parameters are null or empty stringsIllegalStateException
- If a transaction is already openjavax.persistence.PersistenceException
- If a database error occurs or if the group can not be foundvoid updatePdp(org.openecomp.policy.xacml.api.pap.EcompPDP pdp, String username) throws IllegalArgumentException, IllegalStateException, javax.persistence.PersistenceException
pdp
- The PDP to updateusername
- Username of the user performing the operationIllegalArgumentException
- If non-optional parameters are null or empty stringsIllegalStateException
- If a transaction is already openjavax.persistence.PersistenceException
- If a database error occurs or if the pdp can not be foundvoid changeDefaultGroup(org.openecomp.policy.xacml.api.pap.EcompPDPGroup group, String username) throws IllegalArgumentException, IllegalStateException, javax.persistence.PersistenceException
group
- The new group which should be set as default in the databaseusername
- Username of the user performing the operationIllegalArgumentException
- If non-optional parameters are null or empty stringsIllegalStateException
- If a transaction is already openjavax.persistence.PersistenceException
- If a database error occursvoid movePdp(org.openecomp.policy.xacml.api.pap.EcompPDP pdp, org.openecomp.policy.xacml.api.pap.EcompPDPGroup group, String username) throws IllegalArgumentException, IllegalStateException, javax.persistence.PersistenceException
pdp
- The PDP which is to be moved to a new groupgroup
- The new group which the PDP should be added tousername
- Username of the user performing the operationIllegalArgumentException
- If non-optional parameters are null or empty stringsIllegalStateException
- If a transaction is already openjavax.persistence.PersistenceException
- If a database error occursvoid addPdpToGroup(String pdpID, String groupID, String pdpName, String pdpDescription, int pdpJmxPort, String username) throws IllegalArgumentException, IllegalStateException, javax.persistence.PersistenceException
pdpID
- The ID to name the new PDPgroupID
- The ID of the existing group to add the PDP topdpName
- The name to use for the new PDPpdpDescription
- Description of the new PDP (optional)pdpJmxPort
- username
- Username of the user performing the operationIllegalArgumentException
- If non-optional parameters are null or empty stringsIllegalStateException
- If a transaction is already openjavax.persistence.PersistenceException
- If a database error occursvoid addPolicyToGroup(String group, String policyID, String username) throws IllegalArgumentException, IllegalStateException, javax.persistence.PersistenceException
group
- The ID of the existing group to add the policy topolicyID
- The ID of an existing policyIllegalArgumentException
- If non-optional parameters are null or empty stringsIllegalStateException
- If a transaction is already openjavax.persistence.PersistenceException
- If a database error occursvoid deleteGroup(org.openecomp.policy.xacml.api.pap.EcompPDPGroup group, org.openecomp.policy.xacml.api.pap.EcompPDPGroup moveToGroup, String username) throws IllegalArgumentException, IllegalStateException, javax.persistence.PersistenceException, com.att.research.xacml.api.pap.PAPException
group
- A PDPGroup object representing the group to deletemoveToGroup
- A PDPGroup object representing another existing group which PDPs in the group being deleted should be moved toIllegalArgumentException
- If non-optional parameters are null or empty stringsIllegalStateException
- If a transaction is already openjavax.persistence.PersistenceException
- If a database error occurscom.att.research.xacml.api.pap.PAPException
- If an error relating to how groups are handled occursvoid removePdpFromGroup(String pdpID, String username) throws IllegalArgumentException, IllegalStateException, javax.persistence.PersistenceException
pdpID
- The ID of the existing PDP which should be deletedIllegalArgumentException
- If non-optional parameters are null or empty stringsIllegalStateException
- If a transaction is already openjavax.persistence.PersistenceException
- If a database error occursorg.openecomp.policy.rest.jpa.GroupEntity getGroup(long groupKey)
org.openecomp.policy.rest.jpa.GroupEntity getGroup(String groupId)
List<?> getPdpsInGroup(long groupKey)
org.openecomp.policy.rest.jpa.PdpEntity getPdp(long pdpKey)
Copyright © 2018. All rights reserved.