Proposed Atlas Protocol Classes in UML Format (OBSOLETE)

Atlas Protocol and Implementation Proposal

Goals

  • to provide a transport transparent method for moving entity objects across a network
  • to provide an architecture for encoding and decoding transport data streams that is completely modular, facilitating the addition of new encoding and decoding systems as they are evolved
  • to provide both client and server support for managing connections, selecting encoding/decoding systems, and sending/recieving objects.

Components Required

AtlasAttribute

An AtlasAttribute represents the base data type of this Atlas2 protocol. The attribute is capable of containing integers, floating point numbers, strings, and lists. The list data type is implemented using the AtlasMessage object described below to hold any number of attributes of any type.

Constructors exist for all the data types and will set the internal data type of the attribute.

AtlasMessage

An AtlasMessage composed of a name and a list of AtlasAttributes. The AtlasMessage is the base class for all messaging operations performed using the Atlas2 protocol and classes.

AtlasProtocolEncoder (abstract class)

A protocol encoder takes an Atlas Object and produces a stream of data that represents that object suitable for transport over a network. Actual implementations of this class could possibly create XML, Packed ASCII, Binary, or ASCII Encoded Binary representations of an AtlasMessage object.

For example, an XML Encoding of an object with 2 attributes, one string, and one list, the list containing 2 integers, might look like:

and a Packed ASCII format might look like:

Message and Attribute names will only consist of letters, number and underscores

Protocol dependent characters in ASCII streams will be escaped using %XX hex encoding

The percent sign '%' will be represented in ASCII streams as '%%'

AtlasProtocolDecoder (abstract class)

A protocol decoder takes a stream of bytes and produces a list of tokens that will be used by an AtlasCodec object to reconstruct an AtlasMessage. The basic decoding mechanism has 3 steps, Buffering, Parsing, and Retrieval.

As data is received, the AtlasCodec object will pass the data to the protocol decoder without any modifications. After each block of data is buffered in the decoder, the AtlasCodec will ask if there is an AtlasToken available. The decoder will consult its internal state, examine the buffered data and decide if there is a complete token available. If a complete token is found, the AtlasCodec will request the AtlasToken type associated with the token. The decoder must at this time remove the token from the buffer, parse the token into the appropriate retrieval storage for the token type, and return the AtlasToken type to the AtlasCodec. The AtlasCodec will retrieve the parsed values associated with the token and use the values to reconstruct an AtlasMessage object.

There are 4 types of AtlasToken, the MSGBEG and MSGEND tokens which delimit a message, and the ATRBEG and ATREND tokens which delimit attributes associated with this message, and lastly the ATRVAL token which indicates the value of an attribute

Object tokens have one value, a name, retrieved using the getName function.

Attribute Tokens have 2 values, a name and a type, retrieved using the getName and getType function.

Attribute Values have 1 value, the value of the attribute, retrieved using any one of the getInt, getFloat, or getValue functions, as indicated by the type of the attribute.

AtlasProtocol (abstract class)

Implementations of the AtlasProtocol class are containers for a matched Encoder/Decoder pair and provide methods for the AtlasCodec class to communicate with the Encoder and Decoder.

AtlasCodec (abstract class)

Implementations of the AtlasCodec class provide a complete mechanism for encoding an AtlasMessage into any desired stream format, and for decoding a properly formatted stream back into an AtlasMessage object.

AtlasTransportStream (abstract class)

Implementations of the AtlasTransportStream object are wrappers for any underlying protocol that map the protocols functionality to functions that the AtlasTransport and AtlasTransportListener can use to provide Client and Server functionality using the underlying protocol

AtlasTransport

Creating an AtlasTransport requires an AtlasTransportStream to provide network data services, and an AtlasCodec to encode and decode AtlasMessage objects in a format appropriate for the network transport underlying the AtlasTransportStream.

AtlasTransport objects manage the process of polling a stream for input and decoding the input stream into AtlasMessage objects. There is also the ability to take an AtlasMessage, encode it, and output the resulting data stream to the AtlasTransportStream attached to this AtlasTransport.

AtlasTransportListener

The AtlasTransportListener object provides functionality required to accept connection requests from the underlying network transport.

AtlasServer

The AtlasServer object polls an AtlasTransportListener object for inbound connections, constructs an AtlasTransport object to manage the connection, and returns the AtlasTransport object to the application to be used for communications