org.talika.tarsis.command
Class CommandImpl

java.lang.Object
  extended by org.talika.tarsis.command.CommandImpl
All Implemented Interfaces:
Command

public final class CommandImpl
extends java.lang.Object
implements Command

Implementation of Command interface.

Version:
$Revision: 121 $
Author:
Jose M. Palomar

Field Summary
 
Fields inherited from interface org.talika.tarsis.command.Command
PACKAGE_SEPARATOR, STATEFULL, STATELESS
 
Constructor Summary
CommandImpl(java.lang.String name, java.lang.String pak)
          Constructs a new CommandImpl object with specified name and package.
CommandImpl(java.lang.String name, java.lang.String pak, Action action, View[] views, View inputView, CommandParameter[] parameters, boolean cacheable, boolean duplicable, boolean validable, boolean secure, int type)
          Constructs a new CommandImpl object with specified parameters.
 
Method Summary
protected  void addParameter(CommandParameter parameter)
          Adds a parameter to command.
protected  void addParameters(java.util.Collection parameters)
          Adds a collection of parameters to command.
protected  void addView(View view)
          Adds a view to command.
 Action getAction()
          Returns action of command.
 View getDefaultView()
          Returns the default view of this command.
 java.lang.String getFullName()
          Returns full name of command.
 View getInputView()
          Returns the input view of command.
 java.lang.String getName()
          Returns name of command.
 java.lang.String getPackage()
          Returns package of command.
 CommandParameter[] getParameters()
          Returns an array with the parameters of 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.
protected  void setAction(Action action)
          Sets action of command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandImpl

public CommandImpl(java.lang.String name,
                   java.lang.String pak)
Constructs a new CommandImpl object with specified name and package.

Parameters:
name - String name of command.
pak - String package of command.

CommandImpl

public CommandImpl(java.lang.String name,
                   java.lang.String pak,
                   Action action,
                   View[] views,
                   View inputView,
                   CommandParameter[] parameters,
                   boolean cacheable,
                   boolean duplicable,
                   boolean validable,
                   boolean secure,
                   int type)
Constructs a new CommandImpl object with specified parameters.

Parameters:
name - String name of command.
pak - String package of command.
action - Action action of command.
views - View[] views of command.
inputView - View input view of command.
parameters - CommandParameter[] parameters of command.
cacheable - boolean can command be cached.
duplicable - boolean can command be duplicate.
validable - boolean must command be validated.
secure - boolean must command be invoked HTTPS.
type - int type of command.
Method Detail

getName

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

Specified by:
getName in interface Command
Returns:
String name of command.
See Also:
Command.getName()

getPackage

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

Specified by:
getPackage in interface Command
Returns:
String package of command.
See Also:
Command.getPackage()

getFullName

public java.lang.String getFullName()
Returns full name of command.

Specified by:
getFullName in interface Command
Returns:
String full name of command.
See Also:
Command.getFullName()

getAction

public Action getAction()
Returns action of command.

Specified by:
getAction in interface Command
Returns:
Action action of command.
See Also:
Command.getAction()

setAction

protected void setAction(Action action)
Sets action of command.

Parameters:
action - Action action instance to set.

getView

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

Specified by:
getView in interface Command
Parameters:
viewName - String name of view.
Returns:
View view of command with matching name.
See Also:
Command.getView(String)

getDefaultView

public View getDefaultView()
Returns the default view of this command.

Specified by:
getDefaultView in interface Command
Returns:
View default view of command.
See Also:
Command.getDefaultView()

getInputView

public View getInputView()
Returns the input view of command.

Specified by:
getInputView in interface Command
Returns:
View input view of command.
See Also:
Command.getInputView()

addView

protected void addView(View view)
Adds a view to command.

Parameters:
view - View view to be added.

getParameters

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

Specified by:
getParameters in interface Command
Returns:
CommandParameter[] parameters of command.
See Also:
Command.getParameters()

addParameter

protected void addParameter(CommandParameter parameter)
Adds a parameter to command.

Parameters:
parameter - CommandParameter parameter to be added.

addParameters

protected void addParameters(java.util.Collection parameters)
Adds a collection of parameters to command.

Parameters:
parameters - Collection collection of parameters to be added.

isCacheable

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

Specified by:
isCacheable in interface Command
Returns:
boolean true if the command response can be cached by browsers.
See Also:
Command.isCacheable()

isDuplicable

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

Specified by:
isDuplicable in interface Command
Returns:
boolean true if the command can be repeated with same sync ticket.
See Also:
Command.isDuplicable()

isValidable

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

Specified by:
isValidable in interface Command
Returns:
boolean true if command parameters must be validated.
See Also:
Command.isValidable()

isSecure

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

Specified by:
isSecure in interface Command
Returns:
boolean true if command parameters must be executed in secure mode (HTTPS).
See Also:
Command.isSecure()

getType

public int getType()
Returns the type of command.

Specified by:
getType in interface Command
Returns:
int type of command.
See Also:
Command.getType()


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