|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ericsson.otp.erlang.AbstractNode
public class AbstractNode
Represents an OTP node.
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, however Jinterface makes no distinction. See the Erlang documentation for more information about nodenames.
The constructors for the AbstractNode 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.
Upon initialization, this class attempts to read the file .erlang.cookie in the user's home directory, and uses the trimmed first line of the file as the default cookie by those constructors lacking a cookie argument. If for any reason the file cannot be found or read, the default cookie will be set to the empty string (""). The location of a user's home directory is determined using the system property "user.home", which may not be automatically set on all platforms.
Instances of this class cannot be created directly, use one of the subclasses instead.
Constructor Summary | |
---|---|
protected |
AbstractNode(OtpTransportFactory transportFactory)
|
protected |
AbstractNode(java.lang.String node)
Create a node with the given name and default cookie and transport factory. |
protected |
AbstractNode(java.lang.String node,
OtpTransportFactory transportFactory)
Create a node with the given name, transport factory and the default cookie. |
protected |
AbstractNode(java.lang.String name,
java.lang.String cookie)
Create a node with the given name, cookie and default transport factory. |
protected |
AbstractNode(java.lang.String name,
java.lang.String cookie,
OtpTransportFactory transportFactory)
Create a node with the given name, cookie and transport factory. |
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. |
OtpServerTransport |
createServerTransport(int port)
Create instance of OtpServerTransport |
OtpTransport |
createTransport(java.net.InetAddress addr,
int port)
Create instance of OtpTransport |
OtpTransport |
createTransport(java.lang.String addr,
int port)
Create instance of OtpTransport |
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 |
Constructor Detail |
---|
protected AbstractNode(OtpTransportFactory transportFactory)
protected AbstractNode(java.lang.String node)
protected AbstractNode(java.lang.String node, OtpTransportFactory transportFactory)
protected AbstractNode(java.lang.String name, java.lang.String cookie)
protected AbstractNode(java.lang.String name, java.lang.String cookie, OtpTransportFactory transportFactory)
Method Detail |
---|
public java.lang.String node()
public java.lang.String host()
public java.lang.String alive()
public java.lang.String cookie()
public java.lang.String setCookie(java.lang.String cookie)
public java.lang.String toString()
toString
in class java.lang.Object
public OtpTransport createTransport(java.lang.String addr, int port) throws java.io.IOException
OtpTransportFactory
OtpTransport
createTransport
in interface OtpTransportFactory
addr
- host name or IP address stringport
- port number
java.io.IOException
public OtpTransport createTransport(java.net.InetAddress addr, int port) throws java.io.IOException
OtpTransportFactory
OtpTransport
createTransport
in interface OtpTransportFactory
addr
- peer addressport
- port number
java.io.IOException
public OtpServerTransport createServerTransport(int port) throws java.io.IOException
OtpTransportFactory
OtpServerTransport
createServerTransport
in interface OtpTransportFactory
port
- port number to listen on
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |