org.jdesktop.wonderland.client.login
Class ServerDetails

java.lang.Object
  extended by org.jdesktop.wonderland.client.login.ServerDetails
All Implemented Interfaces:
java.lang.Cloneable

public class ServerDetails
extends java.lang.Object
implements java.lang.Cloneable

A description of a Wonderland server we are trying to connect to. Servers are uniquely identified by URL.

Author:
jkaplan

Constructor Summary
ServerDetails()
          Default constructor
ServerDetails(java.lang.String serverURL, long timeStamp, AuthenticationInfo authInfo, java.util.List<DarkstarServer> darkstarServers)
          Create a new ServerDetails with the given information
 
Method Summary
 ServerDetails clone()
          Copy this serverDetails object
static ServerDetails decode(java.io.Reader r)
          Takes the input reader of the XML file and instantiates an instance of the ServerDetails class
 void encode(java.io.OutputStream os)
          Writes the ServerDetails class to an output stream.
 void encode(java.io.Writer w)
          Writes the ServerDetails class to an output writer.
 boolean equals(java.lang.Object obj)
          Two ServerDetails are the same if they have the same URL
 AuthenticationInfo getAuthInfo()
          Get the authentication information for this server
 java.util.List<DarkstarServer> getDarkstarServers()
          Get the list of possible Darkstar servers to connect to.
 java.lang.String getServerURL()
          Get the URL of the server
 long getTimeStamp()
          Get the last change timestamp for this server
 java.lang.String getVersion()
           
 int hashCode()
           
 void setAuthInfo(AuthenticationInfo authInfo)
          Set the authentication information for this server
 void setDarkstarServers(java.util.List<DarkstarServer> darkstarServers)
          Set the list of Darkstar servers
 void setServerURL(java.lang.String serverURL)
          Set the URL of the server
 void setTimeStamp(long timeStamp)
          Set the last change timestamp for this server
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerDetails

public ServerDetails()
Default constructor


ServerDetails

public ServerDetails(java.lang.String serverURL,
                     long timeStamp,
                     AuthenticationInfo authInfo,
                     java.util.List<DarkstarServer> darkstarServers)
Create a new ServerDetails with the given information

Parameters:
serverURL - the server URL
timeStamp - the time this server last had a relevant change. Used to determine if a session can be reconnected or if it must be cleaned up first.
authInfo - the authentication information
darkstarServers - the servers to connect to
Method Detail

getVersion

public java.lang.String getVersion()

getServerURL

public java.lang.String getServerURL()
Get the URL of the server

Returns:
the server URL

setServerURL

public void setServerURL(java.lang.String serverURL)
Set the URL of the server

Parameters:
serverURL - the server URL

getTimeStamp

public long getTimeStamp()
Get the last change timestamp for this server

Returns:
the change timestamp for this server

setTimeStamp

public void setTimeStamp(long timeStamp)
Set the last change timestamp for this server


getAuthInfo

public AuthenticationInfo getAuthInfo()
Get the authentication information for this server

Returns:
the authentication information

setAuthInfo

public void setAuthInfo(AuthenticationInfo authInfo)
Set the authentication information for this server

Parameters:
authInfo - the authentication information

getDarkstarServers

public java.util.List<DarkstarServer> getDarkstarServers()
Get the list of possible Darkstar servers to connect to. The client should try the servers in the order they are contained in the array.

Returns:
an ordered list of Darkstar servers

setDarkstarServers

public void setDarkstarServers(java.util.List<DarkstarServer> darkstarServers)
Set the list of Darkstar servers

Parameters:
darkstarServers - the servers to connect to

decode

public static ServerDetails decode(java.io.Reader r)
                            throws javax.xml.bind.JAXBException
Takes the input reader of the XML file and instantiates an instance of the ServerDetails class

Parameters:
r - The input stream of the version XML file
Throws:
javax.xml.bind.JAXBException

encode

public void encode(java.io.Writer w)
            throws javax.xml.bind.JAXBException
Writes the ServerDetails class to an output writer.

Parameters:
w - The output writer to write to
Throws:
javax.xml.bind.JAXBException

encode

public void encode(java.io.OutputStream os)
            throws javax.xml.bind.JAXBException
Writes the ServerDetails class to an output stream.

Parameters:
os - The output stream to write to
Throws:
javax.xml.bind.JAXBException

clone

public ServerDetails clone()
Copy this serverDetails object

Overrides:
clone in class java.lang.Object
Returns:
a copy

equals

public boolean equals(java.lang.Object obj)
Two ServerDetails are the same if they have the same URL

Overrides:
equals in class java.lang.Object

hashCode

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


Open Wonderland - http://openwonderland.org