org.jdesktop.wonderland.client.login
Class ProgrammaticLogin<T extends WonderlandSession>

java.lang.Object
  extended by org.jdesktop.wonderland.client.login.ProgrammaticLogin<T>

public class ProgrammaticLogin<T extends WonderlandSession>
extends java.lang.Object

Utility class to handle login to a Wonderland server. Given a serverURL, username, and optionally the path to a password file, this class will create a WonderlandSession connected to the given server.

Author:
Jonathan Kaplan

Constructor Summary
ProgrammaticLogin(java.lang.String serverURL)
          Create a new ProgrammaticLogin that connects to the given server.
 
Method Summary
protected  T createSession(ServerSessionManager sessionManager, WonderlandServerInfo server, java.lang.ClassLoader loader)
          Create a new WonderlandSession.
 java.lang.String getServerURL()
          Get the URL of the server this login object is connected to.
 T login(java.lang.String username, java.io.File passwordFile)
          Login to the server with the given credentials.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProgrammaticLogin

public ProgrammaticLogin(java.lang.String serverURL)
Create a new ProgrammaticLogin that connects to the given server.

Parameters:
serverURL - the server URL to connect to.
Method Detail

getServerURL

public java.lang.String getServerURL()
Get the URL of the server this login object is connected to.

Returns:
the server URL.

login

public T login(java.lang.String username,
               java.io.File passwordFile)
Login to the server with the given credentials. This returns a WonderlandSession which is connected to the server.

Parameters:
username - the username to connect with. Required.
passwordFile - a file containing the password to connect with. Optional. Only used when security is set up to require a username and password for login.
Returns:
the WonderlandSession created after connecting.

createSession

protected T createSession(ServerSessionManager sessionManager,
                          WonderlandServerInfo server,
                          java.lang.ClassLoader loader)
Create a new WonderlandSession. This method is provided so subclasses can override it to return different session types.

Parameters:
sessionManager - the session manager that created this session
server - the server the session is connected to
loader - the classloader for use in the session
Returns:
a newly created WonderlandSession object


Open Wonderland - http://openwonderland.org