ponderEnforcement.policyService
Interface LocalPolicyServiceI

All Known Implementing Classes:
LocalPolicyService

public interface LocalPolicyServiceI

Function: The part of the PolicyService which runs locally on the host where the other components of the system run.


Method Summary
 UserProfileObject activateRoleForUser(java.lang.String urd, java.lang.String role, UserProfileObject upo)
          Activate the given role for the User
 UserProfileObject assignRoleForUser(java.lang.String urd, java.lang.String role, java.lang.String pmcName, UserProfileObject upo)
          Assign the selected role for the User UPO
 UserProfileObject assignUserToDomain(java.lang.String urd, java.lang.String pmcName, java.lang.String domain, UserProfileObject upo)
          Assign the given user to a domain - copy the selected PMC to the selected domain 1.
 void connectToPolicyService()
          Connect to default Policy Service
 void connectToPolicyService(java.lang.String polServiceObjectName)
          Connect to given Policy Service
 void copyCompPolTypeEntries(java.lang.String typeName, java.lang.String typePath, java.lang.String name, java.lang.String domain)
          Copy the sub-entries (sub-policies) of the given composite policy type to the composite policy entry (which is an instantiation of the composite policy type)
 void createCompPolEntry(java.lang.String domain, java.lang.String name, int type, boolean isType, CompositePolicyEntry compPolEntry)
          Create an Entry in the Directory for a Composite Policy
 UserProfileObject createNewUser(java.lang.String urd, java.lang.String userId, java.lang.String userName)
          Create New User 1.
 UserProfileObject createPMCForUser(java.lang.String urd, java.lang.String pmcName, UserProfileObject upo)
          Create a New (Default) PMC for the given user 1.
 UserProfileObject deactivateRoleForUser(java.lang.String urd, java.lang.String role, UserProfileObject upo)
          Deactivate the given role for the User
 UserProfileObject deletePMCForUser(java.lang.String urd, java.lang.String selectedPmc, UserProfileObject upo)
          Delete the given PMC from the URD of the user Get all the Domains to which the PMC is assigned from the UPO, and unbind them too
 CompositePolicyEntry getCompPolEntry(java.lang.String policyName, java.lang.String domain)
           
 ControlObject getControlObject(java.lang.String policyDn)
          Return the ControlObject for the given Policy Object name.
 PolicyEntry getPolicyEntry(java.lang.String policyDN)
           
 PolicyEntry getPolicyEntry(java.lang.String policyName, java.lang.String domain)
           
 UserProfileObject removeRoleFromUser(java.lang.String urd, java.lang.String role, UserProfileObject upo)
          Remove the selected role from the User UPO
 UserProfileObject removeUserFromDomain(java.lang.String urd, java.lang.String domain, UserProfileObject upo)
          Remove the given user from a domain 1.
 java.lang.String retrievePolicy(java.lang.String policyName, java.lang.String domain)
          Retrieves the policy object given the name and the domain path of the policy.
 BasicPolControlObject startPolicy(java.lang.String policyName, java.lang.String domain)
          Start a Policy Instance.
 RoleControlObject startRole(java.lang.String roleName, java.lang.String domain)
          Start a Role Instance.
 void stopPolicy(java.lang.String polDomainName)
          Stop a Policy - Delete the ControlObject that represents it.
 void storePolicy(PolicyEntry policyEntry, java.lang.String name, java.lang.String domain)
          Store the PolicyEntry object in the directory.
 

Method Detail

storePolicy

public void storePolicy(PolicyEntry policyEntry,
                        java.lang.String name,
                        java.lang.String domain)
                 throws java.lang.Exception
Store the PolicyEntry object in the directory. It accepts as a parameter the PolicyEntry to store, the name and domain path of the policy

retrievePolicy

public java.lang.String retrievePolicy(java.lang.String policyName,
                                       java.lang.String domain)
                                throws java.lang.Exception
Retrieves the policy object given the name and the domain path of the policy. Returns the Source text of the policy object

getPolicyEntry

public PolicyEntry getPolicyEntry(java.lang.String policyName,
                                  java.lang.String domain)
                           throws java.lang.Exception
Parameters:
policyName - The name of the policy to look for
domain - The domain where the policy is stored
Returns:
The PolicyEntry stored for the given policy in the given domain. Throws an Exception if the policy is not found

getPolicyEntry

public PolicyEntry getPolicyEntry(java.lang.String policyDN)
                           throws java.lang.Exception
Parameters:
policyDN - The distinguished name (ldap name) of the policy object to retrieve
Returns:
The PolicyEntry stored for the given policy DN. Throws an Exception if the policy is not found

startPolicy

public BasicPolControlObject startPolicy(java.lang.String policyName,
                                         java.lang.String domain)
                                  throws java.lang.Exception
Start a Policy Instance. Forwards the request to the remote (central) policy service running at the directory host

startRole

public RoleControlObject startRole(java.lang.String roleName,
                                   java.lang.String domain)
                            throws java.lang.Exception
Start a Role Instance.
Parameters:
roleName - The name of the role
domain - The domain path of the role
Returns:
a RoleControlObject

stopPolicy

public void stopPolicy(java.lang.String polDomainName)
                throws java.lang.Exception
Stop a Policy - Delete the ControlObject that represents it. Forwards the request to the remote (central) policy service running at the directory host

getControlObject

public ControlObject getControlObject(java.lang.String policyDn)
                               throws java.lang.Exception
Return the ControlObject for the given Policy Object name.
Parameters:
policyDn - The Distinguished Name of the policy we are interested in
Returns:
The ControlObject for the given policyDn. Null if the policy is not started yet

createCompPolEntry

public void createCompPolEntry(java.lang.String domain,
                               java.lang.String name,
                               int type,
                               boolean isType,
                               CompositePolicyEntry compPolEntry)
                        throws java.lang.Exception
Create an Entry in the Directory for a Composite Policy
Parameters:
domain - The domain in which to create the entry
name - The name of the entry to create
type - The type of the entry to create (from ponderCompiler.codeGen.interfaces.CompositePolicyI)
isType - If true it means the policy is a type. False means it is not
compPolEntry - The composite policy entry to store

getCompPolEntry

public CompositePolicyEntry getCompPolEntry(java.lang.String policyName,
                                            java.lang.String domain)
                                     throws java.lang.Exception
Parameters:
policyName - The name of the composite policy to look for
domain - The domain where the policy is stored
Returns:
The CompositePolicyEntry stored for the given policy in the given domain. Throws an Exception if the policy is not found

copyCompPolTypeEntries

public void copyCompPolTypeEntries(java.lang.String typeName,
                                   java.lang.String typePath,
                                   java.lang.String name,
                                   java.lang.String domain)
Copy the sub-entries (sub-policies) of the given composite policy type to the composite policy entry (which is an instantiation of the composite policy type)
Parameters:
typeName - The name of the type composite policy entry
typePath - The domain path of the type composite policy entry
name - The name of the inst composite policy entry
domain - The domain path of the inst composite policy entry

createNewUser

public UserProfileObject createNewUser(java.lang.String urd,
                                       java.lang.String userId,
                                       java.lang.String userName)
                                throws java.lang.Exception
Create New User 1. Create the URD 2. Create a UPO and add it to the URD
Parameters:
urd - The URD to create
userId - The id of the user
userName - The name of the new user
Returns:
the created UPO

assignUserToDomain

public UserProfileObject assignUserToDomain(java.lang.String urd,
                                            java.lang.String pmcName,
                                            java.lang.String domain,
                                            UserProfileObject upo)
                                     throws java.lang.Exception
Assign the given user to a domain - copy the selected PMC to the selected domain 1. Read PMC entry from the URD 2. Create an 'objectReference' which links the new PMC to the original PMC
Parameters:
urd - The User Representation Domain
pmcName - The PMC in the URD to assign to the domain
domain - The domain to assign the user to
upo - The User Profile Object to which to assign the role If null, then it is retrieved from the directory
Returns:
The updated UserProfileObject

removeUserFromDomain

public UserProfileObject removeUserFromDomain(java.lang.String urd,
                                              java.lang.String domain,
                                              UserProfileObject upo)
                                       throws java.lang.Exception
Remove the given user from a domain 1. Read UPO entry from the URD 2. Update the UPO 3. Delete the objectReferences from that domain
Parameters:
urd - The User Representation Domain
domain - The domain to assign the user to
upo - The User Profile Object to which to assign the role If null, then it is retrieved from the directory
Returns:
The updated UserProfileObject

createPMCForUser

public UserProfileObject createPMCForUser(java.lang.String urd,
                                          java.lang.String pmcName,
                                          UserProfileObject upo)
                                   throws java.lang.Exception
Create a New (Default) PMC for the given user 1. Create a PMC and add it to the URD of the user
Parameters:
urd - The User Representation Domain
domain - The domain to assign the user to
upo - The User Profile Object to which to assign the role If null, then it is retrieved from the directory
Returns:
The updated UserProfileObject

deletePMCForUser

public UserProfileObject deletePMCForUser(java.lang.String urd,
                                          java.lang.String selectedPmc,
                                          UserProfileObject upo)
                                   throws java.lang.Exception
Delete the given PMC from the URD of the user Get all the Domains to which the PMC is assigned from the UPO, and unbind them too
Parameters:
urd - The User Representation Domain
selectedPMC - The PMC to delete
upo - The User Profile Object to which to assign the role If null, then it is retrieved from the directory
Returns:
The updated UserProfileObject

assignRoleForUser

public UserProfileObject assignRoleForUser(java.lang.String urd,
                                           java.lang.String role,
                                           java.lang.String pmcName,
                                           UserProfileObject upo)
                                    throws javax.naming.NamingException
Assign the selected role for the User UPO
Parameters:
urd - The full path for the URD of the user
role - The name of the role (full domain path) to assign
pmcName - The name of the PMC to associate with the role
upo - The User Profile Object from which to remove the role If null, then it is retrieved from the directory
Returns:
The updated User Profile Object

removeRoleFromUser

public UserProfileObject removeRoleFromUser(java.lang.String urd,
                                            java.lang.String role,
                                            UserProfileObject upo)
                                     throws javax.naming.NamingException,
                                            java.lang.Exception
Remove the selected role from the User UPO
Parameters:
urd - The full path for the URD of the user
role - The name of the role (full domain path) to remove
upo - The User Profile Object from which to remove the role If null, then it is retrieved from the directory
Returns:
The updated User Profile Object

activateRoleForUser

public UserProfileObject activateRoleForUser(java.lang.String urd,
                                             java.lang.String role,
                                             UserProfileObject upo)
                                      throws javax.naming.NamingException,
                                             java.lang.Exception
Activate the given role for the User
Parameters:
urd - The full path for the URD of the user
role - The name of the role (full domain path) to activate
upo - The User Profile Object for which to activate the role If null, then it is retrieved from the directory
Returns:
The updated User Profile Object

deactivateRoleForUser

public UserProfileObject deactivateRoleForUser(java.lang.String urd,
                                               java.lang.String role,
                                               UserProfileObject upo)
                                        throws javax.naming.NamingException,
                                               java.lang.Exception
Deactivate the given role for the User
Parameters:
urd - The full path for the URD of the user
role - The name of the role (full domain path) to deactivate
upo - The User Profile Object for which to deactivate the role If null, then it is retrieved from the directory
Returns:
The updated User Profile Object

connectToPolicyService

public void connectToPolicyService(java.lang.String polServiceObjectName)
                            throws java.lang.Exception
Connect to given Policy Service
Parameters:
polServiceObjectName - The remote object name for the Policy Server

connectToPolicyService

public void connectToPolicyService()
                            throws java.lang.Exception
Connect to default Policy Service