tuwien.auto.calimero.mgmt
Class Destination

java.lang.Object
  extended by tuwien.auto.calimero.mgmt.Destination

public class Destination
extends java.lang.Object

Represents a transport layer logical connection destination.

It keeps settings to use for communication with a destination and maintains the logical connection state. In connection oriented mode, a timer is used to detect the connection timeout and send a disconnect.
The actual layer 4 communication is done by a TransportLayer (the aggregator for the destination) specified with the Destination.AggregatorProxy.

A destination object is usually created and maintained by a TransportLayer or ManagementClient implementation.
After a destination got destroyed, it can't be used for communication to that destination anymore, i.e. it's not possible to change the connection state.

See Also:
TransportLayer, ManagementClient

Nested Class Summary
static class Destination.AggregatorProxy
          An aggregator proxy is associated with one destination and is supplied at the creation of a new destination object.
 
Field Summary
static byte CONNECTING
          Connection state is connecting.
static byte DESTROYED
          Destination is destroyed.
static byte DISCONNECTED
          Connection state is disconnected.
static byte OPEN_IDLE
          Connection state is open and communication is idle.
static byte OPEN_WAIT
          Connection state is open and communication is waiting for L4 acknowledge.
 
Constructor Summary
Destination(Destination.AggregatorProxy aggregator, IndividualAddress remote, boolean connectionOriented)
          Creates a new destination.
Destination(Destination.AggregatorProxy aggregator, IndividualAddress remote, boolean connectionOriented, boolean keepAlive, boolean verifyMode)
          Creates a new destination with all available destination connection settings.
 
Method Summary
 void destroy()
          Destroys this destination.
 IndividualAddress getAddress()
          Returns the destination address.
 byte getState()
          Returns the state of this destination.
 boolean isConnectionOriented()
          Returns whether this destination uses connection oriented mode or connectionless mode.
 boolean isKeepAlive()
          Returns whether keep alive of connection is specified.
 boolean isVerifyMode()
          Returns whether verify mode is supported by the destination.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONNECTING

public static final byte CONNECTING
Connection state is connecting.

See Also:
getState(), Constant Field Values

DESTROYED

public static final byte DESTROYED
Destination is destroyed.

See Also:
getState(), Constant Field Values

DISCONNECTED

public static final byte DISCONNECTED
Connection state is disconnected.

See Also:
getState(), Constant Field Values

OPEN_IDLE

public static final byte OPEN_IDLE
Connection state is open and communication is idle.

See Also:
getState(), Constant Field Values

OPEN_WAIT

public static final byte OPEN_WAIT
Connection state is open and communication is waiting for L4 acknowledge.

See Also:
getState(), Constant Field Values
Constructor Detail

Destination

public Destination(Destination.AggregatorProxy aggregator,
                   IndividualAddress remote,
                   boolean connectionOriented)
Creates a new destination.

Verify mode defaults to false and keep alive is not used.

Parameters:
aggregator - aggregator proxy to associate with this destination
remote - KNX remote address specifying the connection destination
connectionOriented - true for connection oriented mode, false to use connectionless mode

Destination

public Destination(Destination.AggregatorProxy aggregator,
                   IndividualAddress remote,
                   boolean connectionOriented,
                   boolean keepAlive,
                   boolean verifyMode)
Creates a new destination with all available destination connection settings.

Keep alive of a logical connection is only available in connection oriented mode, in connectionless mode keep alive is always disabled.
Implementation note: the keep alive option is not implemented by now and not used by this destination. Nevertheless, it is set and might be queried using isKeepAlive().
The verify mode refers to the verify mode control in application layer services and specifies whether the specified destination to communicate with supports verified writing of data.

Parameters:
aggregator - aggregator proxy to associate with this destination
remote - KNX remote address specifying the connection destination
connectionOriented - true for connection oriented mode, false to use connectionless mode
keepAlive - true to prevent a timing out of the logical connection in connection oriented mode, false to use default connection timeout
verifyMode - true to indicate the destination has verify mode enabled, false otherwise
Method Detail

destroy

public void destroy()
Destroys this destination.

If the connection state is connected, it will be disconnected. The connection state is set to DESTROYED. The associated transport layer is notified through TransportLayer.destroyDestination(Destination).
On an already destroyed destination, no action is performed.


getAddress

public IndividualAddress getAddress()
Returns the destination address.

Returns:
the destination individual address

getState

public final byte getState()
Returns the state of this destination.

The returned value is one of the destination state constants.

Returns:
destination state

isConnectionOriented

public final boolean isConnectionOriented()
Returns whether this destination uses connection oriented mode or connectionless mode.

Returns:
true for connection oriented mode, false otherwise

isKeepAlive

public final boolean isKeepAlive()
Returns whether keep alive of connection is specified.

Returns:
true if keep alive is specified and connection oriented mode is used, false otherwise

isVerifyMode

public final boolean isVerifyMode()
Returns whether verify mode is supported by the destination.

Returns:
true for verify mode enabled, false otherwise

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object