1.0.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, UdpMessage

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. How do you code up a MessageService you may ask. Generally this is done using the Device Generation Tool This tool allows you to describe the hardware device specification in XML and then run the tool, never having to code up a MessageService yourself. If you still don't want to use the tool, go consult the oracle, maybe you'll have it figured out by the time you finish that cookie. Just remember there is no spoon. Where "the oracle" is the source code for Transport Kit, "finish the cookie" is a vailed reference to actually reading the source, and "the spoon" represents documentation of any kind.

Version:
1.0.0
See Also:
Message, 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 min 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)
           
 java.lang.Object decodeMessage(MessageService messageService, ParameterService parameter)
           
 MessageService encodeMessage(MessageService messageService, java.lang.Object value)
           
 MessageService encodeMessage(MessageService messageService, ParameterService parameter, java.lang.Object value)
           
 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 paramater 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 min 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:
- href="java.lang.CloneNotSupportedException.html">CloneNotSupportedException Thrown if the CloneNotSupportedException exception condition occurs.
java.lang.CloneNotSupportedException

decodeMessage

java.lang.Object decodeMessage(MessageService messageService)
Parameters:
messageService - The message to decode.
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)
Parameters:
messageService - The message to decode.
parameter - The parameter to decode or null.
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)
Parameters:
messageService - The message to be encoded.
value - The value to be encoded.
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)
Parameters:
messageService - The message to be encoded.
parameter - The parameter to be encoded.
value - The value of the parameter to be encoded.
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 - java.lang.Object
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 zero based byte index.
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. This is tne number of bits in the data section of the message. For simple messages, this is the number of bits in the message.

Returns:
The data length (int) value.

getDataOffset

int getDataOffset()
Gets the data offset (int) value. This is the starting bit offset of the data section. For simple messages, this is the zero.

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 paramater 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 - org.eclipse.soda.dk.message.service.MessageService
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 - java.lang.Object
value - java.lang.Object

setByte

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

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

Parameters:
index - int
data - byte
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()

1.0.0

Copyright (c) 1999, 2007 IBM