UM Java API 6.17.1

- Main Page
- Related Pages
- Classes

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
com.latencybusters.lbm.sdm.LBMSDMessage Class Reference
Inheritance diagram for com.latencybusters.lbm.sdm.LBMSDMessage:

## Public Member Functions
| LBMSDMessage ()
| LBMSDMessage (LBMSDMFieldsAttribute user_attr)
| LBMSDMessage (LBMSDMFields args)
void | set (LBMSDMFields args)
void | set (LBMSDMField newfield) throws LBMSDMException
void | set (LBMSDMField newfield, int fieldidx) throws LBMSDMException
void | set (LBMSDMField newfield, int fieldidx, int arrayidx) throws LBMSDMException
LBMSDMFields | get_fset ()
LBMSDMFieldsAttribute | get_attr ()
void | add (LBMSDMField f) throws LBMSDMException
void | remove (int pos)
void | remove (String name)
void | parse (byte[] buf, int offset) throws LBMSDMException
void | parse (byte[] buf) throws LBMSDMException
byte[] | data () throws IndexOutOfBoundsException,LBMSDMException
String | toDbgString ()
String | toString ()
LBMSDMessage | clone () throws CloneNotSupportedException
boolean | test_clone (LBMSDMessage m) throws LBMSDMException
LBMSDMField | locate (String name)
int | count ()
int | length () throws IndexOutOfBoundsException,LBMSDMException
LBMSDMField | get (int pos)
void | set_debug_level (int level)
void | log (String s)

## Static Public Attributes
static final int | DEBUG_BASIC = 1
static final int | DEBUG_VERBOSE_PARSING = 2

## Protected Attributes
int | debug_level = 0

## Detailed Description

LBMSDMessage is the main class for managing an LBM SDM message. It heavily relies on class LBMSDMFields to collect LBMSDMField and LBMSDMArray classes in to a message. LBMSDMessage is the primary interface for applications.

## Constructor & Destructor Documentation

com.latencybusters.lbm.sdm.LBMSDMessage.LBMSDMessage | ( |  | ) |

Create an empty SDM message

Referenced by com.latencybusters.lbm.sdm.LBMSDMessage.clone().

com.latencybusters.lbm.sdm.LBMSDMessage.LBMSDMessage | ( | LBMSDMFieldsAttribute | user_attr | ) |

Create an empty SDM message using a field set attribute

Parameters

  user_attr | A field set attribute object

com.latencybusters.lbm.sdm.LBMSDMessage.LBMSDMessage | ( | LBMSDMFields | args | ) |

Create an SDM message with a predefined set of fields

Parameters

  args | The set of fields to be added to the SDM message

## Member Function Documentation

void com.latencybusters.lbm.sdm.LBMSDMessage.add | ( | LBMSDMField | f | ) | throws LBMSDMException

Add a field to a message - the field set will be automatically created if needed

Parameters

  f | The LBMSDMField object to be added

References com.latencybusters.lbm.sdm.LBMSDMFields.add().

LBMSDMessage com.latencybusters.lbm.sdm.LBMSDMessage.clone | ( |  | ) | throws CloneNotSupportedException

Clone an SDM message

Exceptions

  CloneNotSupportedException | which should not happen :-)

Returns
  A complete clone of the message

References com.latencybusters.lbm.sdm.LBMSDMFields.clone(), com.latencybusters.lbm.sdm.LBMSDMessage.clone(), and com.latencybusters.lbm.sdm.LBMSDMessage.LBMSDMessage().

Referenced by com.latencybusters.lbm.sdm.LBMSDMessage.clone(), com.latencybusters.lbm.sdm.LBMSDMFieldMessage.set(), and com.latencybusters.lbm.sdm.LBMSDMArrayMessage.set().

int com.latencybusters.lbm.sdm.LBMSDMessage.count | ( |  | ) |

Count the number of fields in a message

Returns
  The number of fields in the message

References com.latencybusters.lbm.sdm.LBMSDMFields.length().

Referenced by com.latencybusters.lbm.sdm.LBMSDMessage.parse().

byte [] com.latencybusters.lbm.sdm.LBMSDMessage.data | ( |  | ) | throws IndexOutOfBoundsException,LBMSDMException

Get a byte buffer (array) to a raw SDM message in network order. This buffer can be transmitted, for example via a socket

Exceptions

  IndexOutOfBoundsException | if the byte buffer can not be build
  LBMSDMException | when an unexpected error occurs within LBMSDM

Returns
  A byte buffer containing a network ordered raw SDM message

References com.latencybusters.lbm.sdm.LBMSDM.debug_level, com.latencybusters.lbm.sdm.LBMSDMRawUint32.format(), com.latencybusters.lbm.sdm.LBMSDMField.format(), com.latencybusters.lbm.sdm.LBMSDMField.format_name(), com.latencybusters.lbm.sdm.LBMSDMField.format_type(), com.latencybusters.lbm.sdm.LBMSDMField.get_len(), com.latencybusters.lbm.sdm.LBMSDMField.get_name(), com.latencybusters.lbm.sdm.LBMSDMFieldIterator.hasNext(), com.latencybusters.lbm.sdm.LBMSDMRawUint32.length, com.latencybusters.lbm.sdm.LBMSDMFields.length(), com.latencybusters.lbm.sdm.LBMSDMField.name_len(), com.latencybusters.lbm.sdm.LBMSDMFieldIterator.next(), com.latencybusters.lbm.sdm.LBMSDMField.type, and com.latencybusters.lbm.sdm.LBMSDMField.type_len().

Referenced by com.latencybusters.lbm.sdm.LBMSDMFieldMessage.clone(), com.latencybusters.lbm.sdm.LBMSDMFieldMessage.format(), and com.latencybusters.lbm.sdm.LBMSDMFieldMessage.get_len().

LBMSDMField com.latencybusters.lbm.sdm.LBMSDMessage.get | ( | int | pos | ) |

Get a field by the index

Parameters

  pos | The index of the field required

Returns
  The LBMSDMField object

References com.latencybusters.lbm.sdm.LBMSDMFields.get().

Referenced by com.latencybusters.lbm.sdm.LBMSDMArrayMessage.set().

LBMSDMFieldsAttribute com.latencybusters.lbm.sdm.LBMSDMessage.get_attr | ( |  | ) |

Get the field set attributes are associated with this message A copy is returned

Returns
  LBMSDMFieldsAttribute object

References com.latencybusters.lbm.sdm.LBMSDMFields.get_attr().

LBMSDMFields com.latencybusters.lbm.sdm.LBMSDMessage.get_fset | ( |  | ) |

Get the field set that is associated with this message

Returns
  LBMSDMFields object

int com.latencybusters.lbm.sdm.LBMSDMessage.length | ( |  | ) | throws IndexOutOfBoundsException,LBMSDMException

Get the raw length of the message. This API will rebuild the message. It is more efficient to call data() and get the length of the returned array instead of calling data() and length()

Returns
  The number of bytes the message will use

Referenced by com.latencybusters.lbm.sdm.LBMSDMArrayMessage.append(), com.latencybusters.lbm.sdm.LBMSDMArrayMessage.clone(), com.latencybusters.lbm.sdm.LBMSDMFieldMessage.format(), com.latencybusters.lbm.sdm.LBMSDMArrayMessage.get_len(), and com.latencybusters.lbm.sdm.LBMSDMArrayMessage.LBMSDMArrayMessage().

LBMSDMField com.latencybusters.lbm.sdm.LBMSDMessage.locate | ( | String | name | ) |

Locate a field by name

Parameters

  name | Name of field being located

Returns
  The relevant LBMSDMField or null

References com.latencybusters.lbm.sdm.LBMSDMFields.locate().

void com.latencybusters.lbm.sdm.LBMSDM.log | ( | String | s | ) |
| inherited

Log an event. If debug level is set greater than 0, output to stderr

Referenced by com.latencybusters.lbm.sdm.LBMSDMFields.get_attr(), com.latencybusters.lbm.sdm.LBMSDMFields.LBMSDMFields(), com.latencybusters.lbm.sdm.LBMSDMFieldBlob.set(), com.latencybusters.lbm.sdm.LBMSDMFieldMessage.set(), com.latencybusters.lbm.sdm.LBMSDMFieldDecimal.set(), com.latencybusters.lbm.sdm.LBMSDMFieldTimestamp.set(), com.latencybusters.lbm.sdm.LBMSDMArrayDecimal.set(), and com.latencybusters.lbm.sdm.LBMSDMArrayUint64.set().

void com.latencybusters.lbm.sdm.LBMSDMessage.parse | ( | byte [] | buf,
|  | int | offset
| ) |  | throws LBMSDMException

Parse a byte buffer containing a raw SDM message (as received on a socket) to fill the SDM message object. The byte buffer must be in network order

Parameters

  buf | The byte array (buffer) containing the raw SDM message to be parsed
  offset | The index in the array where parsing should start

Exceptions

  LBMSDMException | if a problem occurs parsing the message buffer, for example if the message has bad data

References com.latencybusters.lbm.sdm.LBMSDMessage.count(), com.latencybusters.lbm.sdm.LBMSDM.debug_level, com.latencybusters.lbm.sdm.LBMSDMFieldUint16.get(), com.latencybusters.lbm.sdm.LBMSDMFieldString.get(), com.latencybusters.lbm.sdm.LBMSDMFieldUint32.get(), com.latencybusters.lbm.sdm.LBMSDMFieldUint32.parse(), com.latencybusters.lbm.sdm.LBMSDMFieldUint16.parse(), com.latencybusters.lbm.sdm.LBMSDMField.parse(), com.latencybusters.lbm.sdm.LBMSDMFieldString.parse_name(), com.latencybusters.lbm.sdm.LBMSDMField.toDbgString(), com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_BLOB, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_BOOLEAN, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_DECIMAL, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_DOUBLE, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_FLOAT, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_INT16, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_INT32, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_INT64, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_INT8, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_MESSAGE, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_STRING, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_TIMESTAMP, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_UINT16, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_UINT32, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_UINT64, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_UINT8, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_UNICODE, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_BLOB, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_BOOLEAN, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_DECIMAL, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_DOUBLE, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_FLOAT, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_INT16, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_INT32, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_INT64, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_INT8, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_MESSAGE, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_STRING, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_TIMESTAMP, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_UINT16, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_UINT32, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_UINT64, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_UINT8, and com.latencybusters.lbm.sdm.LBMSDMField.TYPE_UNICODE.

Referenced by com.latencybusters.lbm.sdm.LBMSDMFieldMessage.clone(), com.latencybusters.lbm.sdm.LBMSDMFieldMessage.parse(), and com.latencybusters.lbm.sdm.LBMSDMessage.parse().

void com.latencybusters.lbm.sdm.LBMSDMessage.parse | ( | byte [] | buf | ) | throws LBMSDMException

Parse a byte buffer containing a raw SDM message (as received on a socket) to fill the SDM message object. The byte buffer must be in network order

Parameters

  buf | The byte array (buffer) containing the raw SDM message to be parsed

Exceptions

  LBMSDMException | if a problem occurs parsing the message buffer for example if the message has bad data

References com.latencybusters.lbm.sdm.LBMSDMessage.parse().

void com.latencybusters.lbm.sdm.LBMSDMessage.remove | ( | int | pos | ) |

Remove a field by specifying the index

Parameters

  pos | The index of the field

References com.latencybusters.lbm.sdm.LBMSDMFields.remove().

void com.latencybusters.lbm.sdm.LBMSDMessage.remove | ( | String | name | ) |

Remove a field by specifying the name

Parameters

  name | The field name to be removed

References com.latencybusters.lbm.sdm.LBMSDMFields.remove().

void com.latencybusters.lbm.sdm.LBMSDMessage.set | ( | LBMSDMFields | args | ) |

Add to the SDM message a set of fields. This copies the reference, so the caller must retain the field set until the message no longer needs the field set.

Parameters

  args | The set of fields to be added to the SDM message

See also
  LBMSDMFields

void com.latencybusters.lbm.sdm.LBMSDMessage.set | ( | LBMSDMField | newfield | ) | throws LBMSDMException

Set an SDM message field. The field name must exist already.

Parameters

  newfield | The new field

Exceptions

  LBMSDMAddingFieldException | when the field doesn't exist

References com.latencybusters.lbm.sdm.LBMSDMFields.set().

void com.latencybusters.lbm.sdm.LBMSDMessage.set | ( | LBMSDMField | newfield,
|  | int | fieldidx
| ) |  | throws LBMSDMException

Set an SDM message field based on the message element index. The field must exist already.

Parameters

  newfield | The new field
  fieldidx | The field index in the message

Exceptions

  LBMSDMAddingFieldException | when the field doesn't exist

References com.latencybusters.lbm.sdm.LBMSDMFields.set().

void com.latencybusters.lbm.sdm.LBMSDMessage.set | ( | LBMSDMField | newfield,
|  | int | fieldidx,
|  | int | arrayidx
| ) |  | throws LBMSDMException

Set an SDM message field based on the message element index and the array index.

Parameters

  newfield | The new field
  fieldidx | The field index in the message
  arrayidx | The array index in the field

Exceptions

  LBMSDMAddingFieldException | when the field doesn't exist

References com.latencybusters.lbm.sdm.LBMSDMFields.set().

void com.latencybusters.lbm.sdm.LBMSDM.set_debug_level | ( | int | level | ) |
| inherited

Set the debug level for processing this SDM message. Currently all debugs go to standard out.

boolean com.latencybusters.lbm.sdm.LBMSDMessage.test_clone | ( | LBMSDMessage | m | ) | throws LBMSDMException

An api that is used during testing to ensure that cloned objects are truly cloned. This API is not for general use.

Parameters

  m | An SDM message object to test against this object

Returns
  true if fields are identical (should not be if correctly cloned)

String com.latencybusters.lbm.sdm.LBMSDMessage.toDbgString | ( |  | ) |

Dump an internal (ascii) representation of this message

Returns
  A string containing the message

References com.latencybusters.lbm.sdm.LBMSDMFields.toDbgString().

Referenced by com.latencybusters.lbm.sdm.LBMSDMFieldMessage.toDbgString().

String com.latencybusters.lbm.sdm.LBMSDMessage.toString | ( |  | ) |

Dump a string (ascii) representation of this message

Returns
  A string containing the message

References com.latencybusters.lbm.sdm.LBMSDMFields.toDbgString().

## Member Data Documentation

final int com.latencybusters.lbm.sdm.LBMSDM.DEBUG_BASIC = 1
| static inherited

Debug flag for basic debug output

int com.latencybusters.lbm.sdm.LBMSDM.debug_level = 0
| protected inherited

Debug mask for SDM implementation.

See also
  set_debug_level

Referenced by com.latencybusters.lbm.sdm.LBMSDMessage.data(), com.latencybusters.lbm.sdm.LBMSDMessage.parse(), com.latencybusters.lbm.sdm.LBMSDMFieldMessage.parse(), and com.latencybusters.lbm.sdm.LBMSDMArrayMessage.parse().

final int com.latencybusters.lbm.sdm.LBMSDM.DEBUG_VERBOSE_PARSING = 2
| static inherited

Debug flag for verbose message parsing output

The documentation for this class was generated from the following file:

- LBMSDMessage.java