SunSPOT host API V3.0


com.sun.spot.client.command
Class AbstractClientCommand

java.lang.Object
  extended by com.sun.spot.client.command.AbstractClientCommand
All Implemented Interfaces:
ISpotClientCommand
Direct Known Subclasses:
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 abstract class AbstractClientCommand
extends Object
implements ISpotClientCommand

AbstractClientCommand helper for implementing ISpotClientCommands that ensures that the wrong execute signature cannot be called. We assume that concrete ISpotClientCommands will only override the signature that they implement.


Field Summary
 
Fields inherited from interface com.sun.spot.client.command.ISpotClientCommand
SIGNATURE_BOOLEAN, SIGNATURE_INT, SIGNATURE_LONG, SIGNATURE_NOTHING, SIGNATURE_OPTIONAL_SECOND_STRING, SIGNATURE_OPTIONAL_STRING, SIGNATURE_STRING, SIGNATURE_THREE_STRINGS, SIGNATURE_TWO_STRINGS
 
Constructor Summary
AbstractClientCommand()
           
 
Method Summary
static void assertThat(boolean b, String msg)
           
 Object execute(ISpotClientCommandHelper helper)
          If the receiver's ISpotClientCommand.getSignature() is ISpotClientCommand.SIGNATURE_NOTHING then execute the command, otherwise throw an IllegalStateException
 Object execute(ISpotClientCommandHelper helper, boolean arg0)
          If the receiver's ISpotClientCommand.getSignature() is ISpotClientCommand.SIGNATURE_BOOLEAN then execute the command, otherwise throw an IllegalStateException
 Object execute(ISpotClientCommandHelper helper, int arg0)
          If the receiver's ISpotClientCommand.getSignature() is ISpotClientCommand.SIGNATURE_INT then execute the command, otherwise throw an IllegalStateException
 Object execute(ISpotClientCommandHelper helper, long arg0)
          If the receiver's ISpotClientCommand.getSignature() is ISpotClientCommand.SIGNATURE_LONG then execute the command, otherwise throw an IllegalStateException
 Object execute(ISpotClientCommandHelper helper, String arg0)
          If the receiver's ISpotClientCommand.getSignature() is ISpotClientCommand.SIGNATURE_STRING or ISpotClientCommand.SIGNATURE_OPTIONAL_STRING then execute the command, otherwise throw an IllegalStateException
 Object execute(ISpotClientCommandHelper helper, String arg0, String arg1)
          If the receiver's ISpotClientCommand.getSignature() is ISpotClientCommand.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 ISpotClientCommand.getSignature() is ISpotClientCommand.SIGNATURE_THREE_STRINGS then execute the command, otherwise throw an IllegalStateException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.spot.client.command.ISpotClientCommand
getName, getSignature, getUsage
 

Constructor Detail

AbstractClientCommand

public AbstractClientCommand()
Method Detail

execute

public Object execute(ISpotClientCommandHelper helper)
               throws SpotClientException,
                      IOException
Description copied from interface: ISpotClientCommand
If the receiver's ISpotClientCommand.getSignature() is ISpotClientCommand.SIGNATURE_NOTHING then execute the command, otherwise throw an IllegalStateException

Specified by:
execute in interface ISpotClientCommand
Parameters:
helper - TODO
Returns:
the result of the execution
Throws:
SpotClientException
IOException

execute

public Object execute(ISpotClientCommandHelper helper,
                      int arg0)
               throws SpotClientException,
                      IOException
Description copied from interface: ISpotClientCommand
If the receiver's ISpotClientCommand.getSignature() is ISpotClientCommand.SIGNATURE_INT then execute the command, otherwise throw an IllegalStateException

Specified by:
execute in interface ISpotClientCommand
Parameters:
helper - TODO
Returns:
the result of the execution
Throws:
SpotClientException
IOException

execute

public Object execute(ISpotClientCommandHelper helper,
                      long arg0)
               throws SpotClientException,
                      IOException
Description copied from interface: ISpotClientCommand
If the receiver's ISpotClientCommand.getSignature() is ISpotClientCommand.SIGNATURE_LONG then execute the command, otherwise throw an IllegalStateException

Specified by:
execute in interface ISpotClientCommand
Parameters:
helper - TODO
Returns:
the result of the execution
Throws:
SpotClientException
IOException

execute

public Object execute(ISpotClientCommandHelper helper,
                      boolean arg0)
               throws SpotClientException,
                      IOException
Description copied from interface: ISpotClientCommand
If the receiver's ISpotClientCommand.getSignature() is ISpotClientCommand.SIGNATURE_BOOLEAN then execute the command, otherwise throw an IllegalStateException

Specified by:
execute in interface ISpotClientCommand
Parameters:
helper - TODO
Returns:
the result of the execution
Throws:
SpotClientException
IOException

execute

public Object execute(ISpotClientCommandHelper helper,
                      String arg0)
               throws SpotClientException,
                      IOException
Description copied from interface: ISpotClientCommand
If the receiver's ISpotClientCommand.getSignature() is ISpotClientCommand.SIGNATURE_STRING or ISpotClientCommand.SIGNATURE_OPTIONAL_STRING then execute the command, otherwise throw an IllegalStateException

Specified by:
execute in interface ISpotClientCommand
Parameters:
helper - TODO
Returns:
the result of the execution
Throws:
SpotClientException
IOException

execute

public Object execute(ISpotClientCommandHelper helper,
                      String arg0,
                      String arg1)
               throws SpotClientException,
                      IOException
Description copied from interface: ISpotClientCommand
If the receiver's ISpotClientCommand.getSignature() is ISpotClientCommand.SIGNATURE_TWO_STRINGS then execute the command, otherwise throw an IllegalStateException

Specified by:
execute in interface ISpotClientCommand
Parameters:
helper - TODO
Returns:
the result of the execution
Throws:
SpotClientException
IOException

execute

public Object execute(ISpotClientCommandHelper helper,
                      String arg0,
                      String arg1,
                      String arg2)
               throws SpotClientException,
                      IOException
Description copied from interface: ISpotClientCommand
If the receiver's ISpotClientCommand.getSignature() is ISpotClientCommand.SIGNATURE_THREE_STRINGS then execute the command, otherwise throw an IllegalStateException

Specified by:
execute in interface ISpotClientCommand
Parameters:
helper - TODO
Returns:
the result of the execution
Throws:
SpotClientException
IOException

assertThat

public static void assertThat(boolean b,
                              String msg)

SunSPOT host API V3.0


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