2009-01-09 1.2.0

org.eclipse.soda.dk.message.service
Interface MessageService

All Superinterfaces:
java.lang.Cloneable
All Known Subinterfaces:
ResponseMessageService
All Known Implementing Classes:
AsciiCrlfMessage, AsciiMessage, AsciiResponseMessage, FilterMessage, Message, Messages, ParameterMessage, ResponseMessage, SimpleResponseMessage, TokenMessage, TokenReceivedMessage

public interface MessageService
extends java.lang.Cloneable

The MessageService interface defines the MessageService concept. A MessageService is a collection of bytes. A MessageService may also contain Parameters(see the ParameterService Interface). Messages may have a Priority which can be used by a Transport which cares about Priority in determining which message to send out next. Messages can compare themselves to other Messages for equality. Messages also know how to write themselves out on an OutputStream. Great, so they can do all those things, but what are they. Messages are the gem of all elements in the Transport Kit. A MessageService is a representation of a group of bits which can be sent or received by a hardware device. The bits of the hardware messages, are encoded in such a way as to specify where the data is contained within the hardware message and what scaling should be performed on this data. Essentially every hardware message that a device understands in described using Messages.

Since:
1.0
Version:
1.2.0
See Also:
Cloneable, ParameterService

Field Summary
static short HIGH_PRIORITY
          Define the high message priority value.
static short LOW_PRIORITY
          Define the low message priority value.
static short MAX_PRIORITY
          Define the max message priority value.
static short MIN_PRIORITY
          Define the minimum message priority value.
static short NORM_PRIORITY
          Define the normal message priority value.
static short STRING
          Define the STRING style.
static short THREAD_PRIORITY
          Define the default message priority value.
 
Method Summary
 java.lang.Object clone()
          Perform the clone method and return the Object result.
 java.lang.Object decodeMessage(MessageService messageService)
          Decode message with the specified message service parameter and return the Object result.
 java.lang.Object decodeMessage(MessageService messageService, ParameterService parameter)
          Decode message with the specified message service and parameter parameters and return the Object result.
 MessageService encodeMessage(MessageService messageService, java.lang.Object value)
          Encode message with the specified message service and value parameters and return the MessageService result.
 MessageService encodeMessage(MessageService messageService, ParameterService parameter, java.lang.Object value)
          Encode message with the specified message service, parameter and value parameters and return the MessageService result.
 java.lang.Object get(java.lang.Object key)
          Perform the get method and return the Object result.
 byte getByte(int index)
          Perform the getByte method and return the byte result.
 byte[] getBytes()
          Gets the complete byte array that for this message.
 byte[] getDataBytes()
          Gets the data byte array that for this message.
 int getDataLength()
          Gets the data length (int) value.
 int getDataOffset()
          Gets the data offset (int) value.
 int getPriority()
          Gets the message priority property value.
 ParameterService lookup(ParameterService parameter)
          Get the parameter based on the key parameter.
 MessageService matches(MessageService message)
          Perform the matches method and return the boolean result.
 void put(java.lang.Object key, java.lang.Object value)
          Perform the put action method.
 void setByte(int index, byte data)
          Perform the setByte action method.
 void setBytes(byte[] bytes)
          Gets the byte array that for this message.
 

Field Detail

MAX_PRIORITY

static final short MAX_PRIORITY
Define the max message priority value.

See Also:
Constant Field Values

HIGH_PRIORITY

static final short HIGH_PRIORITY
Define the high message priority value.

See Also:
Constant Field Values

STRING

static final short STRING
Define the STRING style.

See Also:
Constant Field Values

NORM_PRIORITY

static final short NORM_PRIORITY
Define the normal message priority value.

See Also:
Constant Field Values

LOW_PRIORITY

static final short LOW_PRIORITY
Define the low message priority value.

See Also:
Constant Field Values

MIN_PRIORITY

static final short MIN_PRIORITY
Define the minimum message priority value.

See Also:
Constant Field Values

THREAD_PRIORITY

static final short THREAD_PRIORITY
Define the default message priority value.

See Also:
Constant Field Values
Method Detail

clone

java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Perform the clone method and return the Object result.

Returns:
Results of the clone (Object) value.
Throws:
java.lang.CloneNotSupportedException - Clone Not Supported Exception.

decodeMessage

java.lang.Object decodeMessage(MessageService messageService)
Decode message with the specified message service parameter and return the Object result.

Parameters:
messageService - The message service (MessageService) parameter.
Returns:
Object The decoded value from the message.
See Also:
decodeMessage(MessageService,ParameterService), encodeMessage(MessageService,Object), encodeMessage(MessageService,ParameterService,Object)

decodeMessage

java.lang.Object decodeMessage(MessageService messageService,
                               ParameterService parameter)
Decode message with the specified message service and parameter parameters and return the Object result.

Parameters:
messageService - The message service (MessageService) parameter.
parameter - The parameter (ParameterService) parameter.
Returns:
Object The decoded value of the specified parameter from the message.
See Also:
decodeMessage(MessageService), encodeMessage(MessageService,Object), encodeMessage(MessageService,ParameterService,Object)

encodeMessage

MessageService encodeMessage(MessageService messageService,
                             java.lang.Object value)
Encode message with the specified message service and value parameters and return the MessageService result.

Parameters:
messageService - The message service (MessageService) parameter.
value - The value (Object) parameter.
Returns:
MessageService The message that has been encoded with the specified value.
See Also:
decodeMessage(MessageService), decodeMessage(MessageService,ParameterService), encodeMessage(MessageService,ParameterService,Object)

encodeMessage

MessageService encodeMessage(MessageService messageService,
                             ParameterService parameter,
                             java.lang.Object value)
Encode message with the specified message service, parameter and value parameters and return the MessageService result.

Parameters:
messageService - The message service (MessageService) parameter.
parameter - The parameter (ParameterService) parameter.
value - The value (Object) parameter.
Returns:
MessageService The message that has been encoded with the specified value.
See Also:
decodeMessage(MessageService), decodeMessage(MessageService,ParameterService), encodeMessage(MessageService,Object)

get

java.lang.Object get(java.lang.Object key)
Perform the get method and return the Object result.

Parameters:
key - The key (Object) parameter.
Returns:
Results of the get (Object) value.

getByte

byte getByte(int index)
Perform the getByte method and return the byte result.

Return the byte from the byte index (not bit offset).

Parameters:
index - The index (int) parameter.
Returns:
byte The byte at the specified byte index.
See Also:
setByte(int,byte)

getBytes

byte[] getBytes()
Gets the complete byte array that for this message.

Returns:
Results of the get bytes (byte[]) value.
See Also:
getDataBytes(), setBytes(byte[])

getDataBytes

byte[] getDataBytes()
Gets the data byte array that for this message.

Returns:
Results of the get data bytes (byte[]) value.

getDataLength

int getDataLength()
Gets the data length (int) value.

Returns:
The data length (int) value.

getDataOffset

int getDataOffset()
Gets the data offset (int) value.

Returns:
The data offset (int) value.

getPriority

int getPriority()
Gets the message priority property value.

Returns:
Results of the get priority (int) value.

lookup

ParameterService lookup(ParameterService parameter)
Get the parameter based on the key parameter.

Parameters:
parameter - The parameter (ParameterService) parameter.
Returns:
java.lang.Object The parameter based on the supplied key.

matches

MessageService matches(MessageService message)
Perform the matches method and return the boolean result.

Parameters:
message - The message (MessageService) parameter.
Returns:
MessageService Returns any message that matches or NULL.

put

void put(java.lang.Object key,
         java.lang.Object value)
Perform the put action method.

Parameters:
key - The key (Object) parameter.
value - The value (Object) parameter.

setByte

void setByte(int index,
             byte data)
Perform the setByte action method.

Set the byte using the byte index (not bit offset).

Parameters:
index - The index (int) parameter.
data - The data (byte) parameter.
See Also:
getByte(int)

setBytes

void setBytes(byte[] bytes)
Gets the byte array that for this message.

Parameters:
bytes - The bytes (byte[]) parameter.
See Also:
getBytes(), getDataBytes()

2009-01-09 1.2.0

Copyright (c) 2009 IBM. See license in Legal section.