public class LoginServerManager
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
LoginServerManager.LoginServer
Class to encapsulate a login server name, URL, index and type (custom or not).
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PRODUCTION_LOGIN_URL |
static java.lang.String |
SANDBOX_LOGIN_URL |
Constructor and Description |
---|
LoginServerManager(Context ctx)
Parameterized constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addCustomLoginServer(java.lang.String name,
java.lang.String url)
Adds a custom login server to the shared pref file.
|
LoginServerManager.LoginServer |
getLoginServerFromURL(java.lang.String url)
Returns a LoginServer instance from URL.
|
java.util.List<LoginServerManager.LoginServer> |
getLoginServers()
Returns the list of login servers.
|
java.util.List<LoginServerManager.LoginServer> |
getLoginServersFromPreferences()
Returns the list of all saved servers, including custom servers.
|
java.util.List<LoginServerManager.LoginServer> |
getLoginServersFromRuntimeConfig()
Returns the list of login servers from runtime configuration
(from MDM provider), if any.
|
LoginServerManager.LoginServer |
getSelectedLoginServer()
Returns the selected login server to display.
|
void |
reset()
Clears all saved custom servers.
|
void |
setSelectedLoginServer(LoginServerManager.LoginServer server)
Sets the currently selected login server to display.
|
void |
useSandbox()
Selects Sandbox as login server (used in tests).
|
public static final java.lang.String PRODUCTION_LOGIN_URL
public static final java.lang.String SANDBOX_LOGIN_URL
public LoginServerManager(Context ctx)
ctx
- Context.public LoginServerManager.LoginServer getLoginServerFromURL(java.lang.String url)
url
- Server URL.public LoginServerManager.LoginServer getSelectedLoginServer()
public void setSelectedLoginServer(LoginServerManager.LoginServer server)
server
- LoginServer instance.public void useSandbox()
public void addCustomLoginServer(java.lang.String name, java.lang.String url)
name
- Server name.url
- Server URL.public void reset()
public java.util.List<LoginServerManager.LoginServer> getLoginServers()
public java.util.List<LoginServerManager.LoginServer> getLoginServersFromRuntimeConfig()
public java.util.List<LoginServerManager.LoginServer> getLoginServersFromPreferences()