Package org.openas2.cmd
Class BaseCommand
- java.lang.Object
-
- org.openas2.BaseComponent
-
- org.openas2.cmd.BaseCommand
-
- Direct Known Subclasses:
AliasedCertCommand
,AliasedLoggingCommand
,AliasedPartnershipsCommand
,MultiCommand
,RefreshPartnershipsCommand
,StorePartnershipsCommand
public abstract class BaseCommand extends BaseComponent implements Command
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PARAM_DESCRIPTION
static java.lang.String
PARAM_NAME
static java.lang.String
PARAM_USAGE
-
Constructor Summary
Constructors Constructor Description BaseCommand()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract CommandResult
execute(java.lang.Object[] params)
abstract java.lang.String
getDefaultDescription()
abstract java.lang.String
getDefaultName()
abstract java.lang.String
getDefaultUsage()
java.lang.String
getDescription()
java.lang.String
getName()
Returns a name for the component.java.lang.String
getUsage()
void
init(Session session, java.util.Map<java.lang.String,java.lang.String> parameters)
Component lifecycle hook.void
setDescription(java.lang.String desc)
void
setName(java.lang.String name)
void
setUsage(java.lang.String usage)
-
Methods inherited from class org.openas2.BaseComponent
destroy, getParameter, getParameter, getParameterInt, getParameters, getSession, setParameter, setParameter
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openas2.cmd.Command
getSession
-
Methods inherited from interface org.openas2.Component
destroy, getParameters
-
-
-
-
Field Detail
-
PARAM_NAME
public static final java.lang.String PARAM_NAME
- See Also:
- Constant Field Values
-
PARAM_DESCRIPTION
public static final java.lang.String PARAM_DESCRIPTION
- See Also:
- Constant Field Values
-
PARAM_USAGE
public static final java.lang.String PARAM_USAGE
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init(Session session, java.util.Map<java.lang.String,java.lang.String> parameters) throws OpenAS2Exception
Description copied from interface:Component
Component lifecycle hook. After creating a Component object, this method should be called to set any parameters used by the component. Component implementations typically have required parameter checking and code to start timers and threads within this method.- Specified by:
init
in interfaceComponent
- Overrides:
init
in classBaseComponent
- Parameters:
session
- the component uses this object to access other componentsparameters
- configuration values for the component- Throws:
OpenAS2Exception
- If an error occurs while initializing the component- See Also:
Session
-
getDescription
public java.lang.String getDescription()
- Specified by:
getDescription
in interfaceCommand
-
setDescription
public void setDescription(java.lang.String desc)
- Specified by:
setDescription
in interfaceCommand
-
getName
public java.lang.String getName()
Description copied from interface:Component
Returns a name for the component. These names are not guaranteed to be unique, and are intended for display and logging. Generally this is the class name of the Component object, without package information.
-
getDefaultName
public abstract java.lang.String getDefaultName()
-
getDefaultDescription
public abstract java.lang.String getDefaultDescription()
-
getDefaultUsage
public abstract java.lang.String getDefaultUsage()
-
execute
public abstract CommandResult execute(java.lang.Object[] params)
-
-