Class Node

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

public final class Node extends Object
Diameter Node implementation. Support both client and server-based Diameter applications as well as relay applications.
Author:
Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
  • Field Details

  • Constructor Details

    • Node

      public Node(com.bea.wcp.diameter.provider.Provider provider, ConfigurationBean config) throws DiameterException
      Throws:
      DiameterException
    • Node

      public Node(com.bea.wcp.diameter.provider.Provider provider, String host, String realm, InetAddress address, int port)
    • Node

      public Node(com.bea.wcp.diameter.provider.Provider provider, String host, String realm, InetAddress address, int port, boolean tls)
    • Node

      public Node(com.bea.wcp.diameter.provider.Provider provider, String host, String realm, InetAddress address, int port, boolean tls, boolean sctp)
    • Node

      public Node(com.bea.wcp.diameter.provider.Provider provider)
  • Method Details

    • setInstance

      public static void setInstance(Node node)
      Sets the Node instance that will be used for deserialization of persistent session objects.
    • getInstance

      public static Node getInstance()
      Returns the Node instance to use when deserializing session objects.
    • createNode

      public static Node createNode(File configFile) throws IOException, DiameterException
      Creates a new Diameter Node instance for the specified configuration. Used to start a Diameter node in standalone mode for testing.
      Parameters:
      configFile - the diameter.xml configuration file
      Returns:
      the Diameter Node instance
      Throws:
      IOException - if an I/O error occurred reading the configuration
      DiameterException - if the Node could not be initialized
    • getListenAddress

      public InetAddress getListenAddress()
      Returns the Node listen address
    • start

      public void start() throws IOException
      Starts the Diameter Node instance.
      Throws:
      IOException - if an I/O error occurred while starting
    • stop

      public void stop() throws IOException
      Stops the Diameter Node instance.
      Throws:
      IOException - if an I/O error occurred while stopping the node
    • isRunning

      public boolean isRunning()
      Returns true if the Node is currently running.
    • getHost

      public String getHost()
      Returns the origin host for the node
    • getRealm

      public String getRealm()
      Returns the origin realm for the node
    • getVersion

      public Version getVersion()
    • getConfiguration

      public ConfigurationBean getConfiguration()
      Returns the ConfigurationBean for the node
    • getStateId

      public int getStateId()
    • getCapabilities

      public Capabilities getCapabilities()
    • getSocketAddress

      public SocketAddress getSocketAddress()
    • getSocketAddressList

      public ArrayList<InetSocketAddress> getSocketAddressList()
    • getProvider

      public com.bea.wcp.diameter.provider.Provider getProvider()
    • getPeerTable

      public PeerTable getPeerTable()
    • getAppManager

      public AppManager getAppManager()
    • getRouteTable

      public RouteTable getRouteTable()
    • getPeer

      public Peer getPeer(String hostId)
    • getPeerWithoutCreation

      public Peer getPeerWithoutCreation(String hostId)
    • listPeers

      public List<String> listPeers()
    • getKeyStore

      public KeyStore getKeyStore()
    • getTrustStore

      public KeyStore getTrustStore()
    • getKeyStorePasswd

      public char[] getKeyStorePasswd()
    • setKeyStore

      public void setKeyStore(KeyStore keyStore)
    • setTrustStore

      public void setTrustStore(KeyStore trustStore)
    • setKeyStorePasswd

      public void setKeyStorePasswd(char[] password)
    • setCipherSuites

      public void setCipherSuites(String[] sslCipherSuites)
    • getCipherSuites

      public String[] getCipherSuites()
    • isTlsEnabled

      public boolean isTlsEnabled()
    • isSctpEnabled

      public boolean isSctpEnabled()
    • isIncludeOriginStateId

      public boolean isIncludeOriginStateId()
    • setIncludeOriginStateId

      public void setIncludeOriginStateId(boolean enabled)
    • getApplication

      public Application getApplication(int idNum)
      Returns the application for the specified application id number.
      Parameters:
      idNum - the application's numeric identifier
      Returns:
      the corresponding Application, or null if not found
    • getApplication

      public Application getApplication(ApplicationId id)
      Returns the application for the specified application identifier.
      Parameters:
      id - the ApplicationId for the application
      Returns:
      the corresponding Application, or null if not found
    • isLocalRequest

      public boolean isLocalRequest(Request req)
      Checks if request should be processed locally (RFC 3588 6.1.4).
    • isLocalAnswer

      public boolean isLocalAnswer(Answer ans)
      Returns true if answer should be processed locally (not relayed). 6.2.2 If the last Proxy-Info AVP in the message is targeted to the local Diameter server, the AVP MUST be removed before the answer is forwarded.
    • dispatch

      public void dispatch(Message msg) throws IOException
      Dispatches a message to a session or application.
      Parameters:
      msg - the request or answer message to dispatch
      Throws:
      IOException - if an I/O error occurred during dispatch
    • dispatchThreadAnswer

      public void dispatchThreadAnswer(Request req, Answer ans)
    • dispatchRelay

      public void dispatchRelay(Message msg)
      Dispatches a message to relay application.
    • deliverToSession

      public boolean deliverToSession(Message msg, Session session)
      Delivers a message to a specified session. Used during message dispatch, and by server applications to deliver requests to newly created sessions.
      Parameters:
      msg - the message to be delivered
      session - the session to receive the message
    • deliverToApplication

      public void deliverToApplication(Message msg)
      Called by a provider to deliver a message to application with the specified id.
    • connect

      public com.bea.wcp.diameter.transport.Connection connect(Peer peer) throws IOException
      Throws:
      IOException
    • isMsgDebug

      public boolean isMsgDebug()
    • setMsgDebug

      public void setMsgDebug(boolean enabled)
    • isMsgDebugLogging

      public boolean isMsgDebugLogging()
    • execute

      public void execute(Runnable task)
    • main

      public static void main(String[] args) throws Exception
      Starts the Diameter Node for the specified command line arguments.
      Parameters:
      args - Diameter Node command line arguments
      Throws:
      Exception - if an error occurs while starting the node