|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface PDP
The PDP decides whether a given operation is allowed on a given resource. If allowed, the resource is locked and the current state of the resource returned. When the service has finished working on the resource, it uses the PDP to unlock it.
| Field Summary | |
|---|---|
static String |
DESTROYED_STATE
If a resource is unlocked while in this state, it is destroyed (removed from the PBAC system). |
static String |
GROUP_MEMBER_ROLE
As an alternative to checking certificates, a MatchRule can test whether the subject has this role in some other resource. |
static String |
UNINITIALISED_STATE
When a new process is created, it is locked and in this state. |
| Method Summary | |
|---|---|
void |
addPolicyRule(String resourceID,
PolicyRule rule)
Add a new rule for a resource. |
void |
check(String resourceID,
SubjectDescription subjectDesc,
String action)
Checks if the request is granted. |
void |
deployPolicy(String resourceTypeID,
String policyClassName,
String modelData,
String defaultVersion)
Deploy a new resource type. |
String[] |
getAvailableSignals(String resourceID)
List the signals available given the current state of the resource. |
String |
getDefaultVersion(String resourceTypeID)
Get the service's default policy version at the time this policy was deployed. |
String[] |
getDeployedPolicies()
List the policies currently deployed. |
boolean |
getHasRole(String resourceID,
SubjectDescription subjectDesc,
String role)
Check whether the given subject has the named role in 'resourceID'. |
PolicyRule[] |
getPolicyRules(String resourceID,
String processRole)
Get the list of rules for membership of the given role. |
String[] |
getProcessRolesForSubject(String resourceID,
SubjectDescription subjectDesc)
Get the list of roles of which this subject is a member. |
String |
getProcessState(String resourceID)
Return the current process state of a resource. |
String[] |
getResources(String resourceTypeID,
SubjectDescription subjectDesc,
String processState)
Get the list of resources in which the given subject has membership of some role. |
String |
getResourceStatusMessage(String resourceID)
Used for the admin interface only. |
String |
getResourceType(String resourceID)
Get the type of a resource. |
String |
getStaticPolicy(String resourceTypeID)
Returns the modelData previously set using deployPolicy. |
String[] |
getValidProcessRoles(String resourceTypeID)
List the valid process roles for this model. |
String |
getVersion()
Returns the version of PBAC being used. |
String |
lockAndCheck(String resourceID,
SubjectDescription subjectDesc,
String action)
Locks the resource and checks if the request is granted. |
String |
lockForAdmin(String resourceID,
String action)
Like lockAndCheck, but without the check. |
void |
newProcess(String resourceTypeID,
String resourceID)
Creates a new process for a given resource. |
void |
removePolicyRule(String resourceID,
PolicyRule rule)
Remove a rule from a resource. |
String |
signal(String resourceID,
String event)
Signal an event on the resource. |
void |
undeployPolicy(String resourceTypeID)
Undeploy a policy. |
String |
unlock(String resourceID)
Unlocks a resource. |
| Field Detail |
|---|
static final String UNINITIALISED_STATE
static final String DESTROYED_STATE
static final String GROUP_MEMBER_ROLE
| Method Detail |
|---|
String lockAndCheck(String resourceID,
SubjectDescription subjectDesc,
String action)
throws AcquireResourceLockTimeoutException,
InvalidResourceIDException,
NotAuthorisedException,
ActionCurrentlyUnavailableException,
InvalidActionException,
InvalidSubjectDescriptorException,
ResourceTypeNotDeployedException
resourceID - the resource in questionsubjectDesc - the subject's descriptionaction - the requested action
InvalidActionException - if the action is not valid
AcquireResourceLockTimeoutException - if we cant get exclusive
access to the resource in the timeout period
InvalidSubjectDescriptorException - if the subject descriptor is invalid
InvalidResourceIDException - if the resource ID is not recognised
NotAuthorisedException - if the user is not authorised on the action in the resource
ResourceTypeNotDeployedException - if the resource's type is no longer valid (undeployed)
ActionCurrentlyUnavailableException - if the user is
authorised to execute the action on the resource but can't right now
void check(String resourceID,
SubjectDescription subjectDesc,
String action)
throws InvalidResourceIDException,
ResourceNotLockedException,
NotAuthorisedException,
ActionCurrentlyUnavailableException,
InvalidActionException,
InvalidSubjectDescriptorException
resourceID - the resource in questionsubjectDesc - the subject's descriptionaction - the requested action
InvalidActionException - if the action is not valid
InvalidSubjectDescriptorException - if the subject descriptor is invalid
InvalidResourceIDException - if the resource ID is not recognised
ResourceNotLockedException - if the resource is not locked
NotAuthorisedException - if the user is not authorised on the action in the resource
ActionCurrentlyUnavailableException - if the user is
authorised to execute the action on the resource but can't right now
String lockForAdmin(String resourceID,
String action)
throws AcquireResourceLockTimeoutException,
InvalidResourceIDException,
ResourceTypeNotDeployedException
resourceID - the resource to lockaction - the action which requires the resource to be locked
AcquireResourceLockTimeoutException
InvalidResourceIDException
ResourceTypeNotDeployedException
String signal(String resourceID,
String event)
throws EventCurrentlyUnavailableException,
InvalidResourceIDException,
InvalidEventException,
ResourceNotLockedException
resourceID - the resource in questionevent - the event causing the transition
InvalidEventException - if the event is not valid
according to the service policy
EventCurrentlyUnavailableException - if the event is
not available in the current state
InvalidResourceIDException - if the resource ID is not recognised
ResourceNotLockedException - if the resource is not locked
String[] getAvailableSignals(String resourceID)
throws InvalidResourceIDException
resourceID - the resource in question
InvalidResourceIDException - if the resource ID is not recognised
String unlock(String resourceID)
throws InvalidResourceIDException,
ResourceNotLockedException
resourceID - the resource in question
InvalidResourceIDException - if the resource ID is not recognised
ResourceNotLockedException - if the resource is not locked
String getProcessState(String resourceID)
throws InvalidResourceIDException
InvalidResourceIDException
void addPolicyRule(String resourceID,
PolicyRule rule)
throws InvalidResourceIDException,
InvalidPolicyRuleException,
ResourceNotLockedException
resourceID - the resource being protectedrule - the rule to add
InvalidResourceIDException
InvalidPolicyRuleException
ResourceNotLockedException
void removePolicyRule(String resourceID,
PolicyRule rule)
throws InvalidResourceIDException,
InvalidPolicyRuleException,
PolicyRuleNotFoundException,
ResourceNotLockedException
resourceID - the resource being protectedrule - the rule to remove
InvalidResourceIDException
InvalidPolicyRuleException
PolicyRuleNotFoundException
ResourceNotLockedException
void newProcess(String resourceTypeID,
String resourceID)
throws ResourceIDAlreadyExistsException,
ResourceTypeNotDeployedException
resourceTypeID - the resource's typeresourceID - the resource ID (must not already have a PBAC process)
ResourceIDAlreadyExistsException - if the resource is already managed by PBAC
ResourceTypeNotDeployedException - if the resourceTypeID is not currently deployed
String getResourceType(String resourceID)
throws InvalidResourceIDException
resourceID - the resource to check
InvalidResourceIDException - if the resource does not exist
PolicyRule[] getPolicyRules(String resourceID,
String processRole)
throws InvalidResourceIDException,
ResourceNotLockedException
resourceID - the resource being protectedprocessRole - the role being queried, or null for all
The resource does not need to be locked to use this call. However, if it
is not locked then the status may change at any time, so the result should
only be used for informational purposes.
InvalidResourceIDException
ResourceNotLockedException
String[] getResources(String resourceTypeID,
SubjectDescription subjectDesc,
String processState)
throws ResourceTypeNotDeployedException,
InvalidSubjectDescriptorException,
InvalidStateException
resourceTypeID - the type of resource to matchsubjectDesc - the user to query on, or null for all resourcesprocessState - the state the resource must be in, or null to match all states
ResourceTypeNotDeployedException
InvalidSubjectDescriptorException
InvalidStateException
String[] getProcessRolesForSubject(String resourceID,
SubjectDescription subjectDesc)
throws InvalidResourceIDException,
ResourceNotLockedException,
InvalidSubjectDescriptorException
resourceID - the resource being protectedsubjectDesc - the user to query on
InvalidResourceIDException
ResourceNotLockedException
InvalidSubjectDescriptorException
boolean getHasRole(String resourceID,
SubjectDescription subjectDesc,
String role)
throws InvalidResourceIDException,
ResourceNotLockedException,
InvalidSubjectDescriptorException
InvalidResourceIDException
ResourceNotLockedException
InvalidSubjectDescriptorException
void deployPolicy(String resourceTypeID,
String policyClassName,
String modelData,
String defaultVersion)
throws ResourceTypeAlreadyDeployedException
resourceTypeID - the name of the typepolicyClassName - the Java class to handle the type (implements ServicePolicy)modelData - data to pass to the service policy constructordefaultVersion - the version of the default policy for this version of the service
ResourceTypeAlreadyDeployedException - if the type is already deployed
void undeployPolicy(String resourceTypeID)
throws ResourceTypeNotDeployedException,
AcquireResourceLockTimeoutException
resourceTypeID - the type to undeploy
ResourceTypeNotDeployedException - if the resource type is not currently deployed
AcquireResourceLockTimeoutException - if some resources of this type are still locked
String getStaticPolicy(String resourceTypeID)
throws ResourceTypeNotDeployedException
ResourceTypeNotDeployedException - if these resource type is not currently deployedString[] getDeployedPolicies()
String[] getValidProcessRoles(String resourceTypeID)
throws ResourceTypeNotDeployedException
ResourceTypeNotDeployedExceptionString getVersion()
String getDefaultVersion(String resourceTypeID)
throws ResourceTypeNotDeployedException
resourceTypeID - the type to check
deployPolicy(java.lang.String, java.lang.String, java.lang.String, java.lang.String) when the policy was deployed
ResourceTypeNotDeployedException - if this type isn't deployed
String getResourceStatusMessage(String resourceID)
throws InvalidResourceIDException
InvalidResourceIDExceptiongetProcessState(java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||