Package com.ericsson.otp.erlang

# Class OtpPeer

java.lang.Object
com.ericsson.otp.erlang.AbstractNode
com.ericsson.otp.erlang.OtpPeer

All Implemented Interfaces:
  `OtpTransportFactory`

public class OtpPeer extends AbstractNode
Represents a remote OTP node. It acts only as a container for the nodename and other node-specific information that is needed by the `OtpConnection` class.

## Constructor Summary

Constructors
Constructor
Description
`OtpPeer(String node)`
Create a peer node.
`OtpPeer(String node, OtpTransportFactory transportFactory)`
Create a peer node with custom transport factory.

## Method Summary

Modifier and Type
Method
Description
`OtpConnection`
`connect(OtpSelf self)`
Deprecated.
Use the corresponding method in `OtpSelf` instead.

### Methods inherited from class com.ericsson.otp.erlang.AbstractNode

`alive, cookie, createServerTransport, createServerTransport, createTransport, createTransport, createTransport, host, node, setCookie, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### OtpPeer

public OtpPeer(String node)
Create a peer node.

Parameters:
  `node` - the name of the node.

### OtpPeer

public OtpPeer(String node, OtpTransportFactory transportFactory)
Create a peer node with custom transport factory.

Parameters:
  `node` - the name of the node.
  `transportFactory` - custom transport factory

## Method Details

### connect

@Deprecated public OtpConnection connect(OtpSelf self) throws IOException, UnknownHostException, OtpAuthException
Deprecated.
Use the corresponding method in `OtpSelf` instead.
Create a connection to a remote node.

Parameters:
  `self` - the local node from which you wish to connect.
Returns:
  a connection to the remote node.
Throws:
  `UnknownHostException` - if the remote host could not be found.
  `IOException` - if it was not possible to connect to the remote node.
  `OtpAuthException` - if the connection was refused by the remote node.