Class Identity


  • public class Identity
    extends java.lang.Object
    This class encapsulates the identity of the application that uses this instance of message bus. This identity contains a servicePrefix identifier, which is the configuration id of the current servicePrefix, and the canonical host name of the host running this.
    Author:
    Simon Thoresen Hult
    • Constructor Summary

      Constructors 
      Constructor Description
      Identity​(Identity identity)
      Implements the copy constructor.
      Identity​(java.lang.String configId)
      The default constructor requires a configuration identifier that it will use to subscribe to this message bus' identity.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getHostname()
      Returns the hostname for this.
      java.lang.String getServicePrefix()
      Returns the service prefix for this.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Identity

        public Identity​(java.lang.String configId)
        The default constructor requires a configuration identifier that it will use to subscribe to this message bus' identity. This identity is necessary so that the network layer is able to identify self for registration with Slobrok.
        Parameters:
        configId - The config identifier for the application.
      • Identity

        public Identity​(Identity identity)
        Implements the copy constructor.
        Parameters:
        identity - The object to copy.
    • Method Detail

      • getHostname

        public java.lang.String getHostname()
        Returns the hostname for this. This is the network name of the host on which this identity exists. It is retrieved on creation by running shell command "hostname".
        Returns:
        The canonical host name.
      • getServicePrefix

        public java.lang.String getServicePrefix()
        Returns the service prefix for this. This is what is prefixed to every session that is created on this identity's message bus before registered in the naming service.
        Returns:
        The service prefix.