org.wso2.registry.aspects
Class Lifecycle

java.lang.Object
  extended by org.wso2.registry.Aspect
      extended by org.wso2.registry.aspects.Lifecycle

public class Lifecycle
extends Aspect


Nested Class Summary
static class Lifecycle.ConditionEnum
           
 
Field Summary
static java.lang.String DEMOTE
           
static java.lang.String PROMOTE
           
 
Fields inherited from class org.wso2.registry.Aspect
ASPECT_NAME, AVAILABLE_ASPECTS
 
Constructor Summary
Lifecycle(org.apache.axiom.om.OMElement config)
           
 
Method Summary
 void associate(Resource resource, Registry registry)
          Associate a new Resource with this aspect.
 java.lang.String[] getAvailableActions(RequestContext context)
          Get a list of available actions for the resource in the RequestContext, taking into account current state, user, etc.
 void invoke(RequestContext context, java.lang.String action)
          Do something - action names are aspect-specific, and it's up to the implementation to decide if a given action is allowed, and what to do if so.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROMOTE

public static final java.lang.String PROMOTE
See Also:
Constant Field Values

DEMOTE

public static final java.lang.String DEMOTE
See Also:
Constant Field Values
Constructor Detail

Lifecycle

public Lifecycle(org.apache.axiom.om.OMElement config)
          throws RegistryException
Throws:
RegistryException
Method Detail

associate

public void associate(Resource resource,
                      Registry registry)
               throws RegistryException
Description copied from class: Aspect
Associate a new Resource with this aspect. This could set custom properties, create sub-directories, etc... If this throws an Exception, the association has FAILED.

Specified by:
associate in class Aspect
Parameters:
resource - Resource which we want to change the state
registry - Current registry instance
Throws:
RegistryException - If the condition is not met or some thing is wrong

invoke

public void invoke(RequestContext context,
                   java.lang.String action)
            throws RegistryException
Description copied from class: Aspect
Do something - action names are aspect-specific, and it's up to the implementation to decide if a given action is allowed, and what to do if so. Action invocations can (and often do) have persistent side-effects in the Registry.

Specified by:
invoke in class Aspect
Parameters:
context - the RequestContext containing all the state about this request
action - action to perform
Throws:
RegistryException - If the condition is not met or some thing is wrong

getAvailableActions

public java.lang.String[] getAvailableActions(RequestContext context)
Description copied from class: Aspect
Get a list of available actions for the resource in the RequestContext, taking into account current state, user, etc.

Specified by:
getAvailableActions in class Aspect
Parameters:
context - the RequestContext containing info about the Resource, Registry, User, etc.
Returns:
a String[] of the names of valid actions for this aspect on the specified resource


Copyright © 2007 Apache Web Services Project. All Rights Reserved.