|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.glite.security.voms.request.Request
An abstract class representing a request submitted by a user.
This abstract request type predefines three states that are likely to be
useful in derived classes: Request.DoneState
, Request.TimedOutState
and
Request.DeletedState
. (They are not enough to make a complete state
machine, so Request
itself is not usable as a request type.)
Nested Class Summary | |
static class |
Request.ChronicleEntry
A simple class describing entries in the chronicle. |
class |
Request.DeletedState
The standard state of a deleted request which has not yet been purged from the database. |
class |
Request.DoneState
The standard state of an accepted and successfully processed request. |
class |
Request.State
An abstract class representing a request state. |
class |
Request.TimedOutState
The standard state of a request that has timed out. |
Field Summary | |
protected Action |
action
The action that is requested. |
protected java.util.List |
chronicle
A list of ChronicleEntries describing the history of this request. |
protected java.util.List |
notifications
A list of notification entries. |
protected java.util.Map |
parameters
A storage area for optional parameters. |
protected Request.State |
state
The current state. |
Constructor Summary | |
protected |
Request(Action action)
Protected constructior without the optional parameters. |
protected |
Request(Action action,
java.lang.String[] parameters)
Protected constructor; allocates a new id for this request. |
protected |
Request(long id,
long requester,
Action action)
Protected constructor that allows to set an id explicitly. |
Method Summary | |
void |
addNotification(Notification note)
Adds a notification to the request (sent or pending). |
void |
addParameter(java.lang.String key,
java.lang.String value)
Add a parameter to the optional parameters. |
void |
addParameters(java.lang.String[] params)
Adds an even sized string array to the optional parameters. |
protected void |
chronicle(java.lang.String description)
Add a new entry to the chronicle. |
protected void |
chronicle(java.lang.String description,
java.lang.String comment)
|
void |
delete()
Delete this Request object from the database. |
Action |
getAction()
Return the action wrapped into this request. |
java.util.List |
getChronicle()
Return a copy of the chronicle. |
Request.State |
getDeletedState()
Return a new instance of Request.DeletedState .
|
DetailedRequest |
getDetailedRequest()
|
Request.State |
getDoneState()
Return a new instance of Request.DoneState .
|
long |
getId()
Return the id of this request. |
static Request |
getInstance(long id)
Return the request with the given id by looking it up in the database. |
java.util.List |
getNotifications()
Return a copy of the notifications. |
java.util.Map |
getParameters()
Return a read-only view of the parameters. |
DBAdmin |
getRequester()
Return the client who submitted this request. |
long |
getRequesterId()
Return the id of the client who submitted this request. |
static long[] |
getRequests(DBAdmin requester,
java.lang.Boolean complete,
java.lang.String type,
java.lang.String container,
java.lang.String state)
Get the ids of all requests with the given requester, type, container and/or state. |
ShortRequest |
getShortRequest()
|
static ShortRequest[] |
getShortRequests(DBAdmin requester,
java.lang.Boolean complete,
java.lang.String type,
java.lang.String container,
java.lang.String state)
Get the short SOAP form of all requests with the given requester, type, container and/or state. |
java.lang.String |
getStateDescription()
Return a short description of the state that this request is in. |
java.lang.String |
getStateName()
Return the name of the state that this request is in. |
Request.State |
getTimedOutState()
Return a new instance of Request.TimedOutState .
|
boolean |
isComplete()
Return whether the request is in a final state. |
static boolean |
isInDatabase(long id)
Returns true if there is a request in the database with the given id. |
boolean |
isPendingNotification()
Returns true, if there is any pending notification attached to this request. |
void |
printChronicle()
Helper method for writing the chronicle to the log. |
void |
processEvent(Event e)
Process the given event. |
void |
sendPendingNotifications()
Sends out pending notifications. |
void |
store()
Save this Request object in the database. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Action action
protected java.util.List chronicle
protected java.util.List notifications
protected java.util.Map parameters
protected transient Request.State state
Constructor Detail |
protected Request(Action action, java.lang.String[] parameters) throws VOMSException
protected Request(Action action) throws VOMSException
Request(Action,String[])
protected Request(long id, long requester, Action action)
java.lang.NullPointerException
- when the action parameter is null.Method Detail |
public long getId()
public long getRequesterId()
public Action getAction()
public DBAdmin getRequester() throws GeneralDatabaseException
GeneralDatabaseException
public java.util.List getChronicle()
protected void chronicle(java.lang.String description) throws GeneralDatabaseException
GeneralDatabaseException
protected void chronicle(java.lang.String description, java.lang.String comment) throws GeneralDatabaseException
GeneralDatabaseException
public void printChronicle() throws VOMSException
VOMSException
public java.util.List getNotifications()
public void sendPendingNotifications()
public boolean isPendingNotification()
public void addNotification(Notification note)
If a message was sent, then this list preserves it for archival.
public java.util.Map getParameters()
public void addParameter(java.lang.String key, java.lang.String value) throws ArgumentException
ArgumentException
public void addParameters(java.lang.String[] params) throws ArgumentException
ArgumentException
public java.lang.String getStateName()
public java.lang.String getStateDescription()
public boolean isComplete()
public Request.State getDoneState()
Request.DoneState
.
Calling these get*State()
functions is the only accepted
method of creating state objects. By overriding these methods, derived
classes may replace entire states with a new implementation without
changing code in any of the neighbouring states.
public Request.State getTimedOutState()
Request.TimedOutState
.
Calling these get*State()
functions is the only accepted
method of creating state objects. By overriding these methods, derived
classes may replace entire states with a new implementation without
changing code in any of the neighbouring states.
public Request.State getDeletedState()
Request.DeletedState
.
Calling these get*State()
functions is the only accepted
method of creating state objects. By overriding these methods, derived
classes may replace entire states with a new implementation without
changing code in any of the neighbouring states.
public void processEvent(Event e) throws VOMSException
VOMSException
public static Request getInstance(long id) throws GeneralDatabaseException
If the deserialization fails for any reason, this function returns a BrokenRequest instance instead of throwing an exception.
NotInDatabase
- when there is no request with the given id in the database.
GeneralDatabaseException
public static boolean isInDatabase(long id) throws GeneralDatabaseException
GeneralDatabaseException
public void store() throws VOMSException
VOMSException
public void delete() throws VOMSException
VOMSException
public java.lang.String toString()
public ShortRequest getShortRequest() throws GeneralDatabaseException
GeneralDatabaseException
public DetailedRequest getDetailedRequest() throws GeneralDatabaseException
GeneralDatabaseException
public static ShortRequest[] getShortRequests(DBAdmin requester, java.lang.Boolean complete, java.lang.String type, java.lang.String container, java.lang.String state) throws GeneralDatabaseException
GeneralDatabaseException
public static long[] getRequests(DBAdmin requester, java.lang.Boolean complete, java.lang.String type, java.lang.String container, java.lang.String state) throws GeneralDatabaseException
GeneralDatabaseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |