uk.ac.soton.itinnovation.grid.pbac2.pdp
Interface ServicePolicy

All Known Implementing Classes:
ITInnovationServicePolicyImpl

public interface ServicePolicy

A ServicePolicy is given the list of process roles which a user has, the action they want to perform, and the current state of the resource on which they wish it to act. It decides whether the action should be allowed. It also enforces the state model, as a check for programming errors in the services that use it. There is one ServicePolicy for each type of resource.


Method Summary
 void checkAuthorised(Set<String> processRoles, String action, String state)
          Decides whether a user with the given roles may perform the requested operation for a resource in the given state.
 void checkRoleValid(String processRole)
          Checks if the process role specified is valid for this resource type.
 Set<String> getAvailableSignals(String state)
          Get the signals available in the given state.
 String getNextState(String oldState, String event)
          Gets the next state given the current state and the event.
 String[] getValidProcessRoles()
          List the valid process roles for this model.
 void undeployPolicy()
          Removes a policy from the persistent store.
 

Method Detail

getNextState

String getNextState(String oldState,
                    String event)
                    throws EventCurrentlyUnavailableException,
                           InvalidStateException,
                           InvalidEventException
Gets the next state given the current state and the event.

Parameters:
oldState - the current state
event - the event name
Returns:
the state to which the resource should transition
Throws:
EventCurrentlyUnavailableException - if the event is valid but not allowed in this state
InvalidStateException - if the oldState is not in the model
InvalidEventException - if the event is not in the model

checkAuthorised

void checkAuthorised(Set<String> processRoles,
                     String action,
                     String state)
                     throws InvalidActionException,
                            InvalidStateException,
                            NotAuthorisedException,
                            ActionCurrentlyUnavailableException
Decides whether a user with the given roles may perform the requested operation for a resource in the given state.

Parameters:
processRoles - the roles to which the user belongs
action - the requested SOAP operation
state - the current process state of the resource
Throws:
InvalidActionException - the action isn't valid for this model
InvalidStateException - the state isn't valid for this model
NotAuthorisedException - if the operation is not possible in any state given the set of process roles
ActionCurrentlyUnavailableException - if the operation is valid for at least one of roles sepcified, but not in the current state

checkRoleValid

void checkRoleValid(String processRole)
                    throws InvalidProcessRoleException
Checks if the process role specified is valid for this resource type.

Parameters:
processRole -
Throws:
InvalidProcessRoleException - the role isn't valid for this model

undeployPolicy

void undeployPolicy()
Removes a policy from the persistent store.


getValidProcessRoles

String[] getValidProcessRoles()
List the valid process roles for this model.

Returns:
an array of process role names.

getAvailableSignals

Set<String> getAvailableSignals(String state)
Get the signals available in the given state.

Returns:
a set of signal names


Copyright © 2001-2008 University of Southampton IT Innovation Centre. All Rights Reserved.