org.glite.security.voms.request
Class Request.State

java.lang.Object
  extended byorg.glite.security.voms.request.Request.State
Direct Known Subclasses:
BrokenRequest.BrokenState, CheckedRequest.DeniedState, CheckedRequest.UndecidedState, ConfirmedRequest.NewState, Request.DeletedState, Request.DoneState, Request.TimedOutState
Enclosing class:
Request

public abstract class Request.State
extends java.lang.Object

An abstract class representing a request state. States implement the behaviour of the request with respect to incoming events. Each request object has a current state. New events are passed to the current state for processing. Processing an event usually results in a state change (a new current state), along with other side effect.


Constructor Summary
Request.State()
           
 
Method Summary
 java.util.ArrayList getAcceptedEvents()
          Return the event types that this state accepts as an ArrayList of Class objects.
abstract  java.lang.String getDescription()
          Return a description of this state.
abstract  java.lang.String getName()
          Return the short name of this state.
abstract  boolean isComplete()
          Return true if the request is complete, i.e. if no more state transitions are expected.
 Request.State processEvent(Event e)
          Process the given event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Request.State

public Request.State()
Method Detail

getName

public abstract java.lang.String getName()
Return the short name of this state. The short name is a short description of the state, in English. It is presented to the user and also used in the database to filter a search to requests with a given state. Please capitalize the first letter, and don't use more than two words.

It is not an error to have two different State classes with the same name, although this is usually not desirable.


getDescription

public abstract java.lang.String getDescription()
Return a description of this state. This is presented to the user as an explanation of the current status of the request. It should be a complete English sentence, with a punctuation point at the end.

It is not an error to have two different State classes with the same description.


isComplete

public abstract boolean isComplete()
Return true if the request is complete, i.e. if no more state transitions are expected.


processEvent

public Request.State processEvent(Event e)
                           throws VOMSException
Process the given event.

The default implementation handles only TimeoutEvent, and only for incomplete states. Concrete states usually call super.processEvent(e) to fall back to the default behaviour.

Returns:
the new state of the request after this event.
Throws:
UnexpectedEvent - if the given event is invalid in the current state.
VOMSException

getAcceptedEvents

public java.util.ArrayList getAcceptedEvents()
Return the event types that this state accepts as an ArrayList of Class objects.