com.ericsson.otp.erlang
Class OtpNode

java.lang.Object
  |
  +--com.ericsson.otp.erlang.OtpNode
Direct Known Subclasses:
OtpPeer, OtpSelf

public class OtpNode
extends java.lang.Object

Represents an OTP node, a communication endpoint. It is not possible to create instances of this class, as it is only intended as a superclass for OtpSelf, OtpServer and OtpPeer.

About nodenames: Erlang nodenames consist of two components, an alivename and a hostname separated by '@'. Additionally, there are two nodename formats: short and long. Short names are of the form "alive@hostname", while long names are of the form "alive@host.fully.qualified.domainname". Erlang has special requirements regarding the use of the short and long formats, in particular they cannot be mixed freely in a network of communicating nodes. See the Erlang documentation for more information about nodenames.

The constructors for the OtpNode classes will create names exactly as you provide them as long as the name contains '@'. If the string you provide contains no '@', it will be treated as an alivename and the name of the local host will be appended, resulting in a shortname. Nodenames longer than 255 characters will be truncated without warning.

There are no constructors for this class, use one of the subclasses instead.


Method Summary
 java.lang.String alive()
          Get the alivename part of the hostname.
 java.lang.String cookie()
          Get the authorization cookie used by this node.
 java.lang.String host()
          Get the hostname part of the nodename.
 java.lang.String node()
          Get the name of this node.
 java.lang.String setCookie(java.lang.String cookie)
          Set the authorization cookie used by this node.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

node

public java.lang.String node()
Get the name of this node.
Returns:
the name of the node represented by this object.

host

public java.lang.String host()
Get the hostname part of the nodename. Nodenames are composed of two parts, an alivename and a hostname, separated by '@'. This method returns the part of the nodename following the '@'.
Returns:
the hostname component of the nodename.

alive

public java.lang.String alive()
Get the alivename part of the hostname. Nodenames are composed of two parts, an alivename and a hostname, separated by '@'. This method returns the part of the nodename preceding the '@'.
Returns:
the alivename component of the nodename.

cookie

public java.lang.String cookie()
Get the authorization cookie used by this node.
Returns:
the authorization cookie used by this node.

setCookie

public java.lang.String setCookie(java.lang.String cookie)
Set the authorization cookie used by this node.
Returns:
the previous authorization cookie used by this node.

toString

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