org.sdnplatform.sync.internal.config
Class ClusterConfig

java.lang.Object
  extended by org.sdnplatform.sync.internal.config.ClusterConfig

public class ClusterConfig
extends java.lang.Object

Represent the configuration of a cluster in the sync manager

Author:
readams

Constructor Summary
ClusterConfig()
           
ClusterConfig(java.util.List<Node> nodes, short thisNodeId)
          Initialize a cluster config using a list of nodes
ClusterConfig(java.util.List<Node> nodes, short thisNodeId, AuthScheme authScheme, java.lang.String keyStorePath, java.lang.String keyStorePassword)
          Initialize a cluster config using a list of nodes
ClusterConfig(java.util.List<Node> nodes, short thisNodeId, java.lang.String listenAddress, AuthScheme authScheme, java.lang.String keyStorePath, java.lang.String keyStorePassword)
          Initialize a cluster config using a list of nodes
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 AuthScheme getAuthScheme()
          Get the authentication scheme to use for authenticating RPC connections
 java.util.Collection<Node> getDomainNodes()
          A collection of the nodes in the local domain for the current node
 java.util.Collection<Node> getDomainNodes(short domainId)
          A collection of the nodes in the local domain specified
 java.lang.String getKeyStorePassword()
          Get the password for reading data from the KeyStore returned by getKeyStorePath()
 java.lang.String getKeyStorePath()
          Get the key store path where credentials can be found
 java.lang.String getListenAddress()
          Get a string representing the host/address on which the local node should listen
 Node getNode()
          Get the Node object for the current node
 Node getNode(short nodeId)
          The a list of the nodes in the local domain specified
 java.util.Collection<Node> getNodes()
          Get a collection containing all configured nodes
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClusterConfig

public ClusterConfig()

ClusterConfig

public ClusterConfig(java.util.List<Node> nodes,
                     short thisNodeId)
              throws SyncException
Initialize a cluster config using a list of nodes

Parameters:
nodes - the nodes to use
thisNodeId - the node ID for the current node
Throws:
SyncException

ClusterConfig

public ClusterConfig(java.util.List<Node> nodes,
                     short thisNodeId,
                     AuthScheme authScheme,
                     java.lang.String keyStorePath,
                     java.lang.String keyStorePassword)
              throws SyncException
Initialize a cluster config using a list of nodes

Parameters:
nodes - the nodes to use
thisNodeId - the node ID for the current node
authScheme - the AuthScheme
keyStorePath - the path to a java key store containing credentials necessary for implementing the AuthScheme
keyStorePassword - the password for the key store.
Throws:
SyncException

ClusterConfig

public ClusterConfig(java.util.List<Node> nodes,
                     short thisNodeId,
                     java.lang.String listenAddress,
                     AuthScheme authScheme,
                     java.lang.String keyStorePath,
                     java.lang.String keyStorePassword)
              throws SyncException
Initialize a cluster config using a list of nodes

Parameters:
nodes - the nodes to use
thisNodeId - the node ID for the current node
listenAddress - String representing the address to listen on
authScheme - the AuthScheme
keyStorePath - the path to a java key store containing credentials necessary for implementing the AuthScheme
keyStorePassword - the password for the key store.
Throws:
SyncException
Method Detail

getNodes

public java.util.Collection<Node> getNodes()
Get a collection containing all configured nodes

Returns:
the collection of nodes

getDomainNodes

public java.util.Collection<Node> getDomainNodes()
A collection of the nodes in the local domain for the current node

Returns:
the list of nodes

getDomainNodes

public java.util.Collection<Node> getDomainNodes(short domainId)
A collection of the nodes in the local domain specified

Parameters:
domainId - the domain ID
Returns:
the list of nodes

getNode

public Node getNode()
Get the Node object for the current node


getNode

public Node getNode(short nodeId)
The a list of the nodes in the local domain specified

Parameters:
nodeId - the node ID to retrieve
Returns:
the node (or null if there is no such node

getListenAddress

public java.lang.String getListenAddress()
Get a string representing the host/address on which the local node should listen

Returns:
the listen address

getAuthScheme

public AuthScheme getAuthScheme()
Get the authentication scheme to use for authenticating RPC connections

Returns:
the AuthScheme object

getKeyStorePath

public java.lang.String getKeyStorePath()
Get the key store path where credentials can be found

Returns:
the path to a java KeyStore containing necessary credentials
See Also:
getKeyStorePassword()

getKeyStorePassword

public java.lang.String getKeyStorePassword()
Get the password for reading data from the KeyStore returned by getKeyStorePath()

Returns:
the password
See Also:
getKeyStorePath()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object