Skip navigation links


oracle.idm.provisioning.provpolicy
Class PolicyManager

java.lang.Object
  extended by oracle.idm.provisioning.provpolicy.PolicyManager


public class PolicyManager
extends java.lang.Object

Field Summary
static java.lang.String APPROVAL_POLICY
           

 

Constructor Summary
PolicyManager()
           

 

Method Summary
 void addTrustees(java.lang.String policyuid, IPolicyTrusteeCollection trustees)
          Adds trustees of a given trustee collection.
 java.lang.String createPolicy(java.lang.String resourceId, IPolicy policy, java.util.List trustees)
          Creates a given policy and all its trustees collections.
 void deletePolicy(IPolicy policy)
          Deletes a given policy and all its trustees collections.
 IPolicy getPolicy(java.lang.String id)
          Given a policy resource, gets all policies that are relevant.
 java.util.List getPolicyCollection(java.lang.String resourceId)
          Given a policy resource, gets all policies that are relevant.
 java.util.List getTrusteeCollection(java.lang.String policyid)
          Returns a list of TrusteeCollections.
 java.util.List getTrusteeCollectionByProperty(java.lang.String policyid, java.lang.String propname, java.lang.String val)
          Returns a list of TrusteeCollections for a given policy that has given property.
 void modifyPolicy(IPolicy policy)
          Modifies a given policy.
 void modifyTrustees(java.lang.String policyuid, IPolicyTrusteeCollection trustees)
          Modifies trustees of a given trustee collection.
 void setDirContext(javax.naming.directory.DirContext ctx)
          Sets the directory context for policy manager.
 void setOperationType(java.lang.String type)
          Sets the type of policies for which this PolicyManager instance may be used.
 void validatePolicy(IPolicy policy)
          Validates a given policy.
 void validateTrusteeCollection(java.util.List trustees)
          Validates a given trustee.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

APPROVAL_POLICY

public static java.lang.String APPROVAL_POLICY

Constructor Detail

PolicyManager

public PolicyManager()

Method Detail

setOperationType

public void setOperationType(java.lang.String type)
                      throws PolicyException
Sets the type of policies for which this PolicyManager instance may be used. I don't like this very much, I think each method in PolicyManager should take an operation type. However, DAS team has specifically asked for it, so providing it. Keep it or change it if necessary.
Parameters:
type - Operation/ policy type.
Throws:
PolicyException

setDirContext

public void setDirContext(javax.naming.directory.DirContext ctx)
Sets the directory context for policy manager. Policy manager does not open its own connection to the directory. This allows better connection management.
Parameters:
ctx - A valid directory context. This context is used to retrieve or store all information related to policies, so it should have necessary read and write permissions.

getPolicyCollection

public java.util.List getPolicyCollection(java.lang.String resourceId)
                                   throws PolicyException,
                                          javax.naming.NamingException
Given a policy resource, gets all policies that are relevant.
Parameters:
resourceId - Resource for which policies are needed. In case of APPROVAL_POLICY, resource is application type.
Returns:
List of policies if they exist. If no policies exist, an empty (non-null) list is returned.
Throws:
PolicyException
javax.naming.NamingException

getPolicy

public IPolicy getPolicy(java.lang.String id)
                  throws PolicyException,
                         javax.naming.NamingException
Given a policy resource, gets all policies that are relevant.
Parameters:
id - id, that is database key of the required policy.
Returns:
Policy if it exists, null otherwise.
Throws:
PolicyException
javax.naming.NamingException

getTrusteeCollection

public java.util.List getTrusteeCollection(java.lang.String policyid)
                                    throws PolicyException,
                                           javax.naming.NamingException
Returns a list of TrusteeCollections.
Parameters:
policyuid - id, that is database key of the policy for which trustee collections are required.
Returns:
List of TrusteeCollection objects for the given policy. If no TrusteeCollection objects exist, a non-null list is returned.
Throws:
PolicyException
javax.naming.NamingException

getTrusteeCollectionByProperty

public java.util.List getTrusteeCollectionByProperty(java.lang.String policyid,
                                                     java.lang.String propname,
                                                     java.lang.String val)
                                              throws PolicyException,
                                                     javax.naming.NamingException
Returns a list of TrusteeCollections for a given policy that has given property.
Parameters:
policyuid - id, that is database key of the policy for which trustee collections are required.
propname - Name of the property.
val - Value of the property.
Returns:
List of TrusteeCollection objects for the given policy that has given value for given property. If no TrusteeCollection object exists, a non-null list is returned.
Throws:
PolicyException
javax.naming.NamingException

modifyPolicy

public void modifyPolicy(IPolicy policy)
                  throws PolicyException,
                         javax.naming.NamingException
Modifies a given policy. Also manages data integrity wherever possible. Logic of this method is complicated. It first checks if anything in the policy is changing. If so, it propagates the change. Then it checks each and every trustee to see if the trustees changed. If so, it changes the trustees.
Parameters:
policy - Policy to be modified.
Throws:
PolicyException
javax.naming.NamingException

deletePolicy

public void deletePolicy(IPolicy policy)
                  throws PolicyException,
                         javax.naming.NamingException
Deletes a given policy and all its trustees collections. This method also ensures data integrity when the policy is deleted. For example, when an approval policy is deleted, all requests pending for that policy no longer require approval and are treated as "Approved".
Parameters:
policy - Policy to be deleted.
Throws:
PolicyException
javax.naming.NamingException

createPolicy

public java.lang.String createPolicy(java.lang.String resourceId,
                                     IPolicy policy,
                                     java.util.List trustees)
                              throws PolicyException,
                                     javax.naming.NamingException
Creates a given policy and all its trustees collections. For approval policies, this method does not evaluate impact on existing requests.
Parameters:
resourceId - Resource for which the policy is to be added.
policy - Policy to be added.
trustees - List of TrusteeCollections to be added.
Throws:
PolicyException
javax.naming.NamingException

modifyTrustees

public void modifyTrustees(java.lang.String policyuid,
                           IPolicyTrusteeCollection trustees)
                    throws PolicyException,
                           javax.naming.NamingException
Modifies trustees of a given trustee collection. Does not modify properties of a given collection. This is because the properties define a trusteeCollection's association with a policy. To modify collection properties, use modifyPolicy. Note that modify does a blanket replace of existing trustees.
Parameters:
policyuid - Datastore id of the policy whose trustees are to be modified.
trustees - TrusteeCollection that should be modified.
Throws:
PolicyException
javax.naming.NamingException

addTrustees

public void addTrustees(java.lang.String policyuid,
                        IPolicyTrusteeCollection trustees)
                 throws PolicyException,
                        javax.naming.NamingException
Adds trustees of a given trustee collection. If trustees with the given property already exist, throws a PolicyException. To add trustees to an existing TrusteeCollection, use modifyTrusteeCollection.
Parameters:
policyuid - Datastore id of the policy for which trustees are to be added.
trustees - TrusteeCollection that should be added.
Throws:
PolicyException
javax.naming.NamingException

validatePolicy

public void validatePolicy(IPolicy policy)
                    throws PolicyException
Validates a given policy. Throws a PolicyException in case any information is invalid.
Parameters:
policy - Policy to be validated.
Throws:
PolicyException

validateTrusteeCollection

public void validateTrusteeCollection(java.util.List trustees)
                               throws PolicyException
Validates a given trustee. Throws a PolicyException in case any information is invalid.
Parameters:
trustees - List of trustee collection to be validated.
Throws:
PolicyException

Skip navigation links