Package com.yahoo.messagebus.network
Class Identity
- java.lang.Object
-
- com.yahoo.messagebus.network.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
-
-
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.
-
-
-
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.
-
-