fulmine.protocol.wire
Interface IWireIdentity

All Known Implementing Classes:
WireIdentity

public interface IWireIdentity

A wire identity is the identity format to use when transmitting an entity 'on-the-wire' using the fulmine delta (FD) protocol. The key distinction between the wire identity and the String identity of an entity is that the wire identity should be a more compact representation of the identity for transmission. Whereas the identity of a component might be 'foo-bar', the wire identity may be an integer 1234. Transmitting the wire identity as a string (UTF-16) 'foo-bar' could take 10 more bytes versus a 4-byte integer representation. However, as the FD protocol uses a compacted integral transmission technique, the cost of transmitting the integer can be as low as 1 byte.

There are 2 formats for the wire identity; integer and string. Integer is by far the most efficient format for the wire identity. A wire identity is format-aware; it knows if it is an Integer Wire Format (IWF) or String Wire Format (SWF).

There are some design situations where it is not possible to use an integer for the wire identity. In these circumstances, generally, the wire identity would be the same as the identity. This presents wire transmission inefficiency but is unavoidable in these cases.

Author:
Ramon Servadei
See Also:
IComponent#getWireIdentity()

Method Summary
 int getAsInteger()
          Get the wire identity in its integer form.
 String getAsString()
          Get the wire identity in its string form.
 boolean isIntegerWireFormat()
          Describes the format of this wire identity.
 

Method Detail

getAsInteger

int getAsInteger()
Get the wire identity in its integer form. If the wire identity is not an integer, this method will generate an exception.

Returns:
the integer form of this wire identity
See Also:
isIntegerWireFormat()

getAsString

String getAsString()
Get the wire identity in its string form. If the wire identity is an integer, this method will return the integer as a string.

Returns:
the string form of this wire identity
See Also:
isIntegerWireFormat()

isIntegerWireFormat

boolean isIntegerWireFormat()
Describes the format of this wire identity.

Returns:
true if the format is integer


Copyright © 2007-2009. All Rights Reserved.