Class Node

  • All Implemented Interfaces:
    UsesPort
    Direct Known Subclasses:
    StatelessClient, StatelessServer

    public class Node
    extends Object
    implements UsesPort
    A communication endpoint.
    Since:
    1.0.0
    Version:
    $Id: Node.java 17757 2018-11-13 20:41:13Z colin $
    Author:
    tlerios@marketcetera.com
    • Field Detail

      • host

        private String host
        node host value
      • port

        private int port
        node port value
      • nodeId

        private final NodeId nodeId
        node id for this node
      • nodeDescription

        private String nodeDescription
        node description value
      • DEFAULT_PORT

        public static final int DEFAULT_PORT
        The default port on which the server listens and to which the client connects.
        See Also:
        Constant Field Values
      • DEFAULT_SERVER_HOST

        public static final String DEFAULT_SERVER_HOST
        The default host name for the server
        See Also:
        Constant Field Values
      • DEFAULT_CLIENT_HOST

        public static final String DEFAULT_CLIENT_HOST
        The default host name for the client
        See Also:
        Constant Field Values
    • Constructor Detail

      • Node

        protected Node​(String inHost,
                       int inPort)
        Creates a new communication node with the given host name and port.
        Parameters:
        inHost - a String value
        inPort - an int value
      • Node

        protected Node()
        Creates a new communication node with the default host name and port.
    • Method Detail

      • setHost

        public void setHost​(String inHost)
        Sets the receiver's host name to the given one.
        Parameters:
        inHost - a String value
      • getHost

        public String getHost()
        Returns the receiver's host name.
        Returns:
        a String value
      • getPort

        public int getPort()
        Returns the receiver's port.
        Returns:
        an int value
      • setPort

        public void setPort​(int inPort)
        Sets the port value.
        Parameters:
        inPort - an int value
      • getId

        public NodeId getId()
        Returns the receiver's node ID.
        Returns:
        a NodeId value
      • getNodeDescription

        public String getNodeDescription()
        Get the nodeDescription value.
        Returns:
        a String value
      • setNodeDescription

        public void setNodeDescription​(String inNodeDescription)
        Sets the nodeDescription value.
        Parameters:
        inNodeDescription - a String value
      • getConnectionUrl

        protected String getConnectionUrl​(Class<?> inInterfaceClazz)
        Returns the connection URL for the given service interface.
        Parameters:
        inInterfaceClazz - a Class<?> value
        Returns:
        a String containing the connection namespace