|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tarantella.tta.webservices.client.views.SessionBean
public class SessionBean
The class caches data on a Secure Global Desktop (SGD) user session, to avoid having to make repeated requests to the SGD server. Like any cache, it can become invalid and it is the caller's responsibility to ensure the data is current.
The SessionBean represents a user's interaction with SGD. A typical web service application will make the following initialisation calls before delivering its specific functionality:
authenticate(String, String, String, String) |
Authenticates and creates a session. The response is parsed and data
can be accessed through various methods of this class. For example,
the session cookie is accessible through getSessionCookie()
and can be used in other API calls. Note, methods implemented on this class
do not take a cookie, but use the internal copy. |
setTCCConfiguration(String, String, String, String) |
Tells the server about the client device and web server to enable it to generate suitable HTML to launch the SGD Client |
startTCC(String, String, String) |
Generates the HTML and parameters needed to launch the SGD Client. |
Constructor Summary | |
---|---|
SessionBean()
Default constructor. |
|
SessionBean(java.lang.String sessionCookieArg)
Constructor. |
Method Summary | |
---|---|
void |
addValue(java.lang.String attname,
java.lang.Object attvalue)
Stores an arbitrary value on the session. |
boolean |
associateTCC()
Checks the list of views returned in the authenticate response and tries to associate this view with an SGD CLient already running for another view. |
java.lang.String |
authenticate(java.lang.String username,
java.lang.String password,
java.lang.String clientId,
java.lang.String locale)
Creates and authenticates a user session. |
java.lang.String |
authenticateExt(java.lang.String username,
java.lang.String password,
java.lang.String clientId,
java.lang.String locale,
Item[] additionalCreds,
Item[] loginContext)
Creates and authenticates a user session that requires more credentials than just a username and password. |
java.lang.String |
authenticateMoreInfo(Item[] additionalCreds)
Provides more information to authenticate a user session. |
java.lang.String |
authenticateMoreInfo(Item[] additionalCreds,
java.lang.String prefLang)
Provides more information to authenticate a user session. |
DataRequest[] |
authenticateMoreInfoPrompts()
Gets information about additional credentials required in multi-stage authentication. |
java.lang.String |
endSession(boolean logout)
Ends a user session. |
java.lang.String |
getAttribute(java.lang.String store,
java.lang.String attributeName)
Gets the named attribute from the named store. |
java.lang.String[] |
getAttributeArray(java.lang.String store,
java.lang.String attributeName)
Gets the named attribute from the named store. |
java.lang.Object |
getAttributeObject(java.lang.String store,
java.lang.String attributeName)
Gets a named attribute from the named store. |
CombinedView |
getCombinedView(java.lang.String name)
Gets a named combined view. |
java.lang.String |
getDisplayName()
Gets the user's display name. |
EmulatorSessionsView |
getEmulatorSessionsView(java.lang.String name)
Gets a named application session view. |
EventsView |
getEventsView()
Gets an event view. |
boolean |
getIsAdministrator()
Checks if the user is an SGD administrator |
IServiceLocator |
getLocator()
Gets the service locator |
PrintJobsView |
getPrintJobsView(java.lang.String name)
Gets a named print jobs view. |
java.lang.String |
getSessionCookie()
Gets the user session cookie. |
java.lang.String |
getStartTCCHelperId()
Gets the ID of the SGD Client Helper that started the SGD Client. |
java.lang.String |
getTheme()
Deprecated. Get the user's theme. |
java.lang.Object |
getValue(java.lang.String attname)
Gets an arbitrary value from the session store. |
java.lang.String |
getVersion()
Gets version information for the SGD server. |
WebtopGroupContainer |
getWebtopGroupContainer(java.lang.String name)
Gets a named assigned applications group container. |
WebtopViewBean |
getWebtopView(java.lang.String name)
Gets a named assigned applications view. |
boolean |
haveAuthentication()
Tests if the session is already authenticated. |
boolean |
haveTccConnection()
Tests if there is a connection between the SGD Client and the SGD server. |
boolean |
isAuthenticated()
Tests if the session is already authenticated. |
boolean |
isEndingSession()
Checks if the session is in process of ending. |
boolean |
isReallyAuthenticated()
Tests if the session is already authenticated. |
boolean |
isTccAssociationAvailable()
Tests if it is possible to associate with an existing SGD Client. |
java.lang.String |
lookupPrefs(java.lang.String[] desiredPreferences)
Looks-up preferences for the user owning the session. |
java.lang.String |
lookupSession(java.lang.String[] desiredAttributes)
Looks-up a user session. |
java.lang.String |
lookupUser(java.lang.String[] desiredAttributes)
Looks-up attributes for the user who owns the user session. |
java.lang.String |
modifyPrefs(Item[] data)
Modifies preferences for the user owning the session. |
java.lang.String |
modifySession(Item[] data,
java.lang.String mode)
Modifies a user session. |
java.lang.String |
refreshClientInfo()
Requests an update of client information from the SGD Client. |
void |
refreshSessionState()
Tests if the session is still valid. |
java.lang.Object |
removeValue(java.lang.String attname)
Removes an arbitrary value from the session. |
java.lang.String |
restart(java.lang.String reconnectToken)
Requests that a user session is linked to an SGD Client after an SGD server restart. |
void |
setLocator(IServiceLocator locator)
Sets a service locator |
java.lang.String |
setSessionIdentity(java.lang.String username,
java.lang.String clientId,
java.lang.String locale,
java.lang.String proxyUser,
java.lang.String proxyCred)
Requests that a user session is identified with a particular user. |
void |
setTCCConfiguration(java.lang.String userAgent,
java.lang.String baseUrl,
java.lang.String version,
java.lang.String type)
Sets the configuration for selecting SGD Client. |
void |
setTCCConfigurationOverrides(java.lang.String userAgent,
java.lang.String baseUrl,
java.lang.String version,
java.lang.String type,
Item[] overrides)
Sets the configuration needed to select appropriate SGD Client. |
java.lang.String |
startTCC(java.lang.String helperId,
java.lang.String handlerURL,
java.lang.String target)
Gets the information necessary to start the SGD Client. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SessionBean()
public SessionBean(java.lang.String sessionCookieArg)
sessionCookieArg
- Existing session cookie.Method Detail |
---|
public IServiceLocator getLocator()
public void setLocator(IServiceLocator locator)
locator
- Locator of web service end-points.public java.lang.String authenticate(java.lang.String username, java.lang.String password, java.lang.String clientId, java.lang.String locale) throws java.rmi.RemoteException
username
- Username credential.password
- Password credential.clientId
- Arbitrary identifier for the client device. This parameter
determines whether the SGD server joins or grabs any
existing session belonging to the user.locale
- Preferred locale of the user.
ITarantellaWebtopSession.authenticate(String, String, String, String)
.
This response is parsed within the method and data made accessible through
getSessionCookie()
and getAttribute(String, String)
.
java.rmi.RemoteException
- On receipt of a SOAP fault.public java.lang.String authenticateExt(java.lang.String username, java.lang.String password, java.lang.String clientId, java.lang.String locale, Item[] additionalCreds, Item[] loginContext) throws java.rmi.RemoteException
username
- Username credential.password
- Password credential.clientId
- Arbitrary identifier for the client device. This parameter
determines whether the SGD server joins or grabs any
existing session belonging to the user.locale
- Preferred locale of the user.additionalCreds
- Array of additional credentials.loginContext
- Context of the multi-stage login.
This will have been returned in the SOAP fault from a previous
authentication request.
ITarantellaWebtopSession.authenticateExt(String, String, String, String, Item[], Item[])
.
java.rmi.RemoteException
- On receipt of a SOAP fault.public java.lang.String authenticateMoreInfo(Item[] additionalCreds, java.lang.String prefLang) throws java.rmi.RemoteException
additionalCreds
- Array of additional credentials.prefLang
- Preferred language.
ITarantellaWebtopSession.authenticateExt(
String, String, String, String, Item[], Item[])
for details.
java.rmi.RemoteException
- On receipt of a SOAP fault.public java.lang.String authenticateMoreInfo(Item[] additionalCreds) throws java.rmi.RemoteException
additionalCreds
- Array of additional credentials.
ITarantellaWebtopSession.authenticateExt(
String, String, String, String, Item[], Item[])
for details.
java.rmi.RemoteException
- On receipt of a SOAP fault.public java.lang.String endSession(boolean logout) throws java.rmi.RemoteException
logout
- Flag indicating if the user session is logged-out (true)
or just ended (false).
ITarantellaWebtopSession.endSession(String, boolean)
.
java.rmi.RemoteException
- On receipt of a SOAP fault.public java.lang.String lookupSession(java.lang.String[] desiredAttributes) throws java.rmi.RemoteException
desiredAttributes
- Array of attributes wanted in the response.
For available shortcuts, see ITarantellaWebtopSession.lookupSession(String, String[])
)
ITarantellaWebtopSession.lookupSession(String, String[])
.
The response is parsed within the method and the data stored in groups based
on the source of the attributes. The data is accessible through getAttribute(String, String)
. For available stores, see ITarantellaWebtopSession.lookupSession(String, String[])
)
java.rmi.RemoteException
- On receipt of a SOAP fault.public java.lang.String modifySession(Item[] data, java.lang.String mode) throws java.rmi.RemoteException
data
- Array of attributes to change.mode
- Type of modification. See ITarantellaWebtopSession.modifySession(String, Item[], String)
.
for details.
ITarantellaWebtopSession.modifySession(String, Item[], String)
.
java.rmi.RemoteException
- On receipt of a SOAP fault.public java.lang.String refreshClientInfo() throws java.rmi.RemoteException
IConstantsXML.NAME_CLIENT_ATTRS
group.
ITarantellaWebtopSession.refreshClientInfo(String)
.
java.rmi.RemoteException
- On receipt of a SOAP fault.public java.lang.String restart(java.lang.String reconnectToken) throws java.rmi.RemoteException
reconnectToken
- A token to associate the user session with an
existing SGD Client.
ITarantellaWebtopSession.restart(String, String)
.
java.rmi.RemoteException
- On receipt of a SOAP fault.public java.lang.String setSessionIdentity(java.lang.String username, java.lang.String clientId, java.lang.String locale, java.lang.String proxyUser, java.lang.String proxyCred) throws java.rmi.RemoteException
username
- The owner of the user session.clientId
- Arbitrary identifier for the client device. This parameter
determines whether the SGD server joins or grabs any
existing session belonging to the user.locale
- Preferred locale of the user.proxyUser
- The proxy user.proxyCred
- The proxy credential.
ITarantellaExternalAuth.setSessionIdentity(String, String, String)
.
java.rmi.RemoteException
- On receipt of a SOAP fault.public void setTCCConfiguration(java.lang.String userAgent, java.lang.String baseUrl, java.lang.String version, java.lang.String type) throws java.rmi.RemoteException
ITarantellaWebtopSession.setTCCConfiguration(String, String, String, String, String)
for details.
userAgent
- Identifies the browser hosting the SGD Client Helper.baseUrl
- Base URL to access the SGD Client.version
- Version of the SGD Client. This is an arbitrary value,
but is often set to the version of the SGD software.type
- Type of SGD Client Helper to use. Must be java
.
java.rmi.RemoteException
- On receipt of a SOAP fault.public void setTCCConfigurationOverrides(java.lang.String userAgent, java.lang.String baseUrl, java.lang.String version, java.lang.String type, Item[] overrides) throws java.rmi.RemoteException
userAgent
- Identifies the browser hosting the SGD Client Helper.baseUrl
- Base URL to access the SGD Client.version
- Version of the SGD Client. This is an arbitrary value,
but is often set to the version of the SGD software.type
- Type of SGD Client Helper to use. Must be java
.overrides
- Parameter overrides. See ITarantellaWebtopSession.setTCCConfigurationOverrides(String, String, String, String, String, Item[])
for details of allowed overrides.
java.rmi.RemoteException
- On receipt of a SOAP fault.public java.lang.String startTCC(java.lang.String helperId, java.lang.String handlerURL, java.lang.String target) throws java.rmi.RemoteException
helperId
- Identifies SGD Client Helper ID.handlerURL
- URL of the handler of the connection message.target
- Output window or frame for the connection message.
codeFragment
from the response to
ITarantellaWebtopSession.startTCC(String, String, String, String)
.
java.rmi.RemoteException
- On receipt of a SOAP fault.public boolean associateTCC()
setTCCConfiguration(String, String, String, String)
and startTCC(String, String, String)
.public java.lang.String getVersion() throws java.rmi.RemoteException
java.rmi.RemoteException
- On receipt of a SOAP fault.public CombinedView getCombinedView(java.lang.String name)
name
- The name of the combined view.
public EmulatorSessionsView getEmulatorSessionsView(java.lang.String name)
name
- The name of the application session view.
public WebtopViewBean getWebtopView(java.lang.String name)
name
- The name of the assigned applications view.
public PrintJobsView getPrintJobsView(java.lang.String name)
name
- The name of the print jobs view.
public EventsView getEventsView()
public WebtopGroupContainer getWebtopGroupContainer(java.lang.String name)
name
- The name of the assigned applications group container.
public java.lang.String getSessionCookie()
public java.lang.String getTheme()
public java.lang.String getDisplayName()
public java.lang.String getStartTCCHelperId()
public boolean isEndingSession()
public boolean getIsAdministrator()
public void addValue(java.lang.String attname, java.lang.Object attvalue)
attname
- The name of the attribute.attvalue
- The value to be stored.public java.lang.Object removeValue(java.lang.String attname)
attname
- The name of the attribute.
public java.lang.Object getValue(java.lang.String attname)
attname
- The name of the attribute.
public boolean isReallyAuthenticated()
public boolean haveAuthentication()
public boolean isAuthenticated()
public java.lang.String lookupUser(java.lang.String[] desiredAttributes) throws java.rmi.RemoteException
desiredAttributes
- Array of attributes wanted in the response.
IConstants.LOCAL_ATTRS
is a shortcut to get those attributes
that can be retrieved cheaply.
ITarantellaUser.lookupUser(String, String[])
for details.
java.rmi.RemoteException
- On receipt of a SOAP fault.public java.lang.String lookupPrefs(java.lang.String[] desiredPreferences) throws java.rmi.RemoteException
desiredPreferences
- The preferences wanted.
ITarantellaUser.lookupPrefs(String, String[])
for details.
java.rmi.RemoteException
- On receipt of a SOAP fault.public java.lang.String modifyPrefs(Item[] data) throws java.rmi.RemoteException
data
- The preferences to be set.
ITarantellaUser.modifyPrefs(String, Item[])
for details.
java.rmi.RemoteException
- On receipt of a SOAP fault.public java.lang.Object getAttributeObject(java.lang.String store, java.lang.String attributeName)
authenticate(String, String, String, String)
and lookupSession(String[])
. Unless the data has been obtained
from the server previously, it will be missing from the cache.
store
- The attribute store. A store is created for each source
of attributes (see ITarantellaWebtopSession.lookupSession(String, String[])
)
for the names of the stores. If store
is not one of the
named stores, it tries each store in this order until the attribute is
found or the stores exhausted.attributeName
- Name of the attribute.
public java.lang.String[] getAttributeArray(java.lang.String store, java.lang.String attributeName)
getAttributeObject(String, String)
for details.
store
- The attribute store.attributeName
- Name of the attribute.
public java.lang.String getAttribute(java.lang.String store, java.lang.String attributeName)
getAttributeObject(String, String)
for details.
store
- The attribute store.attributeName
- Name of the attribute.
public DataRequest[] authenticateMoreInfoPrompts()
IConstantsGUI
.
public boolean haveTccConnection()
public void refreshSessionState()
public boolean isTccAssociationAvailable()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |