org.safehaus.triplesec.guardian
Interface ApplicationPolicy


public interface ApplicationPolicy

The policy store for an application whose access policy is managed by Triplesec.

Version:
$Rev: 72 $, $Date: 2005-11-07 21:37:46 -0500 (Mon, 07 Nov 2005) $
Author:
Alex Karasulu, Trustin Lee, Ersin Er

Method Summary
 boolean addPolicyListener(PolicyChangeListener listener)
          Adds a change listener so that it recieves policy change notifications.
 void close()
          Closes the application store.
 Profile getAdminProfile()
          Gets a profile for the admin user which is in all roles and has all permissions granted.
 java.lang.String getApplicationName()
          Gets the name uniquely identifying the applicaiton associated with this store.
 java.util.Set getDependentProfileNames(Permission permission)
          Gets the names of the profiles dependent on a permission.
 java.util.Set getDependentProfileNames(Role role)
          Gets the names of the profiles dependent on a role.
 java.lang.String getDescription()
          Gets a breif description of this ApplicationPolicy.
 Permissions getPermissions()
          Gets a set of Permissions defined for this store.
 Profile getProfile(java.lang.String profileId)
          Gets this user's authorization Profile for the application.
 java.util.Iterator getProfileIdIterator()
          Gets an iterator over the set of profiles in this ApplicationPolicy.
 Roles getRoles()
          Gets a set of Roles defined for this store.
 java.util.Set getUserProfileIds(java.lang.String userName)
          Gets the set of profiles a user has for this ApplicationPolicy.
 boolean removePolicyListener(PolicyChangeListener listener)
          Removes a change listener so that it does not recieve policy change notifications.
 

Method Detail

removePolicyListener

boolean removePolicyListener(PolicyChangeListener listener)
                             throws GuardianException
Removes a change listener so that it does not recieve policy change notifications.

Parameters:
listener - the listener to remove.
Throws:
GuardianException

addPolicyListener

boolean addPolicyListener(PolicyChangeListener listener)
                          throws GuardianException
Adds a change listener so that it recieves policy change notifications.

Parameters:
listener - the listener to add.
Throws:
GuardianException

getApplicationName

java.lang.String getApplicationName()
Gets the name uniquely identifying the applicaiton associated with this store.

Returns:
the name of this store

getRoles

Roles getRoles()
Gets a set of Roles defined for this store.

Returns:
a set of Roles defined for this store.

getPermissions

Permissions getPermissions()
Gets a set of Permissions defined for this store.

Returns:
a set of Permissions defined for this store.

getDependentProfileNames

java.util.Set getDependentProfileNames(Role role)
                                       throws GuardianException
Gets the names of the profiles dependent on a role. The set contains Strings of the profile name.

Parameters:
role - the role the dependent profiles are associated with
Returns:
the name's of profiles that depend on the supplied role
Throws:
GuardianException - if there is an error accessing the backing store or the role is not associated with this ApplicationPolicy

getDependentProfileNames

java.util.Set getDependentProfileNames(Permission permission)
                                       throws GuardianException
Gets the names of the profiles dependent on a permission. The set contains Strings of the profile names.

Parameters:
permission - the permission the dependent profiles are associated with
Returns:
the name's of profiles that depend on the supplied permission
Throws:
GuardianException - if there is an error accessing the backing store or the permission is not associated with this ApplicationPolicy

getUserProfileIds

java.util.Set getUserProfileIds(java.lang.String userName)
                                throws GuardianException
Gets the set of profiles a user has for this ApplicationPolicy.

Parameters:
userName - the name of the user to get the profile ids for
Returns:
a set of profile ids as Strings or the empty set if the userName is invalid or does not have profiles defined
Throws:
GuardianException - if there are errors accessing the backing store

getProfileIdIterator

java.util.Iterator getProfileIdIterator()
                                        throws GuardianException
Gets an iterator over the set of profiles in this ApplicationPolicy.

Returns:
an iterator over profileId Strings
Throws:
GuardianException - if there are errors accessing the backing store

getProfile

Profile getProfile(java.lang.String profileId)
                   throws GuardianException
Gets this user's authorization Profile for the application.

Parameters:
profileId - the name of the user to get the Profile for
Returns:
the Profile for the application or null if no profile exists for the specified profileId
Throws:
GuardianException

getAdminProfile

Profile getAdminProfile()
Gets a profile for the admin user which is in all roles and has all permissions granted.

Returns:
the admin user profile with all rights

getDescription

java.lang.String getDescription()
Gets a breif description of this ApplicationPolicy.

Returns:
a breif description of this ApplicationPolicy

close

void close()
           throws GuardianException
Closes the application store.

Throws:
GuardianException - if the store cannot be properly closed.