public class PeerNode extends Object implements ClientObserver, Subscriber<NodeObject>
| Modifier and Type | Field and Description |
|---|---|
NodeObject |
nodeobj
This peer's node object.
|
| Constructor and Description |
|---|
PeerNode() |
| Modifier and Type | Method and Description |
|---|---|
void |
clientConnectionFailed(Client client,
Exception cause)
Called when the connection to the server went away for some unexpected reason.
|
void |
clientDidClear(Client client)
Called after the client is completely logged off from a successful session and is ready to
reconnect to a new server if desired.
|
void |
clientDidLogoff(Client client)
Called after the client has been logged off of the server and has disconnected.
|
void |
clientDidLogon(Client client)
Called after the client successfully connected to and authenticated with the server.
|
void |
clientFailedToLogon(Client client,
Exception cause)
Called if anything fails during the logon attempt.
|
void |
clientObjectDidChange(Client client)
For systems that allow switching screen names after logon, this method is called whenever a
screen name change takes place to report that the client object has been replaced to
potential client-side subscribers.
|
boolean |
clientWillLogoff(Client client)
Called when an abortable logoff request is made.
|
void |
clientWillLogon(Client client)
Called immediately before a logon is attempted.
|
Client |
getClient()
Returns the
Client instance that manages our connection to this peer. |
String |
getInternalHostName()
Returns the hostname for internal clients to use when connecting to this peer.
|
String |
getNodeName()
Returns this peer's unique string identifier.
|
int |
getPort()
Returns the port on which to connect to this peer.
|
String |
getPublicHostName()
Returns the hostname for external clients to use when connecting to this peer.
|
void |
init(NodeRecord record)
Initializes this peer node and creates its internal client.
|
void |
objectAvailable(NodeObject object)
Called when a subscription request has succeeded and the object is
available.
|
void |
refresh(NodeRecord record) |
void |
requestFailed(int oid,
ObjectAccessException cause)
Called when a subscription request has failed.
|
void |
shutdown() |
public NodeObject nodeobj
public void init(NodeRecord record)
public Client getClient()
Client instance that manages our connection to this peer.public String getNodeName()
public String getPublicHostName()
public String getInternalHostName()
public int getPort()
public void refresh(NodeRecord record)
public void shutdown()
public void clientFailedToLogon(Client client, Exception cause)
ClientObserverclientFailedToLogon in interface ClientObservercause - an exception indicating the cause of the logon failure. Note: this
may be a LogonException and if so, the caller must check LogonException.isStillInProgress() to find out if the logon process has totally failed or if
we are simply reporting intermediate status (we might be falling back to an alternative port
or delaying our auto-retry attempt due to server overload).public void clientConnectionFailed(Client client, Exception cause)
ClientObserverSessionObserver.clientDidLogoff(com.threerings.presents.client.Client).clientConnectionFailed in interface ClientObserverpublic void clientWillLogon(Client client)
SessionObserverclientWillLogon in interface SessionObserverpublic void clientDidLogon(Client client)
SessionObserverclientDidLogon in interface SessionObserverpublic void clientObjectDidChange(Client client)
SessionObserverclientObjectDidChange in interface SessionObserverpublic boolean clientWillLogoff(Client client)
ClientObserverclientWillLogoff in interface ClientObserverpublic void clientDidLogoff(Client client)
SessionObserverclientDidLogoff in interface SessionObserverpublic void clientDidClear(Client client)
ClientObserverClientObserver.clientFailedToLogon(com.threerings.presents.client.Client, java.lang.Exception).clientDidClear in interface ClientObserverpublic void objectAvailable(NodeObject object)
SubscriberDObject.addListener(com.threerings.presents.dobj.ChangeListener)).objectAvailable in interface Subscriber<NodeObject>DObjectManager.subscribeToObject(int, com.threerings.presents.dobj.Subscriber<T>)public void requestFailed(int oid,
ObjectAccessException cause)
SubscriberObjectAccessException.requestFailed in interface Subscriber<NodeObject>DObjectManager.subscribeToObject(int, com.threerings.presents.dobj.Subscriber<T>)Copyright © 2015. All rights reserved.