public final class Peer extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Peer.CEA |
static class |
Peer.CER |
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_PORT |
Constructor and Description |
---|
Peer(Node node,
PeerBean peer) |
Peer(Node node,
String host)
Creates new Peer for an incoming dynamic peer connection.
|
Peer(Node node,
String host,
InetAddress addr,
int port) |
Peer(Node node,
String host,
InetAddress addr,
int port,
String protocol) |
Peer(Node node,
String host,
InetAddress addr,
int port,
String protocol,
boolean watchdogEnabled) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
connCER(Request m) |
void |
disconnect(com.bea.wcp.diameter.transport.Connection c) |
void |
elect() |
void |
forward(Message msg)
Forward request or answer using relay application.
|
String |
getHost() |
Node |
getNode() |
int |
getPort() |
String |
getProtocol()
Retrieves the protocol to be used for communication with this peer.
|
String |
getRealm() |
InetSocketAddress |
getSocketAddress() |
PeerState |
getState() |
void |
iAccept(com.bea.wcp.diameter.transport.Connection c) |
void |
iDisc() |
void |
initWatchDog() |
boolean |
isClosed() |
boolean |
isOpen() |
boolean |
isStopped() |
void |
processCEA(Peer.CEA cea) |
boolean |
processCER(Peer.CER cer) |
void |
rAccept(com.bea.wcp.diameter.transport.Connection c) |
void |
rDisc() |
void |
receive(Message msg) |
com.bea.wcp.diameter.Transaction |
removeTransaction(int hopByHopId) |
void |
setState(PeerState newState) |
void |
sndCEA() |
void |
sndCEA(Peer.CER cer) |
void |
sndCER() |
void |
sndDWR()
Sends Device-Watchdog-Request
see RFC 3539
|
void |
sndRequest(ByteBuffer reqBytes,
com.bea.wcp.diameter.Transaction txn) |
void |
start() |
void |
stop() |
String |
toString() |
boolean |
waitForClosed(long timeout) |
boolean |
waitForOpen(long timeout) |
void |
watchdogTick()
Called when watchdog timeout tick has expired for this peer.
|
public static final int DEFAULT_PORT
public Peer(Node node, String host, InetAddress addr, int port)
public Peer(Node node, String host, InetAddress addr, int port, String protocol)
public Peer(Node node, String host, InetAddress addr, int port, String protocol, boolean watchdogEnabled)
public void start()
public void initWatchDog()
public void sndRequest(ByteBuffer reqBytes, com.bea.wcp.diameter.Transaction txn) throws IOException
IOException
public com.bea.wcp.diameter.Transaction removeTransaction(int hopByHopId)
public void receive(Message msg) throws IOException
IOException
public void disconnect(com.bea.wcp.diameter.transport.Connection c) throws IOException
IOException
public void connCER(Request m) throws IOException
IOException
public void stop() throws IOException
IOException
public boolean isStopped()
public boolean waitForOpen(long timeout)
public boolean waitForClosed(long timeout)
public void forward(Message msg)
public boolean isOpen()
public boolean isClosed()
public void iAccept(com.bea.wcp.diameter.transport.Connection c)
public void rAccept(com.bea.wcp.diameter.transport.Connection c)
public boolean processCER(Peer.CER cer)
public void sndCEA() throws IOException
IOException
public void sndCEA(Peer.CER cer) throws IOException
IOException
public void iDisc()
public void rDisc()
public void processCEA(Peer.CEA cea)
public void elect() throws IOException
IOException
public void sndCER() throws IOException
IOException
public void close()
public void setState(PeerState newState)
public PeerState getState()
public InetSocketAddress getSocketAddress()
public String getHost()
public String getRealm()
public int getPort()
public Node getNode()
public void watchdogTick()
public void sndDWR() throws IOException
IOException
- if an I/O error occurredpublic String getProtocol()