com.sap.netweaver.bc.uwl

Interface IUWLSession


public interface IUWLSession

The IUWLSession class contains all the session scope information relevant for UWL Service. By calling IUWLService.beginSession(UWLContext, int), a new session is created. This session could then be re-used for further calls to the UWL Service.

When any WebDynpro application running on the same portal is launched from UWL, application could use the ClientSession scope variable IUWLSession.UWL_SESSION_ID to get the current UWL session id. From this session id, UWL session could be got from UWL service. WebDynpro applications should use IUWLService.getUwlSessionForWebDynproClient(UWLContext) method to get access to the UWL Service.


Field Summary
static String UWL_SESSION_ID
          Use this constant to get UWL session's identifer through the HTTP session or WebDynpro Session Scope.
 
Method Summary
 Object getAttribute(String key)
          This obtains the value of an attribute identified by the given key.
 Map getAttributes()
          Returns the map of all attributes of this session.
 IUWLEventListener getEventListener()
          Returns the event listner that is registered.
 String getId()
          Identifer for the session.
 ProviderStatus[] getLastProviderStatus()
          Returns the last connection status for different Provider systems.
 IUser getUser()
          Returns the user to whom this session belongs to.
 boolean isValid()
          Returns if the session is valid or not.
 void removeAttribute(String key)
          Removes the attribute identified by the given key.
 void setAttribute(String key, Object value)
          This sets the attribute like subject.
 void setEventListener(IUWLEventListener listener)
          Method to register an event listener to UWL.
 

Field Detail

UWL_SESSION_ID

public static final String UWL_SESSION_ID
Use this constant to get UWL session's identifer through the HTTP session or WebDynpro Session Scope. When UWL session is created, the client could optionally use this key to create the HttpSession variable and share it across different UI components. Do note this is just the session Id. uwlService.getSession() could be called to get the actual session handle.

See Also:
Constant Field Values
Method Detail

setEventListener

public void setEventListener(IUWLEventListener listener)
Method to register an event listener to UWL. For one session there can be only one event listener. Methods on the listener are called as long as the session is valid. If session expires or no longer valid then no more events are invoked on the listener implementation.

Parameters:
listener - Providing a null value removes the registration.
See Also:
IUWLEventListener

getEventListener

public IUWLEventListener getEventListener()
Returns the event listner that is registered.

Returns:
could be null if listener is not set

setAttribute

public void setAttribute(String key,
                         Object value)
This sets the attribute like subject.

Parameters:
key - the key of the attribute.
value - the value of the attribute.

getUser

public IUser getUser()
Returns the user to whom this session belongs to.

Returns:
user to which the session belongs to, not null

getAttribute

public Object getAttribute(String key)
This obtains the value of an attribute identified by the given key.

Parameters:
key - the key of attribute.
Returns:
Object the value of the attribute.

removeAttribute

public void removeAttribute(String key)
Removes the attribute identified by the given key.

Parameters:
key - the key of the attribute.

getAttributes

public Map getAttributes()
Returns the map of all attributes of this session.

Returns:
Map

getId

public String getId()
Identifer for the session. This identifer could be used to get a handle to IUWLSession thro IUWLService.getSession() method.

Returns:
String the session Identifer.

getLastProviderStatus

public ProviderStatus[] getLastProviderStatus()
Returns the last connection status for different Provider systems.

Returns:
ProviderStatus[] the array of ProviderStatus objects.

isValid

public boolean isValid()
Returns if the session is valid or not. A session becomes invalid when it either timesout or endSession is called.

Returns:
boolean
See Also:
IUWLService.endSession(com.sap.netweaver.bc.uwl.UWLContext)


Copyright 2006 SAP AG Complete Copyright Notice