Class Peer

java.lang.Object
com.bea.wcp.diameter.Peer

public final class Peer extends Object
Diameter peer implementation based on state machine pattern.
Author:
Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
  • Field Details

  • Constructor Details

    • Peer

      public Peer(Node node, PeerBean peer)
    • Peer

      public Peer(Node node, String host, InetAddress addr, int port)
    • Peer

      public Peer(Node node, String host, InetAddress addr, int port, String protocol)
    • Peer

      public Peer(Node node, String host, InetAddress addr, int port, String protocol, boolean watchdogEnabled)
    • Peer

      public Peer(Node node, String host)
      Creates new Peer for an incoming dynamic peer connection. In this case, we will not automatically try to connect to the peer ourselves.
  • Method Details

    • start

      public void start()
    • initWatchDog

      public void initWatchDog()
    • sndRequest

      public void sndRequest(ByteBuffer reqBytes, com.bea.wcp.diameter.Transaction txn) throws IOException
      Throws:
      IOException
    • removeTransaction

      public com.bea.wcp.diameter.Transaction removeTransaction(int hopByHopId)
    • receive

      public void receive(Message msg) throws IOException
      Throws:
      IOException
    • disconnect

      public void disconnect(com.bea.wcp.diameter.transport.Connection c) throws IOException
      Throws:
      IOException
    • connCER

      public void connCER(Request m) throws IOException
      Throws:
      IOException
    • stop

      public void stop() throws IOException
      Throws:
      IOException
    • isStopped

      public boolean isStopped()
    • waitForOpen

      public boolean waitForOpen(long timeout)
    • waitForClosed

      public boolean waitForClosed(long timeout)
    • forward

      public void forward(Message msg)
      Forward request or answer using relay application.
    • isOpen

      public boolean isOpen()
    • isClosed

      public boolean isClosed()
    • isTrying

      public boolean isTrying()
      Check the peer current state whether it is connected or trying to connect. returns true if peer is not connected or trying to connect.
    • iAccept

      public void iAccept(com.bea.wcp.diameter.transport.Connection c)
    • rAccept

      public void rAccept(com.bea.wcp.diameter.transport.Connection c)
    • processCER

      public boolean processCER(Peer.CER cer)
    • sndCEA

      public void sndCEA() throws IOException
      Throws:
      IOException
    • sndCEA

      public void sndCEA(Peer.CER cer) throws IOException
      Throws:
      IOException
    • iDisc

      public void iDisc()
    • rDisc

      public void rDisc()
    • processCEA

      public void processCEA(Peer.CEA cea)
    • elect

      public void elect() throws IOException
      Throws:
      IOException
    • sndCER

      public void sndCER() throws IOException
      Throws:
      IOException
    • close

      public void close()
    • setState

      public void setState(PeerState newState)
    • getState

      public PeerState getState()
    • getSocketAddressList

      public ArrayList<InetSocketAddress> getSocketAddressList()
    • getSocketAddress

      public InetSocketAddress getSocketAddress()
    • getHost

      public String getHost()
    • getRealm

      public String getRealm()
    • getPort

      public int getPort()
    • getNode

      public Node getNode()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • watchdogTick

      public void watchdogTick()
      Called when watchdog timeout tick has expired for this peer.
    • sndDWR

      public void sndDWR() throws IOException
      Sends Device-Watchdog-Request see RFC 3539
      Throws:
      IOException
    • getProtocol

      public String getProtocol()
      Retrieves the protocol to be used for communication with this peer.
      Returns:
      the protocol to use for communication with this Peer