Oracle Secure Global Desktop Web Services API Documentation
Release 4.7

E21396-02

com.tarantella.tta.webservices.client.views
Class EmulatorSessionsView

java.lang.Object
  extended by java.util.Observable
      extended by com.tarantella.tta.webservices.client.views.EmulatorSessionsView
All Implemented Interfaces:
java.io.Serializable

public class EmulatorSessionsView
extends java.util.Observable

The class maintains a local cache of application sessions. By processing events, the cache can be kept current without making a lot of calls to the Secure Global Desktop (SGD) server. The class also implements many of the web service calls in ITarantellaEmulatorSession, allowing application developers to manage application sessions through a single object.

See Also:
Serialized Form

Field Summary
static java.lang.String ACTION_ENDALL
          Name of the event action to end all application sessions.
static java.lang.String ACTION_RESUMEALL
          Name of the event action to resume all application sessions.
static java.lang.String ACTION_SUSPENDALL
          Name of the event action to suspend all application sessions.
 
Method Summary
 java.lang.String endSession(java.lang.String emulatorSessionId)
          Ends an application session.
 void generateView(java.lang.String searchSpec, java.lang.String[] attributes, boolean forceRefresh)
          Generates and caches a view of application sessions.
 java.lang.String getAbsoluteURL(IResponse obj)
          Gets the absolute URL of an SGD document.
 int getEmulatorSessionsCount()
          Gets the number of application sessions in the view.
 java.util.Enumeration getEmulatorSessionsEnumeration()
          Returns a enumeration over the application sessions view.
 java.util.Enumeration<IResponse> getSortedEnumeration(java.util.Enumeration enm, java.lang.String attName)
          Gets an enumeration of IResponse objects, sorted by the value of the attribute.
 boolean isInNewBrowserWindow(IResponse object)
          Deprecated. Tests if the object is an application session that should be resumed in a new browser window. New browser mode is no longer supported.
 boolean isInPlace(IResponse object)
          Deprecated. Tests if the object is an application session that should be resumed in-place. in-place is no longer supported.
 java.lang.String lookupFullName(java.lang.String hashName)
          Looks up the full name based on the hash name.
 java.lang.String lookupSessions(java.lang.String[] emulatorSessionIds, java.lang.String[] desiredAttributes)
          Looks-up attributes for one or more application sessions.
 boolean processEvent(java.lang.String eventName, java.lang.String eventAction, java.lang.String eventData)
          Processes events affecting this view.
 java.lang.String resumeSession(java.lang.String emulatorSessionId)
          Resumes a suspended application session.
 java.lang.String resumeSessionInPlace(java.lang.String emulatorSessionId, java.lang.String launcherId)
          Deprecated. This behaves like resumeSession(String).
 java.lang.String resumeSessionInPlaceEx(java.lang.String emulatorSessionId, java.lang.String launcherId)
          Deprecated. This behaves identically to resumeSession(String).
 java.lang.String search(java.lang.String searchSpec, java.lang.String[] desiredAttributes)
          Searches for application sessions.
 void setAttributes(java.lang.String[] attrs)
           
 java.lang.String startSession(java.lang.String applicationName, Item[] launchOptions)
          Starts an application session by launching an application.
 Item startSessionInPlace(java.lang.String applicationName, java.lang.String launcherId, Item[] launchOptions)
          Deprecated. This behaves like startSession(String, Item[]).
 java.lang.String startSessionInPlaceEx(java.lang.String applicationName, java.lang.String launcherId, Item[] launchOptions)
          Deprecated. This behaves identically to startSession(String, Item[]).
 java.lang.String suspendSession(java.lang.String emulatorSessionId)
          Suspends an application session.
 
Methods inherited from class java.util.Observable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_ENDALL

public static final java.lang.String ACTION_ENDALL
Name of the event action to end all application sessions.

See Also:
Constant Field Values

ACTION_RESUMEALL

public static final java.lang.String ACTION_RESUMEALL
Name of the event action to resume all application sessions.

See Also:
Constant Field Values

ACTION_SUSPENDALL

public static final java.lang.String ACTION_SUSPENDALL
Name of the event action to suspend all application sessions.

See Also:
Constant Field Values
Method Detail

processEvent

public boolean processEvent(java.lang.String eventName,
                            java.lang.String eventAction,
                            java.lang.String eventData)
                     throws java.rmi.RemoteException
Processes events affecting this view. If the view is unable to process the event, the local cache may be invalid. It is the responsibility of the caller to refresh the cache in these circumstances.

Parameters:
eventName - Name of the event. Supported events are:
IConstants.SESSION_EVT
eventAction - Event action. Supported actions are:
ACTION_ENDALL End all application sessions for the user.
ACTION_RESUMEALL Resume all application sessions for the user.
ACTION_SUSPENDALL Suspend all application sessions for the user.
IConstants.ACTION_SESSION_ADDED Add an application sessions to the cached view.
IConstants.ACTION_SESSION_REMOVED Remove an application sessions to the cached view.
IConstants.ACTION_VIEW_REFRESH Refresh the local cached view from the SGD server.
eventData - Event data, for example, the application session ID.
Returns:
true if the event was processed and the view updated
false if the event was not processed leaving the view corrupt
Throws:
java.rmi.RemoteException - On receipt of a SOAP fault.
Since:
1.0

generateView

public void generateView(java.lang.String searchSpec,
                         java.lang.String[] attributes,
                         boolean forceRefresh)
                  throws java.rmi.RemoteException
Generates and caches a view of application sessions.

Parameters:
searchSpec - RFC 2254 search specification to select matching application sessions
attributes - The attributes desired in the response
forceRefresh - Flag controlling how the request is serviced.
true request must be sent to the server
false request may be serviced from the cached view
Throws:
java.rmi.RemoteException - On receipt of a SOAP fault.
Since:
1.0

isInPlace

public boolean isInPlace(IResponse object)
Deprecated. Tests if the object is an application session that should be resumed in-place. in-place is no longer supported.

Parameters:
object - Application session object
Returns:
Always false
Since:
1.0

isInNewBrowserWindow

public boolean isInNewBrowserWindow(IResponse object)
Deprecated. Tests if the object is an application session that should be resumed in a new browser window. New browser mode is no longer supported.

Parameters:
object - Application session object
Returns:
Always false
Since:
1.0

getEmulatorSessionsCount

public int getEmulatorSessionsCount()
Gets the number of application sessions in the view.

Returns:
The number of application sessions.
Since:
1.0

getEmulatorSessionsEnumeration

public java.util.Enumeration getEmulatorSessionsEnumeration()
Returns a enumeration over the application sessions view.

Returns:
An enumeration of the view of application sessions. The sessions are delivered as IResponse objects.
Since:
1.0

endSession

public java.lang.String endSession(java.lang.String emulatorSessionId)
                            throws java.rmi.RemoteException
Ends an application session.

NOTE: this API cannot be guaranteed to stop the application cleanly and should be used with caution. Whenever possible, users should close their applications.

Parameters:
emulatorSessionId - Identifies the application session.
Returns:
See ITarantellaEmulatorSession.endSession(String, String).
Throws:
java.rmi.RemoteException - On receipt of a SOAP fault.
Since:
1.0

lookupSessions

public java.lang.String lookupSessions(java.lang.String[] emulatorSessionIds,
                                       java.lang.String[] desiredAttributes)
                                throws java.rmi.RemoteException
Looks-up attributes for one or more application sessions.

Parameters:
emulatorSessionIds - Array of application session IDs.
desiredAttributes - Array of attributes wanted in the response. IConstants.LOCAL_ATTRS is a shortcut to get those attributes that can be retrieved cheaply.
Returns:
See ITarantellaEmulatorSession.lookupSessions(String, String[], String[]).
Throws:
java.rmi.RemoteException - On receipt of a SOAP fault.
Since:
1.0

resumeSession

public java.lang.String resumeSession(java.lang.String emulatorSessionId)
                               throws java.rmi.RemoteException
Resumes a suspended application session.

Parameters:
emulatorSessionId - Identifies the application session.
Returns:
See ITarantellaEmulatorSession.resumeSession(String, String).
Throws:
java.rmi.RemoteException - On receipt of a SOAP fault.
Since:
1.0

resumeSessionInPlaceEx

public java.lang.String resumeSessionInPlaceEx(java.lang.String emulatorSessionId,
                                               java.lang.String launcherId)
                                        throws java.rmi.RemoteException
Deprecated. This behaves identically to resumeSession(String).

Parameters:
emulatorSessionId - Identifies the application session.
launcherId - Name of the in-place launcher.
Returns:
See ITarantellaEmulatorSession.resumeSession(String, String).
Throws:
java.rmi.RemoteException - On receipt of a SOAP fault.
Since:
1.0

resumeSessionInPlace

public java.lang.String resumeSessionInPlace(java.lang.String emulatorSessionId,
                                             java.lang.String launcherId)
                                      throws java.rmi.RemoteException
Deprecated. This behaves like resumeSession(String).

Parameters:
emulatorSessionId - Identifies the application session.
launcherId - Name of the in-place launcher.
Returns:
An empty string.
Throws:
java.rmi.RemoteException - On receipt of a SOAP fault.
Since:
1.0

search

public java.lang.String search(java.lang.String searchSpec,
                               java.lang.String[] desiredAttributes)
                        throws java.rmi.RemoteException
Searches for application sessions.

Parameters:
searchSpec - RFC 2254 search specification to select matching application sessions.
desiredAttributes - Array of attributes wanted in the response. IConstants.LOCAL_ATTRS is a shortcut to get those attributes that can be retrieved cheaply.
Returns:
See ITarantellaEmulatorSession.search(String, String, String[]).
Throws:
java.rmi.RemoteException - On receipt of a SOAP fault.
Since:
1.0

startSession

public java.lang.String startSession(java.lang.String applicationName,
                                     Item[] launchOptions)
                              throws java.rmi.RemoteException
Starts an application session by launching an application.

Parameters:
applicationName - The name of the application to launch.
launchOptions - Array of optional overrides for the launch. See ITarantellaEmulatorSession.startSession(String, String, Item[]) for details.
Returns:
See ITarantellaEmulatorSession.startSession(String, String, Item[]).
Throws:
java.rmi.RemoteException - On receipt of a SOAP fault.
Since:
1.0

startSessionInPlaceEx

public java.lang.String startSessionInPlaceEx(java.lang.String applicationName,
                                              java.lang.String launcherId,
                                              Item[] launchOptions)
                                       throws java.rmi.RemoteException
Deprecated. This behaves identically to startSession(String, Item[]).

Parameters:
applicationName - The name of the application to launch.
launcherId - ID of the in-place launcher
launchOptions - Array of optional overrides for the launch.
Returns:
See ITarantellaEmulatorSession.startSession(String, String, Item[]).
Throws:
java.rmi.RemoteException - On receipt of a SOAP fault.
Since:
1.0

startSessionInPlace

public Item startSessionInPlace(java.lang.String applicationName,
                                java.lang.String launcherId,
                                Item[] launchOptions)
                         throws java.rmi.RemoteException
Deprecated. This behaves like startSession(String, Item[]).

Parameters:
applicationName - The name of the application to launch.
launcherId - ID of the in-place launcher
launchOptions - Array of optional overrides for the launch.
Returns:
If applicationName is an SGD application type, an empty Item is returned. If applicationName is an SGD document type, the document URL is returned in the Item.
Throws:
java.rmi.RemoteException - On receipt of a SOAP fault.
Since:
1.0

suspendSession

public java.lang.String suspendSession(java.lang.String emulatorSessionId)
                                throws java.rmi.RemoteException
Suspends an application session. Administrators may suspend sessions belonging to any user, other users may only suspend their own. Suspending sessions with "never" resumability ends them.

Parameters:
emulatorSessionId - Identifies the application session.
Returns:
See ITarantellaEmulatorSession.suspendSession(String, String).
Throws:
java.rmi.RemoteException - On receipt of a SOAP fault.
Since:
1.0

setAttributes

public void setAttributes(java.lang.String[] attrs)

lookupFullName

public java.lang.String lookupFullName(java.lang.String hashName)
Looks up the full name based on the hash name.

Parameters:
hashName - The hash name of the object.
Returns:
The full name of the object.
Since:
1.1

getAbsoluteURL

public java.lang.String getAbsoluteURL(IResponse obj)
Gets the absolute URL of an SGD document. This is a dummy implementation that can be overridden in sub-classes.

Parameters:
obj - The document object.
Returns:
The absolute URL.
Since:
1.1

getSortedEnumeration

public java.util.Enumeration<IResponse> getSortedEnumeration(java.util.Enumeration enm,
                                                             java.lang.String attName)
Gets an enumeration of IResponse objects, sorted by the value of the attribute.

Parameters:
enm - Initial enumeration
attName - Name of the attribute on which to sort
Returns:
The sorted enumeration.
Since:
1.3

Oracle Secure Global Desktop Web Services API Documentation
Release 4.7

E21396-02

Copyright © 2012, 2013, Oracle and/or its affiliates. All rights reserved.