public abstract class ControlMessage extends WireMessageGeneric representation for a control wire message: that is, a message which does not handle any form of start-up, but reather general communications.
Static Methods
create(ConnectionHandler connection)
public static ControlMessage create(ConnectionHandler connection)Factory method to create the message from the specific command type char.
| Parameter | |
|---|---|
| Name | Description |
connection |
ConnectionHandlerThe connection handler object setup with the ability to send/receive. |
| Returns | |
|---|---|
| Type | Description |
ControlMessage |
The constructed wire message given the input message. |
| Exceptions | |
|---|---|
| Type | Description |
Exception |
If construction or reading fails. |
getFormatCodes(DataInputStream input)
protected static List<Short> getFormatCodes(DataInputStream input)Extract format codes from message (useful for both input and output format codes).
| Parameter | |
|---|---|
| Name | Description |
input |
DataInputStreamThe data stream containing the user request. |
| Returns | |
|---|---|
| Type | Description |
List<Short> |
A list of format codes. |
| Exceptions | |
|---|---|
| Type | Description |
Exception |
If reading fails in any way. |
Constructors
ControlMessage(ConnectionHandler connection)
public ControlMessage(ConnectionHandler connection)| Parameter | |
|---|---|
| Name | Description |
connection |
ConnectionHandler |
ControlMessage(ConnectionHandler connection, int length, ControlMessage.ManuallyCreatedToken token)
protected ControlMessage(ConnectionHandler connection, int length, ControlMessage.ManuallyCreatedToken token)Constructor for manually created Control messages.
| Parameters | |
|---|---|
| Name | Description |
connection |
ConnectionHandler |
length |
int |
token |
ControlMessage.ManuallyCreatedToken |
Methods
handleError(Exception exception)
protected void handleError(Exception exception)Takes an Exception Object and relates its results to the user within the client.
| Parameter | |
|---|---|
| Name | Description |
exception |
ExceptionThe exception to be related. |
| Exceptions | |
|---|---|
| Type | Description |
Exception |
if there is some issue in the sending of the error messages. |
isExtendedProtocol()
public boolean isExtendedProtocol()| Returns | |
|---|---|
| Type | Description |
boolean |
|