SunSPOT host API V3.0


com.sun.spot.client.command
Interface ISpotClientCommand

All Known Implementing Classes:
AbstractClientCommand, BlinkCommand, DeletePublicKeyCommand, DeleteSystemPropertyCommand, FlashAppCommand, FlashBootloaderCommand, FlashBootstrapCommand, FlashConfigCommand, FlashLibCommand, FlashManufacturingImageCommand, FlashVMCommand, GetCmdLineParamsCommand, GetFATCommand, GetSystemPropertiesCommand, HelloCommand, InfoCommand, QuitCommand, ReadConfigPageCommand, ReadSectorCommand, ResetConfigPageCommand, ResetFATCommand, ResetLibCommand, ResetSystemPropertiesCommand, SetCmdLineParamsCommand, SetPublicKeyCommand, SetSerialNumberCommand, SetSlowStartupCommand, SetSystemPropertyCommand, SetTimeCommand, StartAppCommand, SynchronizeCommand

public interface ISpotClientCommand

ISpotClientCommand A command that can be executed by the SpotClient infrastructure.


Field Summary
static int SIGNATURE_BOOLEAN
          Return value for getSignature() to show a command that has one boolean argument
static int SIGNATURE_INT
          Return value for getSignature() to show a command that has one integer argument
static int SIGNATURE_LONG
          Return value for getSignature() to show a command that has one long argument
static int SIGNATURE_NOTHING
          Return value for getSignature() to show a command that has no arguments
static int SIGNATURE_OPTIONAL_SECOND_STRING
          Return value for getSignature() to show a command that has one required String argument and a second optional argument that may be null
static int SIGNATURE_OPTIONAL_STRING
          Return value for getSignature() to show a command that has one String argument that may be null
static int SIGNATURE_STRING
          Return value for getSignature() to show a command that has one String argument
static int SIGNATURE_THREE_STRINGS
          Return value for getSignature() to show a command that has three String arguments
static int SIGNATURE_TWO_STRINGS
          Return value for getSignature() to show a command that has two String arguments
 
Method Summary
 Object execute(ISpotClientCommandHelper helper)
          If the receiver's getSignature() is SIGNATURE_NOTHING then execute the command, otherwise throw an IllegalStateException
 Object execute(ISpotClientCommandHelper helper, boolean arg0)
          If the receiver's getSignature() is SIGNATURE_BOOLEAN then execute the command, otherwise throw an IllegalStateException
 Object execute(ISpotClientCommandHelper helper, int arg0)
          If the receiver's getSignature() is SIGNATURE_INT then execute the command, otherwise throw an IllegalStateException
 Object execute(ISpotClientCommandHelper helper, long arg0)
          If the receiver's getSignature() is SIGNATURE_LONG then execute the command, otherwise throw an IllegalStateException
 Object execute(ISpotClientCommandHelper helper, String arg0)
          If the receiver's getSignature() is SIGNATURE_STRING or SIGNATURE_OPTIONAL_STRING then execute the command, otherwise throw an IllegalStateException
 Object execute(ISpotClientCommandHelper helper, String arg0, String arg1)
          If the receiver's getSignature() is SIGNATURE_TWO_STRINGS then execute the command, otherwise throw an IllegalStateException
 Object execute(ISpotClientCommandHelper helper, String arg0, String arg1, String arg2)
          If the receiver's getSignature() is SIGNATURE_THREE_STRINGS then execute the command, otherwise throw an IllegalStateException
 String getName()
           
 int getSignature()
          Answer the signature for execution of the command (see various constants SIGNATURE_...)
 String getUsage()
           
 

Field Detail

SIGNATURE_NOTHING

static final int SIGNATURE_NOTHING
Return value for getSignature() to show a command that has no arguments

See Also:
Constant Field Values

SIGNATURE_INT

static final int SIGNATURE_INT
Return value for getSignature() to show a command that has one integer argument

See Also:
Constant Field Values

SIGNATURE_LONG

static final int SIGNATURE_LONG
Return value for getSignature() to show a command that has one long argument

See Also:
Constant Field Values

SIGNATURE_BOOLEAN

static final int SIGNATURE_BOOLEAN
Return value for getSignature() to show a command that has one boolean argument

See Also:
Constant Field Values

SIGNATURE_STRING

static final int SIGNATURE_STRING
Return value for getSignature() to show a command that has one String argument

See Also:
Constant Field Values

SIGNATURE_OPTIONAL_STRING

static final int SIGNATURE_OPTIONAL_STRING
Return value for getSignature() to show a command that has one String argument that may be null

See Also:
Constant Field Values

SIGNATURE_TWO_STRINGS

static final int SIGNATURE_TWO_STRINGS
Return value for getSignature() to show a command that has two String arguments

See Also:
Constant Field Values

SIGNATURE_THREE_STRINGS

static final int SIGNATURE_THREE_STRINGS
Return value for getSignature() to show a command that has three String arguments

See Also:
Constant Field Values

SIGNATURE_OPTIONAL_SECOND_STRING

static final int SIGNATURE_OPTIONAL_SECOND_STRING
Return value for getSignature() to show a command that has one required String argument and a second optional argument that may be null

See Also:
Constant Field Values
Method Detail

execute

Object execute(ISpotClientCommandHelper helper)
               throws SpotClientException,
                      IOException
If the receiver's getSignature() is SIGNATURE_NOTHING then execute the command, otherwise throw an IllegalStateException

Parameters:
helper - TODO
Returns:
the result of the execution
Throws:
SpotClientException
IOException

execute

Object execute(ISpotClientCommandHelper helper,
               int arg0)
               throws SpotClientException,
                      IOException
If the receiver's getSignature() is SIGNATURE_INT then execute the command, otherwise throw an IllegalStateException

Parameters:
helper - TODO
Returns:
the result of the execution
Throws:
SpotClientException
IOException

execute

Object execute(ISpotClientCommandHelper helper,
               long arg0)
               throws SpotClientException,
                      IOException
If the receiver's getSignature() is SIGNATURE_LONG then execute the command, otherwise throw an IllegalStateException

Parameters:
helper - TODO
Returns:
the result of the execution
Throws:
SpotClientException
IOException

execute

Object execute(ISpotClientCommandHelper helper,
               boolean arg0)
               throws SpotClientException,
                      IOException
If the receiver's getSignature() is SIGNATURE_BOOLEAN then execute the command, otherwise throw an IllegalStateException

Parameters:
helper - TODO
Returns:
the result of the execution
Throws:
SpotClientException
IOException

execute

Object execute(ISpotClientCommandHelper helper,
               String arg0)
               throws SpotClientException,
                      IOException
If the receiver's getSignature() is SIGNATURE_STRING or SIGNATURE_OPTIONAL_STRING then execute the command, otherwise throw an IllegalStateException

Parameters:
helper - TODO
Returns:
the result of the execution
Throws:
SpotClientException
IOException

execute

Object execute(ISpotClientCommandHelper helper,
               String arg0,
               String arg1)
               throws SpotClientException,
                      IOException
If the receiver's getSignature() is SIGNATURE_TWO_STRINGS then execute the command, otherwise throw an IllegalStateException

Parameters:
helper - TODO
Returns:
the result of the execution
Throws:
SpotClientException
IOException

execute

Object execute(ISpotClientCommandHelper helper,
               String arg0,
               String arg1,
               String arg2)
               throws SpotClientException,
                      IOException
If the receiver's getSignature() is SIGNATURE_THREE_STRINGS then execute the command, otherwise throw an IllegalStateException

Parameters:
helper - TODO
Returns:
the result of the execution
Throws:
SpotClientException
IOException

getSignature

int getSignature()
Answer the signature for execution of the command (see various constants SIGNATURE_...)

Returns:
the signature identifier

getName

String getName()
Returns:
the command name

getUsage

String getUsage()
Returns:
a description of how to use the command

SunSPOT host API V3.0


Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.