|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface for representing high-level update operations in the VO
database. Classes implementing this interface usually have attributes
representing all the parameters that are necessary for the action. VOMS
calls perform()
when it is time to carry out the operation.
Actions should not normally need to return a value to the caller. For
the few cases when returning a value is unavoidable (e.g. creating a new
request should return its id), a performWithResult()
method is
provided. (In each class, exactly one of perform()
and performWithResult()
must be implemented -- the default implementations
provided by ActionHelper
take care of the correct semantics.)
The Database
class
provides methods for executing (performing) actions. These methods
are the only way to perform an action. Note that act of performing an
action always returns a value. If the action is valueless, i.e. perform()
is implemented, then the returned value is null
.
TODO: If you find this mess with the return values confusing, you are
right, and you are welcome to add a return value to perform()
, delete
performWithResult()
, and add a return null;
to the end of
each existing action. Bear in mind though that the mostly extraneous return
statement would make writing actions even more unpleasant than it already
is.
All action types must be derived from ActionHelper
, because the Database
class depends on the
internal semantics implemented by that helper class.
Note that it is possible that this interface will be extended with new
methods when the notification mechanism is implemented. If this happens,
ActionHelper
will provide adequate default implementations, so that
existing actions would not need to be changed.
Method Summary | |
void |
checkPermission()
Check that the current client (as specified by the current security context) has the right to perform this action. |
java.util.List |
getAdminUsers()
|
java.lang.String |
getContainerName()
Return the FQCN of the container that this request wants to change. |
java.lang.String |
getDescription()
Return a human-readable description of this request. |
java.util.Map |
getParameters()
Return the parameters of the requested action as an array of strings. |
void |
perform()
Do the operation that this action represents, without ACL checks. |
java.lang.Object |
performWithResult()
Do the operation that this action represents, without ACL checks, and return a value. |
Method Detail |
public void checkPermission() throws VOMSException
VOMSSecurityException
.
VOMSSecurityException
- when the access is denied.
DatabaseError
- if an SQL error occurs.
InconsistentDatabase
- if a database inconsistency is detected.
VOMSException
public java.util.List getAdminUsers() throws VOMSException
VOMSException
public void perform() throws VOMSException
performWithResult()
, for actions that do not need
a return value. Most actions are like this, so the elimination of the
extra return statement seems worthwhile.
VOMSException
public java.lang.Object performWithResult() throws VOMSException
perform()
for use when the action must return a value. A typical scenario when
this is needed is the creation of a new request: performing the action
must return the id of the newly created request.
VOMSException
public java.lang.String getDescription()
public java.lang.String getContainerName()
Actions that are not part of a requests need not implement this method.
public java.util.Map getParameters()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |