gr.uoa.di.madgik.commons.channel.proxy.tcp
Class TCPChannelLocator

java.lang.Object
  extended by gr.uoa.di.madgik.commons.channel.proxy.tcp.TCPChannelLocator
All Implemented Interfaces:
IChannelLocator

public class TCPChannelLocator
extends java.lang.Object
implements IChannelLocator

Defines a TCP proxy locator capable of identifying a channel wither within the same host or from different hosts

Author:
gpapanikos

Nested Class Summary
 
Nested classes/interfaces inherited from interface gr.uoa.di.madgik.commons.channel.proxy.IChannelLocator
IChannelLocator.LocatorType
 
Constructor Summary
TCPChannelLocator()
          Instantiates a new tCP channel locator.
TCPChannelLocator(java.lang.String HostName, int Port)
          Instantiates a new TCP channel locator.
 
Method Summary
 void Decode(byte[] payload)
          Unmarshals a serialization as returned by the IChannelLocator.Encode() method
 byte[] Encode()
          Marshals the locator in a serialized form that can then be passed to IChannelLocator.Decode(byte[]) to create a new instance of the locator.
 boolean equals(java.lang.Object o)
           
 void FromURI(java.net.URI locator)
          Unmarshals a serialization as returned by the IChannelLocator#ToXML() method
 java.lang.String GetHostName()
          Gets the host name.
 IChannelLocator.LocatorType GetLocatorType()
          Retrieves the Locator Type of the proxy locator
 int GetPort()
          Gets the port.
 ChannelRegistryKey GetRegistryKey()
          Retrieves the registry UUID the channel that this locator identifies has been assigned
 int hashCode()
           
 void SetRegistryKey(ChannelRegistryKey RegistryKey)
          Sets the registry UUID the channel that this locator identifies has been assigned
 java.lang.String toString()
           
 java.net.URI ToURI()
          Marshals the locator in a serialized human readable XML form that can then be passed to IChannelLocator#FromXML(String) to create a new instance of the locator.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TCPChannelLocator

public TCPChannelLocator()
Instantiates a new tCP channel locator.


TCPChannelLocator

public TCPChannelLocator(java.lang.String HostName,
                         int Port)
Instantiates a new TCP channel locator.

Parameters:
HostName - the host name
Port - the port
Method Detail

GetHostName

public java.lang.String GetHostName()
Gets the host name.

Returns:
the host name

GetPort

public int GetPort()
Gets the port.

Returns:
the port

Decode

public void Decode(byte[] payload)
            throws java.lang.Exception
Description copied from interface: IChannelLocator
Unmarshals a serialization as returned by the IChannelLocator.Encode() method

Specified by:
Decode in interface IChannelLocator
Parameters:
payload - The locator serialization
Throws:
java.lang.Exception - The deserialization could not be performed

Encode

public byte[] Encode()
              throws java.lang.Exception
Description copied from interface: IChannelLocator
Marshals the locator in a serialized form that can then be passed to IChannelLocator.Decode(byte[]) to create a new instance of the locator.

Specified by:
Encode in interface IChannelLocator
Returns:
The serialized form of the locator
Throws:
java.lang.Exception - The serialization could not be performed

GetLocatorType

public IChannelLocator.LocatorType GetLocatorType()
Description copied from interface: IChannelLocator
Retrieves the Locator Type of the proxy locator

Specified by:
GetLocatorType in interface IChannelLocator
Returns:
The Locator type

GetRegistryKey

public ChannelRegistryKey GetRegistryKey()
Description copied from interface: IChannelLocator
Retrieves the registry UUID the channel that this locator identifies has been assigned

Specified by:
GetRegistryKey in interface IChannelLocator
Returns:
The registry UUID of the identified channel

SetRegistryKey

public void SetRegistryKey(ChannelRegistryKey RegistryKey)
Description copied from interface: IChannelLocator
Sets the registry UUID the channel that this locator identifies has been assigned

Specified by:
SetRegistryKey in interface IChannelLocator
Parameters:
RegistryKey - The registry UUID of the identified channel

ToURI

public java.net.URI ToURI()
                   throws java.lang.Exception
Description copied from interface: IChannelLocator
Marshals the locator in a serialized human readable XML form that can then be passed to IChannelLocator#FromXML(String) to create a new instance of the locator.

Specified by:
ToURI in interface IChannelLocator
Returns:
The serialized form of the locator
Throws:
java.lang.Exception - The serialization could not be performed

FromURI

public void FromURI(java.net.URI locator)
             throws java.lang.Exception
Description copied from interface: IChannelLocator
Unmarshals a serialization as returned by the IChannelLocator#ToXML() method

Specified by:
FromURI in interface IChannelLocator
Throws:
java.lang.Exception - The deserialization could not be performed

toString

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

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object