Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 3.4.1 generated on May 30 2006
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.solarmetric.remote
Class Command

    java.lang.Object
      |
      +--com.solarmetric.remote.Command

public abstract class Command
extends Object

Base class for commands sent from the client to the server. Each command object encompasses the command state, the execution logic, and the server's response.

Constructor Summary
`Command()`

Method Summary
`abstract void` | `execute(Object context)` Execute this command using the given context.
`long` | `getClientId()` The server-assigned id of the client sending the command.
`boolean` | `hasResponse()` Whether this command uses a response.
`protected void` | `read(ObjectInput in)` Read in the state of the sent command from the given stream.
`protected void` | `readResponse(ObjectInput in)` Read the server's response to this command.
`void` | `setClientId(long id)` The server-assigned id of the client sending the command.
`void` | `setHasResponse(boolean response)` Whether this command uses a response.
`String` | `toString()`
`protected void` | `write(ObjectOutput out)` Write this command to the given stream.
`protected void` | `writeResponse(ObjectOutput out)` Write the server's response to this command.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### Command

    public Command()

Method Detail

### setClientId

    public void setClientId(long id)

  The server-assigned id of the client sending the command.

### getClientId

    public long getClientId()

  The server-assigned id of the client sending the command.

### hasResponse

    public boolean hasResponse()

  Whether this command uses a response. Defaults to true. Note that if a command does not use a response, we cannot send back errors that may have occurred when executing the command.

### setHasResponse

    public void setHasResponse(boolean response)

  Whether this command uses a response. Defaults to true. Note that if a command does not use a response, we cannot send back errors that may have occurred when executing the command.

### execute

    public abstract void execute(Object context)
                          throws Exception

  Execute this command using the given context.

### read

    protected void read(ObjectInput in)
                 throws Exception

  Read in the state of the sent command from the given stream. Does nothing by default.

### write

    protected void write(ObjectOutput out)
                  throws Exception

  Write this command to the given stream. Does nothing by default.

### readResponse

    protected void readResponse(ObjectInput in)
                         throws Exception

  Read the server's response to this command. Does nothing by default.

### writeResponse

    protected void writeResponse(ObjectOutput out)
                          throws Exception

  Write the server's response to this command. Does nothing by default.

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 3.4.1 generated on May 30 2006
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.