|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.ac.soton.itinnovation.grid.pbac2.pdp.dynamic.PDPImpl
public class PDPImpl
Policy Decision point implementation for PBAC2.
| Field Summary |
|---|
| Fields inherited from interface uk.ac.soton.itinnovation.grid.pbac2.pdp.PDP |
|---|
DESTROYED_STATE, GROUP_MEMBER_ROLE, UNINITIALISED_STATE |
| Constructor Summary | |
|---|---|
PDPImpl()
|
|
| Method Summary | |
|---|---|
void |
addAccessControlRule(String resourceID,
MatchRule rule)
Add a new match 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. |
MatchRule[] |
getAccessControlRules(String resourceID,
String processRole)
Get the list of rules for membership of the given role. |
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'. |
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)
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 subjectSpec,
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 |
removeAccessControlRule(String resourceID,
MatchRule rule)
Remove a match rule from a resource. |
void |
setLockTimeout(long timeout)
For debugging. |
void |
shutdown()
Shutdown the PDP. |
String |
signal(String resourceID,
String event)
Signal an event on the resource. |
void |
undeployPolicy(String resourceTypeID)
Undeploy a policy. |
void |
unlock(String resourceID)
Unlocks a resource. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PDPImpl()
| Method Detail |
|---|
public void shutdown()
public String lockAndCheck(String resourceID,
SubjectDescription subjectSpec,
String action)
throws AcquireResourceLockTimeoutException,
InvalidResourceIDException,
InvalidSubjectDescriptorException,
InvalidActionException,
NotAuthorisedException,
ActionCurrentlyUnavailableException,
ResourceTypeNotDeployedException
PDP
lockAndCheck in interface PDPresourceID - the resource in questionsubjectSpec - the subject's descriptionaction - the requested action
AcquireResourceLockTimeoutException - if we cant get exclusive
access to the resource in the timeout period
InvalidResourceIDException - if the resource ID is not recognised
InvalidSubjectDescriptorException - if the subject descriptor is invalid
InvalidActionException - if the action is not valid
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
ResourceTypeNotDeployedException - if the resource's type is no longer valid (undeployed)
public void check(String resourceID,
SubjectDescription subjectDesc,
String action)
throws InvalidResourceIDException,
ResourceNotLockedException,
NotAuthorisedException,
ActionCurrentlyUnavailableException,
InvalidActionException,
InvalidSubjectDescriptorException
PDP
check in interface PDPresourceID - the resource in questionsubjectDesc - the subject's descriptionaction - the requested action
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
InvalidActionException - if the action is not valid
InvalidSubjectDescriptorException - if the subject descriptor is invalid
public String lockForAdmin(String resourceID,
String action)
throws AcquireResourceLockTimeoutException,
InvalidResourceIDException,
ResourceTypeNotDeployedException
PDP
lockForAdmin in interface PDPresourceID - the resource to lockaction - the action which requires the resource to be locked
AcquireResourceLockTimeoutException
InvalidResourceIDException
ResourceTypeNotDeployedException
public void unlock(String resourceID)
throws ResourceNotLockedException,
InvalidResourceIDException
PDP
unlock in interface PDPresourceID - the resource in question
ResourceNotLockedException - if the resource is not locked
InvalidResourceIDException - if the resource ID is not recognised
public String signal(String resourceID,
String event)
throws EventCurrentlyUnavailableException,
InvalidResourceIDException,
InvalidEventException,
ResourceNotLockedException
PDP
signal in interface PDPresourceID - the resource in questionevent - the event causing the transition
EventCurrentlyUnavailableException - if the event is
not available in the current state
InvalidResourceIDException - if the resource ID is not recognised
InvalidEventException - if the event is not valid
according to the service policy
ResourceNotLockedException - if the resource is not locked
public String[] getAvailableSignals(String resourceID)
throws InvalidResourceIDException
PDP
getAvailableSignals in interface PDPresourceID - the resource in question
InvalidResourceIDException - if the resource ID is not recognised
public String getProcessState(String resourceID)
throws InvalidResourceIDException
PDP
getProcessState in interface PDPInvalidResourceIDException
public void addAccessControlRule(String resourceID,
MatchRule rule)
throws InvalidResourceIDException,
InvalidMatchRuleException,
InvalidProcessRoleException,
ResourceNotLockedException
PDP
addAccessControlRule in interface PDPresourceID - the resource being protectedrule - the rule to add
InvalidResourceIDException
InvalidMatchRuleException
InvalidProcessRoleException
ResourceNotLockedException
public void removeAccessControlRule(String resourceID,
MatchRule rule)
throws InvalidMatchRuleException,
ResourceNotLockedException,
InvalidProcessRoleException,
InvalidResourceIDException,
MatchRuleNotFoundException
PDP
removeAccessControlRule in interface PDPresourceID - the resource being protectedrule - the rule to remove
InvalidMatchRuleException
ResourceNotLockedException
InvalidProcessRoleException
InvalidResourceIDException
MatchRuleNotFoundException
public void newProcess(String resourceTypeID,
String resourceID)
throws ResourceIDAlreadyExistsException,
ResourceTypeNotDeployedException
PDP
newProcess in interface PDPresourceTypeID - 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
public String getResourceType(String resourceID)
throws InvalidResourceIDException
PDP
getResourceType in interface PDPresourceID - the resource to check
InvalidResourceIDException - if the resource does not exist
public String getResourceStatusMessage(String resourceID)
throws InvalidResourceIDException
InvalidResourceIDException
public MatchRule[] getAccessControlRules(String resourceID,
String processRole)
throws InvalidResourceIDException,
ResourceNotLockedException
PDP
getAccessControlRules in interface PDPresourceID - 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
public String[] getResources(String resourceTypeID,
SubjectDescription subjectDesc,
String processState)
throws ResourceTypeNotDeployedException,
InvalidSubjectDescriptorException,
InvalidStateException
PDP
getResources in interface PDPresourceTypeID - 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
public String[] getProcessRolesForSubject(String resourceID,
SubjectDescription subjectDesc)
throws InvalidResourceIDException,
ResourceNotLockedException,
InvalidSubjectDescriptorException
PDP
getProcessRolesForSubject in interface PDPresourceID - the resource being protectedsubjectDesc - the user to query on
InvalidResourceIDException
ResourceNotLockedException
InvalidSubjectDescriptorException
public boolean getHasRole(String resourceID,
SubjectDescription subjectDesc,
String role)
throws InvalidResourceIDException,
ResourceNotLockedException,
InvalidSubjectDescriptorException
PDP
getHasRole in interface PDPInvalidResourceIDException
ResourceNotLockedException
InvalidSubjectDescriptorExceptionpublic void setLockTimeout(long timeout)
public void deployPolicy(String resourceTypeID,
String policyClassName,
String modelData,
String defaultVersion)
throws ResourceTypeAlreadyDeployedException
PDP
deployPolicy in interface PDPresourceTypeID - 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
public void undeployPolicy(String resourceTypeID)
throws ResourceTypeNotDeployedException,
AcquireResourceLockTimeoutException
PDP
undeployPolicy in interface PDPresourceTypeID - the type to undeploy
ResourceTypeNotDeployedException - if the resource type is not currently deployed
AcquireResourceLockTimeoutException - if some resources of this type are still locked
public String getStaticPolicy(String resourceTypeID)
throws ResourceTypeNotDeployedException
PDP
getStaticPolicy in interface PDPResourceTypeNotDeployedException - if these resource type is not currently deployedpublic String[] getDeployedPolicies()
PDP
getDeployedPolicies in interface PDP
public String[] getValidProcessRoles(String resourceTypeID)
throws ResourceTypeNotDeployedException
PDP
getValidProcessRoles in interface PDPResourceTypeNotDeployedExceptionpublic String getVersion()
PDP
getVersion in interface PDP
public String getDefaultVersion(String resourceTypeID)
throws ResourceTypeNotDeployedException
PDP
getDefaultVersion in interface PDPresourceTypeID - the type to check
PDP.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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||