org.jdesktop.wonderland.client.login
Class LoginManager

java.lang.Object
  extended by org.jdesktop.wonderland.client.login.LoginManager

public class LoginManager
extends java.lang.Object

Handle logins for the Wonderland system. Keeps track of the relationship between WonderlandSessions and the ServerSessionManager which owns the server connection.

Author:
jkaplan

Constructor Summary
LoginManager()
           
 
Method Summary
static void addPrimaryServerListener(PrimaryServerListener listener)
          Add a primary server listener.
static ServerSessionManager findSessionManager(java.lang.String serverURL)
          Finds an existing session manager that matches the given URL.
static java.util.Collection<ServerSessionManager> getAll()
          Get all session managers
static ServerSessionManager getPrimary()
          Get the primary session manager
static ServerSessionManager getSessionManager(java.lang.String serverURL)
          Get the session manager for a particular server URL
static void removePrimaryServerListener(PrimaryServerListener listener)
          Remove a primary server listener
static void setLoginUI(LoginUI ui)
          Set the LoginUI to call back to during login attempts.
static void setPluginFilter(PluginFilter filter)
          Set the default plugin filter for all session managers created.
static void setPrimary(ServerSessionManager primary)
          Set the primary session manager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoginManager

public LoginManager()
Method Detail

setLoginUI

public static void setLoginUI(LoginUI ui)
Set the LoginUI to call back to during login attempts.

Parameters:
ui - the user interface to login with

setPluginFilter

public static void setPluginFilter(PluginFilter filter)
Set the default plugin filter for all session managers created.

Parameters:
filter - the plugin filter to use

getSessionManager

public static ServerSessionManager getSessionManager(java.lang.String serverURL)
                                              throws java.io.IOException
Get the session manager for a particular server URL

Parameters:
serverURL - the serverURL to get a session manager for
Returns:
the session manager
Throws:
java.io.IOException - if there is an error connecting to the given server URL

findSessionManager

public static ServerSessionManager findSessionManager(java.lang.String serverURL)
Finds an existing session manager that matches the given URL. This search is based on the URL of existing session managers. It is not a direct comparison of strings, it tries to at least deal with differences in slashes and so on between the URLs.

Parameters:
serverURL - the url to search for
Returns:
the matching session manager, or null if no session managers match

getAll

public static java.util.Collection<ServerSessionManager> getAll()
Get all session managers

Returns:
a list of all known session managers

getPrimary

public static ServerSessionManager getPrimary()
Get the primary session manager

Returns:
the primary session manager, if one has been set

setPrimary

public static void setPrimary(ServerSessionManager primary)
Set the primary session manager

Parameters:
primary - the primary session manager, or null if the client no longer has a primary server

addPrimaryServerListener

public static void addPrimaryServerListener(PrimaryServerListener listener)
Add a primary server listener. This listener will be notified immediately with the current value of the primary server. It will also be notified in the future of any changes to the primary server value.

Parameters:
listener - the listener to add

removePrimaryServerListener

public static void removePrimaryServerListener(PrimaryServerListener listener)
Remove a primary server listener

Parameters:
listener - the listener to remove


Open Wonderland - http://openwonderland.org