|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface StepFlowContext
An interface to contexts maintaing the state of flows and steps.
Implementations should guarantee that its state can be modified by only one thread at the time.
| Field Summary | |
|---|---|
static int |
CANCELLED_ACTION
The cancelled action phase. |
static int |
NO_ACTION
The no action phase. |
static int |
POST_ACTION
The post-action phase. |
static int |
PRE_ACTION
The pre-action phase. |
static int |
SUBMIT_ACTION
The submit-action phase. |
| Method Summary | |
|---|---|
Set |
attributeNameSet()
Returns a set of context attribute names. |
void |
cancelSelection()
Cancels the selection. |
void |
clearAttributes()
Clears all context attributes. |
void |
clearSelection()
Clears the selection. |
boolean |
containsAttribute(String name)
Checks the named context attribute. |
void |
finishSelection(ServletRequest request,
ServletResponse response,
FilterChain chain)
Finishes a new selection. |
int |
getActionPhase()
Gets the action phase. |
Object |
getAttribute(String name)
Gets the named context attribute. |
Object |
getAttribute(String name,
Object defaultValue)
Gets the named context attribute with a default value. |
FlowStep |
getFlow()
Gets the current flow. |
FlowFilter |
getFlowFilter()
Gets the flow filter of this context if available. |
Map |
getFormVariableIndeces(FlowStep step,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Gets a map of flow step form variable indeces of the specified request. |
String |
getProperty(FlowStep step,
String name)
Gets the named property of the specified step. |
long |
getReservationTime()
Gets the last reservation time. |
FlowStep |
getRoot()
Gets the root flow. |
String |
getSelectedFlowName()
Gets the selected flow name. |
int |
getSelectedStepIndex()
Gets the index of the selected step. |
String |
getSelectedStepPath()
Gets the selected step path. |
String |
getSelectedTemplatePath()
Gets the selected template path. |
Variable |
getSelectedVariable()
Gets the selected variable. |
FlowStep |
getStep()
Gets the current step. |
TemplateContext |
getTemplateContext(ServletRequest request,
ServletResponse response,
FilterChain chain)
Gets the template context of the specified request. |
String |
getTransition(FlowStep step,
String state)
Gets the named transition of the specified step. |
boolean |
isFlowEnabled(FlowStep flow)
Checks whether the specified flow is enabled. |
boolean |
isNewSelection()
Checks whether a new selection is set. |
boolean |
isReserved()
Checks whether this context is reserved by some other thread than the current one. |
boolean |
isRestrictedRoutes()
Checks whether step routes are restricted by a route matrix. |
boolean |
isRoot()
Checks whether the current step is the root. |
boolean |
isState(FlowStep step,
String state)
Checks the named state of the specified step. |
boolean |
isStepEnabled(FlowStep step,
FlowStep flow,
int index)
Checks whether the route from the specified step to the indexed one in the specified flow is enabled. |
boolean |
isValid()
Checks whether this context is valid. |
FlowStep |
prepareSelection(ServletRequest request,
ServletResponse response,
FilterChain chain)
Prepares a new selection. |
void |
release()
Releases this context after state changes. |
void |
removeAttribute(String name)
Removes the named context attribute. |
String |
removeProperty(FlowStep step,
String name)
Removes the named property of the specified step. |
String |
removeTransition(FlowStep step,
String state)
Removes the named transition of the specified step. |
void |
renewFormVariables(FlowStep step,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Renews flow step form variables of the specified request. |
void |
reserve(long t)
Reserves this context for state changes at the specified time unless obsolete or interrupted. |
void |
resetFormVariables(FlowStep step,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Resets flow step form variables of the specified request. |
void |
setAttribute(String name,
Object value)
Sets the named context attribute. |
void |
setProperty(FlowStep step,
String name,
String value)
Sets the named property of the specified step. |
void |
setSelectedFlowName(String name)
Sets the selected flow name. |
void |
setSelectedStepIndex(int step)
Sets the index of the selected step. |
void |
setSelectedStepPath(String path)
Sets the selected step path. |
void |
setSelectedTemplatePath(String path)
Sets the selected template path. |
void |
setSelectedVariable(Variable variable)
Sets the selected variable. |
void |
setState(FlowStep step,
String state,
boolean flag)
Sets the named state of the specified step. |
void |
setStepEnabled(FlowStep step,
FlowStep flow,
int index,
boolean flag)
Sets whether the route from the specified step to the indexed one is in the specified flow enabled. |
void |
setTransition(FlowStep step,
String state,
String value)
Sets the named transition of the specified step. |
| Field Detail |
|---|
static final int NO_ACTION
static final int PRE_ACTION
static final int POST_ACTION
static final int SUBMIT_ACTION
static final int CANCELLED_ACTION
| Method Detail |
|---|
void reserve(long t)
throws InterruptedException
t - the reservation time in msecs.
InterruptedException - if obsolete or interrupted.void release()
boolean isReserved()
long getReservationTime()
boolean isValid()
boolean isRoot()
FlowStep getRoot()
FlowStep getFlow()
FlowStep getStep()
boolean isRestrictedRoutes()
boolean isFlowEnabled(FlowStep flow)
flow - the target flow.
boolean isStepEnabled(FlowStep step,
FlowStep flow,
int index)
step - the source step.flow - the target flow.index - the index of the target step.
void setStepEnabled(FlowStep step,
FlowStep flow,
int index,
boolean flag)
step - the source step.flow - the target flow.index - the index of the target step.flag - true if enabled, false otherwise.
boolean isState(FlowStep step,
String state)
step - the flow step.state - the state name.
void setState(FlowStep step,
String state,
boolean flag)
step - the flow step.state - the state name.flag - true if set, false otherwise.
String getProperty(FlowStep step,
String name)
step - the flow step.name - the property name.
void setProperty(FlowStep step,
String name,
String value)
step - the flow step.name - the property name.value - the value of the property.
String removeProperty(FlowStep step,
String name)
step - the flow step.name - the property name.
String getTransition(FlowStep step,
String state)
step - the flow step.state - the state name.
void setTransition(FlowStep step,
String state,
String value)
step - the flow step.state - the state name.value - the value of the transition.
String removeTransition(FlowStep step,
String state)
step - the flow step.state - the state name.
int getActionPhase()
Object getAttribute(String name)
name - the attribute name.
Object getAttribute(String name,
Object defaultValue)
name - the attribute name.defaultValue - the default value.
void setAttribute(String name,
Object value)
name - the attribute name.value - the attribute value.boolean containsAttribute(String name)
name - the attribute name.
void removeAttribute(String name)
name - the attribute name.void clearAttributes()
Set attributeNameSet()
String getSelectedStepPath()
void setSelectedStepPath(String path)
path - the path of the selected step.String getSelectedFlowName()
void setSelectedFlowName(String name)
Note that the selected step index is set to the beginning of the flow.
name - the name of the selected flow.int getSelectedStepIndex()
void setSelectedStepIndex(int step)
step - the index of the selected step.String getSelectedTemplatePath()
void setSelectedTemplatePath(String path)
Note that only one template can be passed through the selection, more complicated cases must be handled with other mechanisms.
path - the selected template path.Variable getSelectedVariable()
void setSelectedVariable(Variable variable)
Note that only one variable can be passed through the selection, more complicated cases must be handled with other mechanisms.
variable - the selected variable.boolean isNewSelection()
void cancelSelection()
void clearSelection()
FlowStep prepareSelection(ServletRequest request,
ServletResponse response,
FilterChain chain)
throws AccessDeniedException,
ExecutionException,
InterruptedException
request - the servlet request.response - the servlet response.chain - the filter chain.
AccessDeniedException - for denied access.
ExecutionException - if activation failed.
InterruptedException - if activation was interrupted.
void finishSelection(ServletRequest request,
ServletResponse response,
FilterChain chain)
throws AccessDeniedException,
ExecutionException,
InterruptedException
request - the servlet request.response - the servlet response.chain - the filter chain.
AccessDeniedException - for denied access.
ExecutionException - if activation failed.
InterruptedException - if activation was interrupted.
TemplateContext getTemplateContext(ServletRequest request,
ServletResponse response,
FilterChain chain)
throws TemplateException
request - the servlet request.response - the servlet response.chain - the filter chain.
TemplateException - on errors.
Map getFormVariableIndeces(FlowStep step,
ServletRequest request,
ServletResponse response,
FilterChain chain)
step - the flow step.request - the servlet request.response - the servlet response.chain - the filter chain.
void resetFormVariables(FlowStep step,
ServletRequest request,
ServletResponse response,
FilterChain chain)
step - the flow step.request - the servlet request.response - the servlet response.chain - the filter chain.
void renewFormVariables(FlowStep step,
ServletRequest request,
ServletResponse response,
FilterChain chain)
throws ConstructionException
step - the flow step.request - the servlet request.response - the servlet response.chain - the filter chain.
ConstructionException - if construction fails.FlowFilter getFlowFilter()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||