com.threerings.presents.peer.server.persist
Class NodeRecord

java.lang.Object
  extended by com.samskivert.depot.impl.QueryResult
      extended by com.samskivert.depot.PersistentRecord
          extended by com.threerings.presents.peer.server.persist.NodeRecord
All Implemented Interfaces:
Serializable, Cloneable

public class NodeRecord
extends PersistentRecord

Contains information on an active node in a Presents server cluster.

See Also:
Serialized Form

Field Summary
static Class<NodeRecord> _R
           
static ColumnExp<String> HOST_NAME
           
 String hostName
          The DNS name used to connect to this node by other peers.
static ColumnExp<Timestamp> LAST_UPDATED
           
 Timestamp lastUpdated
          The last time this node has reported in.
static ColumnExp<String> NODE_NAME
           
 String nodeName
          The unique name assigned to this node.
 int port
          The port on which to connect to this node.
static ColumnExp<Integer> PORT
           
static ColumnExp<String> PUBLIC_HOST_NAME
           
 String publicHostName
          The DNS name used to connect to this node by normal clients.
 String region
          The region in which the node exists.
static ColumnExp<String> REGION
           
static int SCHEMA_VERSION
          Increment this value if you modify the definition of this persistent object in a way that will result in a change to its SQL counterpart.
 boolean shutdown
          Whether or not this node is explicitly shut down.
static ColumnExp<Boolean> SHUTDOWN
           
 
Constructor Summary
NodeRecord()
          Used to create a blank instance when loading from the database.
NodeRecord(String nodeName)
          Used for queries.
NodeRecord(String nodeName, String hostName, String publicHostName, String region, int port)
          Creates a record for the specified node.
 
Method Summary
static Key<NodeRecord> getKey(String nodeName)
          Create and return a primary Key to identify a NodeRecord with the supplied key values.
 String getPeerHostName(String region)
          Returns the host name to which peers in the specified region should connect.
 String toString()
           
 
Methods inherited from class com.samskivert.depot.PersistentRecord
colexp, newKey, registerKeyFields
 
Methods inherited from class com.samskivert.depot.impl.QueryResult
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_R

public static final Class<NodeRecord> _R

NODE_NAME

public static final ColumnExp<String> NODE_NAME

HOST_NAME

public static final ColumnExp<String> HOST_NAME

PUBLIC_HOST_NAME

public static final ColumnExp<String> PUBLIC_HOST_NAME

REGION

public static final ColumnExp<String> REGION

PORT

public static final ColumnExp<Integer> PORT

LAST_UPDATED

public static final ColumnExp<Timestamp> LAST_UPDATED

SHUTDOWN

public static final ColumnExp<Boolean> SHUTDOWN

SCHEMA_VERSION

public static final int SCHEMA_VERSION
Increment this value if you modify the definition of this persistent object in a way that will result in a change to its SQL counterpart.

See Also:
Constant Field Values

nodeName

public String nodeName
The unique name assigned to this node.


hostName

public String hostName
The DNS name used to connect to this node by other peers.


publicHostName

public String publicHostName
The DNS name used to connect to this node by normal clients.


region

public String region
The region in which the node exists. Nodes in different regions must connect through the public host name.


port

public int port
The port on which to connect to this node.


lastUpdated

public Timestamp lastUpdated
The last time this node has reported in.


shutdown

public boolean shutdown
Whether or not this node is explicitly shut down.

Constructor Detail

NodeRecord

public NodeRecord()
Used to create a blank instance when loading from the database.


NodeRecord

public NodeRecord(String nodeName,
                  String hostName,
                  String publicHostName,
                  String region,
                  int port)
Creates a record for the specified node.


NodeRecord

public NodeRecord(String nodeName)
Used for queries.

Method Detail

getPeerHostName

public String getPeerHostName(String region)
Returns the host name to which peers in the specified region should connect.


toString

public String toString()
Overrides:
toString in class Object

getKey

public static Key<NodeRecord> getKey(String nodeName)
Create and return a primary Key to identify a NodeRecord with the supplied key values.