org.talika.tarsis.command
Interface Command

All Known Implementing Classes:
CommandImpl

public interface Command

Interface that defines a command in Tarsis MVC Framework.

A command is defined by a bussines activity defined by a set of parameters it needs to be invoked, an action to be performed when it is invoked and a set of views to be forwarded when action is completed.

A command has a name which is used to inkove him and can be member of a package. Packages in Tarsis works same way that packages in Java and are usefull to group commands.

Version:
$Revision: 121 $
Author:
Jose M. Palomar
See Also:
CommandParameter, Action, View

Field Summary
static char PACKAGE_SEPARATOR
          Package separator.
static int STATEFULL
          Statefull command type.
static int STATELESS
          Stateless command type.
 
Method Summary
 Action getAction()
          Returns the Action of this command.
 View getDefaultView()
          Returns the default View of command.
 java.lang.String getFullName()
          Returns the fullname of command.
 View getInputView()
          Returns the input View instance of command.
 java.lang.String getName()
          Returns the name of command.
 java.lang.String getPackage()
          Returns the package of command.
 CommandParameter[] getParameters()
          Returns an array with the parameters of this command.
 int getType()
          Returns the type of command.
 View getView(java.lang.String viewName)
          Returns the View of command with matching name.
 boolean isCacheable()
          Returns true if the command response can be cached by browsers.
 boolean isDuplicable()
          Returns true if the command can be repeated with same sync ticket.
 boolean isSecure()
          Returns true if command parameters must be executed in secure mode (HTTPS).
 boolean isValidable()
          Returns true if command parameters must be validated.
 

Field Detail

PACKAGE_SEPARATOR

static final char PACKAGE_SEPARATOR
Package separator.

See Also:
Constant Field Values

STATELESS

static final int STATELESS
Stateless command type.

See Also:
Constant Field Values

STATEFULL

static final int STATEFULL
Statefull command type.

See Also:
Constant Field Values
Method Detail

getPackage

java.lang.String getPackage()
Returns the package of command.

Returns:
String package of command.

getName

java.lang.String getName()
Returns the name of command.

Returns:
String name of command.

getFullName

java.lang.String getFullName()
Returns the fullname of command. The fullname is package name + PACKAGE_SEPARATOR + name.

Returns:
String fullname of command.

getAction

Action getAction()
Returns the Action of this command.

Returns:
Action Action of this command.

getView

View getView(java.lang.String viewName)
Returns the View of command with matching name.

Parameters:
viewName - String name of view.
Returns:
View matching view or null.

getDefaultView

View getDefaultView()
Returns the default View of command. The default view is the view to be invoked when no other matching view has been found. The default view has a especial name defined in View interface.

Returns:
View default View instance of command.

getInputView

View getInputView()
Returns the input View instance of command. The input vew is the view from where the command is invoked.

Returns:
View input View instance of command.

getParameters

CommandParameter[] getParameters()
Returns an array with the parameters of this command.

Returns:
CommandParameter[] the parameter of this command.

isCacheable

boolean isCacheable()
Returns true if the command response can be cached by browsers.

Returns:
boolean true if the command response can be cached by browsers.

isDuplicable

boolean isDuplicable()
Returns true if the command can be repeated with same sync ticket.

Returns:
boolean true if the command can be repeated with same sync ticket.

isValidable

boolean isValidable()
Returns true if command parameters must be validated.

Returns:
boolean true if command parameters must be validated.

isSecure

boolean isSecure()
Returns true if command parameters must be executed in secure mode (HTTPS).

Returns:
boolean true if command parameters must be executed in secure mode (HTTPS).

getType

int getType()
Returns the type of command. Command types are STATELESS and STATEFULL.

Stateless commands doesn't store information between invokations and there is only one instance of his action that process all calls. Stateless works much like servlets or stateless session beans.

Statefull command mantains information between invokations. When and statefull command is invoked it searches in user's session for a created instance of his action and if not found creates a new one that is stored in user's session. This instance remains active for all user's session time.

Returns:
int type of command.


Copyright © 2002-2012 Talika Open Source Group. All Rights Reserved.