|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface FlowFilter
FlowFilter provides control over a series of templates forming a step by step process of validated user input and output. Flows are named containers of steps, which define step templates, actions executed before and after processing the step and variables to maintain the data content of the step.
Flows are identified by a unique name. Steps are indexed within the enclosing
flow starting from 1. Allowed routes between flows and steps are defined by
BitSet of (n+1)*(n+1) matrix, where n is the number of steps
in a flow. Index 0 is reserved for defining access to step into and out from
the flow.
The syntax 'flow name'-'step-index' refers to separate steps. The flow name should not contain dashes to avoid confusion. Note that the index part may consists of more than one index separated by dots (.) to form a path to a specific step.
The syntax /'flow-name' refers to the root flow, */'flow-name' to the named step of the current flow and **/'flow-name' to any named steps in the current flow hierarchy.
Steps can be protected with an access controller. Permissions for a step are granted using its name as a resource.
| Method Summary | |
|---|---|
boolean |
addFlowName(String name)
Adds a named flow if absent. |
void |
addStepName(String name,
int index,
String step)
Adds a new step to the named flow. |
void |
clearContextAttributes()
Clears all global context attributes. |
void |
clearFlows()
Clears all flows. |
void |
clearSteps(String name)
Clears all steps from the named flow. |
boolean |
containsContextAttribute(String name)
Checks the named global context attribute. |
boolean |
containsFlow(String name)
Checks the named flow. |
boolean |
containsStep(String name,
int index)
Checks the indexed step. |
Map |
contextAttributeMap()
Returns a map of global context attributes. |
Variable |
createVariable(String type)
Creates a new variable MBean instance of the specified type. |
boolean |
executeActions(FlowStep step,
StepFlowContext context,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Executes actions of the specified step in the given flow context. |
Set |
flowNameSet()
Returns a read-only set of flow names. |
Object |
getContextAttribute(String name)
Gets the named global context attribute. |
StepFlowContext |
getCurrentContext(ServletRequest request,
ServletResponse response,
FilterChain chain)
Gets the step flow context of the specified request. |
String |
getDefaultActionName()
Gets the name of the default action applied to flows without a flow specific action. |
String[] |
getDefaultActionNames()
Gets the names of the default actions applied to flows without flow specific templates. |
FlowStep |
getDefaultFlow()
Gets the default flow. |
String |
getDefaultFlowName()
Gets the name of the default flow. |
String |
getDefaultLabel()
Gets the default flow label. |
String |
getDefaultProperty(String property)
Gets the named default property. |
String |
getDefaultTemplatePath()
Gets the path of the default template applied to flows without a flow or specific template. |
String[] |
getDefaultTemplatePaths()
Gets the paths of the default templates applied to flows without flow specific templates. |
String |
getDefaultTransition(String state)
Gets the default transition of the named state. |
String |
getDefaultVariableType()
Gets the type of the default variable applied to flows without a flow specific variable. |
String[] |
getDefaultVariableTypes()
Gets the types of the default variables applied to flows without flow specific variables. |
FlowStep |
getFlow(String name)
Gets the named flow. |
String |
getFlowActionName(String name)
Gets the name of the action applied to the named flow. |
String[] |
getFlowActionNames(String name)
Gets the names of the actions applied to the named flow. |
String |
getFlowLabel(String name)
Gets the label of the named flow. |
String |
getFlowName(String path)
Gets the flow part of the flow step path. |
String[] |
getFlowNames()
Gets the names of all flows. |
String |
getFlowProperty(String name,
String property)
Gets the named property of the named flow. |
String |
getFlowTemplatePath(String name)
Gets the pathname of the template applied to the named flow. |
String[] |
getFlowTemplatePaths(String name)
Gets the paths of the templates applied to the named flow. |
String |
getFlowTransition(String name,
String state)
Gets the transition of the named flow. |
String |
getFlowVariableType(String name)
Gets the type of the variable applied to the named flow. |
String[] |
getFlowVariableTypes(String name)
Gets the types of the variables applied to the named flow. |
int |
getPropertyIndex(String property)
Gets the index of the named property within this filter. |
int |
getPropertyIndex(String property,
boolean add)
Gets and optionally adds the index of the named property within this filter. |
StepMatrix |
getRouteMatrix(String name)
Gets the matrix defining enabled routes for flow steps. |
int |
getStateIndex(String state)
Gets the index of the named state within this filter. |
int |
getStateIndex(String state,
boolean add)
Gets and optionally adds the index of the named state within this filter. |
int |
getStepCount(String name)
Gets the number of steps in the named flow. |
int |
getStepIndex(String path,
int index)
Gets the index part of the flow step path. |
String |
getStepName(String name)
Gets the name of the step of the named flow or step. |
String |
getStepName(String name,
int index)
Gets the name of the step of the named flow. |
String[] |
getStepNames(String name)
Gets the step names of the named flow. |
String |
getStepPath(String name,
int index)
Gets the path to the indexed step of the named flow. |
ObjectName |
getTaskLoaderName()
Gets the the task loader to be applied by contexts of this filter. |
ObjectName |
getVariableRegistryName()
Gets the the variable registry to be applied by contexts of this filter. |
int |
indexOfStep(String name,
String step)
Return the index of the named step of the named flow. |
boolean |
isDefaultState(String state)
Checks whether the named state is set by default. |
boolean |
isFlowState(String name,
String state)
Checks whether the named state is set for the named flow. |
boolean |
isRestrictedRoutes()
Checks whether step routes of flows of this filter are restricted by a route matrix. |
List |
propertyNameList()
Returns a read-only list of names of known properties within this filter. |
void |
removeContextAttribute(String name)
Removes the named global context attribute. |
void |
removeFlow(String name)
Removes the named flow. |
void |
removeStep(String name,
int index)
Removes the indexed step from the named flow. |
void |
setContextAttribute(String name,
Object value)
Sets the named global context attribute. |
void |
setDefaultActionName(String task)
Sets the name of the default action applied to to flows without a flow specific action. |
void |
setDefaultActionNames(String[] tasks)
Sets the names of the default actions applied to flows without flow specific templates. |
void |
setDefaultFlowName(String name)
Sets the name of the default flow. |
void |
setDefaultLabel(String label)
Sets the label of the named flow. |
void |
setDefaultProperties(String[] properties)
Sets the named default properties as consecutive pairs of names and values. |
void |
setDefaultProperty(String property,
String value)
Sets the named default property. |
void |
setDefaultState(String state,
boolean flag)
Sets whether the named state is set by default. |
void |
setDefaultStates(String[] states)
Sets the named states on by default. |
void |
setDefaultTemplatePath(String path)
Sets the path of the default template applied to flows without a flow specific template. |
void |
setDefaultTemplatePaths(String[] paths)
Sets the paths of the default templates applied to flows without flow specific templates. |
void |
setDefaultTransition(String state,
String value)
Sets the default transition of the named state. |
void |
setDefaultTransitions(String[] transitions)
Sets the default transitions as consecutive pairs of states and values. |
void |
setDefaultVariableType(String type)
Sets the type of the default variable applied to flows without a flow specific variable. |
void |
setDefaultVariableTypes(String[] types)
Sets the types of the default variables applied to flows without flow specific variables. |
void |
setFlowActionName(String name,
String task)
Sets the name of the action applied to the named flow. |
void |
setFlowActionNames(String name,
String[] tasks)
Sets the names of the actions applied to the named flow. |
void |
setFlowLabel(String name,
String label)
Sets the label of the named flow. |
void |
setFlowName(String name)
Sets or replaces a named flow if absent. |
void |
setFlowNames(String[] names)
Sets the names of absent flows. |
void |
setFlowProperties(String name,
String[] properties)
Sets the named properties of the named flow as consecutive pairs of names and values. |
void |
setFlowProperty(String name,
String property,
String value)
Sets the named property of the named flow. |
void |
setFlowState(String name,
String state,
boolean flag)
Sets whether the named state is set for the named flow. |
void |
setFlowStates(String name,
String[] states)
Sets the named states of the named flow. |
void |
setFlowTemplatePath(String name,
String path)
Sets the path of the template applied to the named flow. |
void |
setFlowTemplatePaths(String name,
String[] paths)
Sets the paths of the templates applied to the named flow. |
void |
setFlowTransition(String name,
String state,
String flow)
Sets the transition of the named flow. |
void |
setFlowTransitions(String name,
String[] transitions)
Sets the transitions of the named flow as consecutive pairs of states and values. |
void |
setFlowVariableType(String name,
String type)
Sets the type of the variable applied to the named flow. |
void |
setFlowVariableTypes(String name,
String[] types)
Sets the types of the variables applied to the named flow. |
void |
setRestrictedRoutes(boolean flag)
Sets whether step routes of flows of this filter are restricted by a route matrix. |
void |
setRouteArray(String name,
String array)
Sets the matrix defining enabled routes for flow steps as a string. |
void |
setRouteMatrix(String name,
StepMatrix matrix)
Sets the matrix defining enabled routes for flow steps. |
void |
setRoutesEnabled(String name,
boolean flag)
Sets the matrix defining enabled routes for flow steps as a boolean. |
void |
setStepName(String name,
int index,
String step)
Sets the name of the step of the named flow. |
void |
setStepName(String name,
String step)
Sets the name of the step applied of the named flow or step. |
void |
setStepNames(String name,
String[] steps)
Sets the step names of the named flow. |
void |
setTaskLoaderName(ObjectName loader)
Sets the task loader to be applied by contexts of this filter. |
void |
setVariableRegistryName(ObjectName registry)
Sets the variable registry to be applied by contexts this filter. |
List |
stateNameList()
Returns a read-only list of names of known states within this filter. |
| Methods inherited from interface org.norther.tammi.spray.filter.SecureFilter |
|---|
checkPermission, checkPermission, checkPermission |
| Methods inherited from interface org.norther.tammi.core.security.AccessController |
|---|
addAllowedPermission, addDeniedPermission, allowedPermissions, allowedRoleSet, checkPermission, checkPermission, checkPermission, clearAllowedPermissions, clearDeniedPermissions, deniedPermissions, deniedRoleSet, getPermissibleRoles, getPermissibleRoles, getPermissibleRoles, isProtected, removeAllowedPermissions, removeDeniedPermissions, setAllowedPermissions, setDeniedPermissions |
| Methods inherited from interface javax.servlet.Filter |
|---|
destroy, doFilter, init |
| Methods inherited from interface org.norther.tammi.spray.filter.KeyFilter |
|---|
getKey, getKeyValue, getKeyValues, isLinkedKey, setKey, setLinkedKey |
| Methods inherited from interface javax.servlet.Filter |
|---|
destroy, doFilter, init |
| Method Detail |
|---|
String getFlowName(String path)
path - the flow step path.
int getStepIndex(String path,
int index)
path - the flow step path.index - the default index.
NumberFormatException - for an invalid indexed path.
String getStepPath(String name,
int index)
name - the flow step name.index - the step index.
String getDefaultFlowName()
void setDefaultFlowName(String name)
name - the name of the flow.FlowStep getDefaultFlow()
String getDefaultLabel()
void setDefaultLabel(String label)
label - the label of the flow.String getDefaultTemplatePath()
Note that if several templates are defined, the first one is returned.
void setDefaultTemplatePath(String path)
Note that all previously defined templates are replaced with the new one.
path - the path of the template.String[] getDefaultTemplatePaths()
void setDefaultTemplatePaths(String[] paths)
paths - the paths of the templates.String getDefaultVariableType()
Note that if several variables are defined, the first one is returned.
void setDefaultVariableType(String type)
Note that all previously defined variables are replaced with the new one.
type - the type of the variable.String[] getDefaultVariableTypes()
void setDefaultVariableTypes(String[] types)
types - the types of the variables.String getDefaultActionName()
Note that if several actions are defined, the first one is returned.
void setDefaultActionName(String task)
Note that all previously defined actions are replaced with the new one.
task - the name of the action.String[] getDefaultActionNames()
void setDefaultActionNames(String[] tasks)
tasks - the names of the actions.boolean isDefaultState(String state)
state - the name of the state.
void setDefaultState(String state,
boolean flag)
state - the name of the state.flag - true if the state is on, false otherwise.void setDefaultStates(String[] states)
states - the names of the states.int getStateIndex(String state)
state - the name of the state.
int getStateIndex(String state,
boolean add)
state - the name of the state.add - true to add a missing state.
List stateNameList()
String getDefaultProperty(String property)
property - the name of the property.
void setDefaultProperty(String property,
String value)
property - the name of the property.value - the value of the property.void setDefaultProperties(String[] properties)
properties - the names and values of the properties.int getPropertyIndex(String property)
property - the name of the property.
int getPropertyIndex(String property,
boolean add)
property - the property of the property.add - true to add a missing property.
List propertyNameList()
String getDefaultTransition(String state)
state - the name of the state.
void setDefaultTransition(String state,
String value)
state - the name of the state.value - the value of the transition or null.void setDefaultTransitions(String[] transitions)
transitions - the states and values of the transitions.boolean isRestrictedRoutes()
void setRestrictedRoutes(boolean flag)
flag - true if restricted, false otherwise.FlowStep getFlow(String name)
name - the name of the flow.
boolean containsFlow(String name)
name - the name of the flow.
void removeFlow(String name)
name - the name of the flow.void clearFlows()
void setFlowName(String name)
name - the name of the flow.boolean addFlowName(String name)
name - the name of the flow.
String[] getFlowNames()
void setFlowNames(String[] names)
names - the names of the flows.Set flowNameSet()
boolean containsStep(String name,
int index)
name - the name of the flow.index - the index of the step.
int indexOfStep(String name,
String step)
name - the name of the flow.step - the name of the step.
void removeStep(String name,
int index)
name - the name of the flow.index - the index of the step.
IndexOutOfBoundsException - if wrong index.void clearSteps(String name)
name - the name of the flow.String getStepName(String name)
Note that if several steps are defined, the first one is returned.
name - the name of the flow.
NumberFormatException - for an invalid indexed name.
void setStepName(String name,
String step)
Note that all previously defined steps are replaced with the new one.
name - the name of the flow.step - the name of the step.
NullPointerException - if the flow is not found.
NumberFormatException - for an invalid indexed name.
IllegalArgumentException - for an invalid step name.
String getStepName(String name,
int index)
name - the name of the flow.index - the index of the step.
IndexOutOfBoundsException - if wrong index.
void setStepName(String name,
int index,
String step)
name - the name of the flow.index - the index of the step.step - the name of the step.
IndexOutOfBoundsException - if wrong index.
IllegalArgumentException - for an invalid step name.
NullPointerException - for a null name or if the flow is not found.
void addStepName(String name,
int index,
String step)
name - the name of the flow.index - the index of the step.step - the name of the step.
IndexOutOfBoundsException - if wrong index.
IllegalArgumentException - for an invalid step name.
NullPointerException - for a null name or if the flow is not found.String[] getStepNames(String name)
name - the name of the flow.
void setStepNames(String name,
String[] steps)
name - the name of the flow.steps - an array of step names.
IllegalArgumentException - for an invalid step name.
NullPointerException - for null names or if the flow is not found.int getStepCount(String name)
name - the name of the flow.
StepMatrix getRouteMatrix(String name)
name - the name of the flow.
void setRouteMatrix(String name,
StepMatrix matrix)
name - the name of the flow.matrix - the step matrix.
NullPointerException - if the flow is not found.
void setRouteArray(String name,
String array)
name - the name of the flow.array - a string of size (n+1)*(n+1) where n is the step count.
NullPointerException - if the flow is not found.
void setRoutesEnabled(String name,
boolean flag)
name - the name of the flow.flag - true to enable routes, false to disable.
NullPointerException - if the flow is not found.String getFlowLabel(String name)
name - the name of the flow.
void setFlowLabel(String name,
String label)
name - the name of the flow.label - the label of the flow.
NullPointerException - if the flow is not found.String getFlowTemplatePath(String name)
Note that if several templates are defined, the first one is returned.
name - the name of the flow.
void setFlowTemplatePath(String name,
String path)
Note that all previously defined templates are replaced with the new one.
name - the name of the flow.path - the path of the template.
NullPointerException - if the flow is not found.String[] getFlowTemplatePaths(String name)
name - the name of the flow.
void setFlowTemplatePaths(String name,
String[] paths)
name - the name of the flow.paths - the paths of the templates.
NullPointerException - if the flow is not found.String getFlowVariableType(String name)
Note that if several variables are defined, the first one is returned.
name - the name of the flow.
void setFlowVariableType(String name,
String type)
Note that all previously defined variables are replaced with the new one.
name - the name of the flow.type - the type of the variable.
NullPointerException - if the flow is not found.String[] getFlowVariableTypes(String name)
name - the name of the flow.
void setFlowVariableTypes(String name,
String[] types)
name - the name of the flow.types - the types of the variables.
NullPointerException - if the flow is not found.String getFlowActionName(String name)
Note that if several actions are defined, the first one is returned.
name - the name of the flow.
void setFlowActionName(String name,
String task)
Note that all previously defined actions are replaced with the new one.
name - the name of the flow.task - the name of the action.
NullPointerException - if the flow is not found.String[] getFlowActionNames(String name)
name - the name of the flow.
void setFlowActionNames(String name,
String[] tasks)
name - the name of the flow.tasks - the names of the actions.
NullPointerException - if the flow is not found.
boolean isFlowState(String name,
String state)
name - the name of the flow.state - the name of the state.
void setFlowState(String name,
String state,
boolean flag)
name - the name of the flow.state - the name of the state.flag - true if the state is on, false otherwise.
NullPointerException - if the flow is not f