import javax.persistence.PersistenceException;
+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;
import com.att.research.xacml.api.pap.PAPException;
* @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 IllegalStateException, PersistenceException, IllegalArgumentException;
+ public void createPolicy(Policy policy, String username) throws PolicyDBException;
/**
* Check if the PolicyDBDaoTransaction is currently open
*/
public boolean isTransactionOpen();
-
-
- /**
- * Delete an existing policy
- * @param policyToDelete The file path of the policy to delete
- * @throws IllegalArgumentException If the file path given can not be parsed
- * @throws IllegalStateException If a transaction is open that has not yet been committed
- * @throws PersistenceException If a database error occurs
- */
- public void deletePolicy(String policyToDelete) throws IllegalStateException, PersistenceException, IllegalArgumentException;
-
/**
* Rollback (undo) the current transaction.
*/
* @throws IllegalStateException If a transaction is already open
* @throws PersistenceException If a database error occurs
*/
- public void createGroup(String groupID, String groupName, String groupDescription, String username) throws IllegalArgumentException, IllegalStateException, PersistenceException;
+ public void createGroup(String groupID, String groupName, String groupDescription, String username) throws PolicyDBException;
/**
* Updates a group in the database with a new name of description
* @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 username) throws IllegalArgumentException, IllegalStateException, PersistenceException;
+ public void updateGroup(OnapPDPGroup group, String username) throws PolicyDBException;
/**
* Updates a PDP in the database with new information
* @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 IllegalArgumentException, IllegalStateException, PersistenceException;
+ public void updatePdp(OnapPDP pdp, String username) throws PolicyDBException;
/**
* Change the default group in the database to the group provided.
* @throws IllegalStateException If a transaction is already open
* @throws PersistenceException If a database error occurs
*/
- public void changeDefaultGroup(OnapPDPGroup group, String username) throws IllegalArgumentException, IllegalStateException, PersistenceException;
+ public void changeDefaultGroup(OnapPDPGroup group, String username) throws PolicyDBException;
/**
* Moves a PDP to a new group.
* @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 IllegalArgumentException, IllegalStateException, PersistenceException;
+ public void movePdp(OnapPDP pdp, OnapPDPGroup group, String username) throws PolicyDBException;
/**
* Add a new PDP to an existing group
* @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 IllegalArgumentException, IllegalStateException, PersistenceException;
+ 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
* @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
*/
- public void addPolicyToGroup(String group, String policyID, String username) throws IllegalArgumentException, IllegalStateException, PersistenceException;
+ public StdPDPGroup addPolicyToGroup(String group, String policyID, String username) throws PolicyDBException;
/**
- * Delete an existing PDP group
+ * 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
* @throws IllegalArgumentException If non-optional parameters are null or empty strings
* @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 IllegalArgumentException, IllegalStateException, PersistenceException, PAPException;
+ public void deleteGroup(OnapPDPGroup group, OnapPDPGroup moveToGroup, String username)throws PolicyDBException;
/**
* Removes an existing PDP from its group and deletes it.
* @throws IllegalStateException If a transaction is already open
* @throws PersistenceException If a database error occurs
*/
- public void removePdpFromGroup(String pdpID, String username) throws IllegalArgumentException, IllegalStateException, PersistenceException;
+ 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);
-
- void renamePolicy(String oldPath, String newPath,String username);
-
- void clonePolicy(String oldPolicyPath, String newPolicyPath, String username);
-
}