Oracle Application Server Wireless Java API Reference
B10400-01

oracle.panama.rt
Interface Session

All Superinterfaces:
SessionParameterNames
All Known Implementing Classes:
oracle.panama.rt.common.SessionImpl

public interface Session
extends SessionParameterNames

This interface represents the session objects in PTG Runtime.

Since:
Oracle9i Application Server Wireless Edition

Field Summary

 

Fields inherited from interface oracle.panama.rt.SessionParameterNames
COOKIES, USER_NAME, USER_REF

 

Method Summary
 void addSessionListener(SessionListener listener)
          Add a listener for events from this session.
 void addSessionListeners(java.util.Vector listeners)
          Add a collection of listeners for events from session object.
 java.lang.Object getAttribute(AttributeCategory category, java.lang.String name)
          Get the value of the named attribute in the chosen category
 java.util.Enumeration getAttributeNames(AttributeCategory category)
          Get an enumeration of all attribute names in a given category
 User getAuthenticatedUser()
          Get the authenticated user who established the session.
 User getCreatingUser()
          Get the user (authenticated or virtual) who established the session.
 long getCreationTime()
          Get the creation time of the session.
 Point getCurrentLocation()
          Get the location of the user using one of the following sources, 1.
 java.lang.String getDeviceId()
          Get the device id, which can be used for identifying device
 User getEffectiveUser()
          Deprecated. use getUser instead
 Service getHomeService()
          Get the home service for this session.
 long getHomeServiceId()
          Get the user home service object id for this session.
 java.lang.String getId()
          Get the unique string identifier for the session.
 long getLastAccessedTime()
          Get the last access time of the session.
 java.util.Locale getLocale()
          Returns the locale of the session.
 LocationMark getLocationMark()
          Get the LocationMark that identifies the location of the caller.
 ManagedContext getManagedContext(java.lang.String key)
          Get the managed context for a given key.
 java.lang.String getMobileId()
          Get the mobile id, which can be used for automatic location acquisition.
 java.lang.String getNewManagedContextKey()
          Get a new key for a context to be managed.
 java.lang.String getParameter(java.lang.String paramName)
          Get the value of a parameter from the "Parameters" category
 Profile getProfile()
          Get the user profile.
 SessionHolder getSessionHolder()
          Get the session holder object that can be put in the HttpSession.
 java.lang.String getSubscriberId()
          Deprecated. use getMobileId instead
 User getUser()
          Get the effective user or authenticated user.
 void invalidate()
          Invalidate the session.
 boolean isAutoLocated()
          Get the auto located (boolean) value.
 boolean isInvalidated()
          Indicated whether the invalidate method has already been called
 boolean isUserAuthenticated()
          Check whether the user has been authenticated.
 void removeAttribute(AttributeCategory category, java.lang.String name)
          Remove the named attribute from the given category
 void removeParameter(java.lang.String paramName)
          Remove the parameter from the "Parameters" category
 void removeSessionListener(SessionListener listener)
          Remove a listener for events from this session.
 void removeSessionListeners(java.util.Vector listeners)
          Remove a collection of listeners for events from session object.
 void setAttribute(AttributeCategory category, java.lang.String name, java.lang.Object value)
          Set the value of the named attribute in the chosen category
 void setAutoLocated(boolean autoLocated)
          Set the auto located (boolean) parameter.
 void setEffectiveUser(User user)
          Set the effective user to be administered by the logged-in user.
 void setHomeServiceId(long id)
          Set the user home service object id for this session.
 void setLocationMark(LocationMark landmark)
          Set the LocationMark that identifies the location of the caller.
 void setManagedContext(java.lang.String key, ManagedContext context)
          Set the managed context for a given key.
 void setMaxInactiveInterval(long interval)
          Set the maximum inactive interval for a session.
 void setParameter(java.lang.String paramName, java.lang.String paramValue)
          Set the value of a named parameter in the "Parameters" category
 void setProfile(Profile profile)
          Set the user profile.

 

Method Detail

getAttribute

public java.lang.Object getAttribute(AttributeCategory category,
                                     java.lang.String name)
Get the value of the named attribute in the chosen category
Parameters:
category - the attribute category
name - the name of the attribute
Returns:
the value of the attribute

setAttribute

public void setAttribute(AttributeCategory category,
                         java.lang.String name,
                         java.lang.Object value)
Set the value of the named attribute in the chosen category
Parameters:
category - the attribute category
name - the name of the attribute
value - the value for named attribute

getAttributeNames

public java.util.Enumeration getAttributeNames(AttributeCategory category)
Get an enumeration of all attribute names in a given category
Parameters:
category - the attribute category
Returns:
an enumeration of Strings for attribute names

removeAttribute

public void removeAttribute(AttributeCategory category,
                            java.lang.String name)
Remove the named attribute from the given category
Parameters:
category - the attribute category
name - the name of the attribute

getParameter

public java.lang.String getParameter(java.lang.String paramName)
Get the value of a parameter from the "Parameters" category
Parameters:
paramName - name of the parameter
Returns:
value of the named parameter

setParameter

public void setParameter(java.lang.String paramName,
                         java.lang.String paramValue)
Set the value of a named parameter in the "Parameters" category
Parameters:
paramName - name of the parameter
paramValue - value of the parameter

removeParameter

public void removeParameter(java.lang.String paramName)
Remove the parameter from the "Parameters" category
Parameters:
paramName - name of the parameter

invalidate

public void invalidate()
Invalidate the session. The AdapterContext objects belonging to the session are also invalidated. It also unbinds the resources assigned to the session.
Throws:
java.lang.IllegalStateException - if this method is called on an already invalidated session
See Also:
AdapterContext

isInvalidated

public boolean isInvalidated()
Indicated whether the invalidate method has already been called
Returns:
the boolean value of the boolean parameter
See Also:
invalidate()

getCreationTime

public long getCreationTime()
Get the creation time of the session.
Returns:
a long value representing the creation timestamp

getLastAccessedTime

public long getLastAccessedTime()
Get the last access time of the session.
Returns:
a long value representing the last access timestamp

getId

public java.lang.String getId()
Get the unique string identifier for the session.
Returns:
the unique session id

getUser

public User getUser()
Get the effective user or authenticated user.
Returns:
a logged-in user

getCreatingUser

public User getCreatingUser()
Get the user (authenticated or virtual) who established the session. The User in request objects must match the User in session object for a given session id. If they don't match, session is invalidated.
Returns:
a logged-in user

getAuthenticatedUser

public User getAuthenticatedUser()
Get the authenticated user who established the session. The User in request objects must match the User in session object for a given session id. If they don't match, session is invalidated.
Returns:
a logged-in user

getEffectiveUser

public User getEffectiveUser()
Deprecated. use getUser instead
Get the effective user. Logged-in user must have administrative privilege over effective user account.
Returns:
the user being administered by logged-in user

setEffectiveUser

public void setEffectiveUser(User user)
                      throws UnauthorizedOperationException
Set the effective user to be administered by the logged-in user. It raises an exception if the logged-in user does not have administrative privilege over the effective user account.
UnauthorizedOperationException

setLocationMark

public void setLocationMark(LocationMark landmark)
Set the LocationMark that identifies the location of the caller. End-users may specify their location by selecting from a list of predefined land marks.

getLocationMark

public LocationMark getLocationMark()
Get the LocationMark that identifies the location of the caller. End-users may specify their location by selecting from a list of predefined location marks.
Returns:
the LocationMark that identifies the location of the caller

getDeviceId

public java.lang.String getDeviceId()
Get the device id, which can be used for identifying device
Returns:
the device id string

getMobileId

public java.lang.String getMobileId()
Get the mobile id, which can be used for automatic location acquisition.
Returns:
the mobile id string

getSubscriberId

public java.lang.String getSubscriberId()
Deprecated. use getMobileId instead
Get the subscriber id, which can be used for automatic location acquisition.
Returns:
the subscriber id string

getCurrentLocation

public Point getCurrentLocation()
                         throws CallerLocationException
Get the location of the user using one of the following sources, 1. from automatic location tracking module 2. from current landmark specified by user 3. or from the default landmark in the user profile
CallerLocationException

isAutoLocated

public boolean isAutoLocated()
Get the auto located (boolean) value.
Returns:
the boolean value of the boolean parameter
See Also:
setAutoLocated(boolean)

setAutoLocated

public void setAutoLocated(boolean autoLocated)
Set the auto located (boolean) parameter.
Parameters:
autoLocated - the new value for the boolean parameter
See Also:
isAutoLocated()

isUserAuthenticated

public boolean isUserAuthenticated()
Check whether the user has been authenticated.
Returns:
true if the user is authenticated

getManagedContext

public ManagedContext getManagedContext(java.lang.String key)
Get the managed context for a given key.
Parameters:
key - the unique key of a managed context
Returns:
the managed context with the given key

setManagedContext

public void setManagedContext(java.lang.String key,
ManagedContext context)
Set the managed context for a given key. The managed context will be invalidated when the session is invalidated.
Parameters:
key - the unique of the managed context
context - the context to be managed

getNewManagedContextKey

public java.lang.String getNewManagedContextKey()
Get a new key for a context to be managed. return a unique key for the context

setMaxInactiveInterval

public void setMaxInactiveInterval(long interval)
Set the maximum inactive interval for a session. The session will not expire if the interval is set to a negative number. If the interval is set to 0, the default max. interval will be used.
Parameters:
interval - the max. idle interval for time-to-live

addSessionListener

public void addSessionListener(SessionListener listener)
Add a listener for events from this session.

removeSessionListener

public void removeSessionListener(SessionListener listener)
Remove a listener for events from this session.

addSessionListeners

public void addSessionListeners(java.util.Vector listeners)
Add a collection of listeners for events from session object.

removeSessionListeners

public void removeSessionListeners(java.util.Vector listeners)
Remove a collection of listeners for events from session object.

getProfile

public Profile getProfile()
Get the user profile.

setProfile

public void setProfile(Profile profile)
Set the user profile.

getSessionHolder

public SessionHolder getSessionHolder()
Get the session holder object that can be put in the HttpSession. This holder implements the Serializable interface that is required when the Orion configured for cluster.

getHomeService

public Service getHomeService()
Get the home service for this session. This could be the user home folder or another service which object Id is set throught setHomeServiceId()
Returns:
Service the home service
See Also:
getHomeServiceId(), setHomeServiceId(long)

getHomeServiceId

public long getHomeServiceId()
Get the user home service object id for this session. If a service id has not been set in the current session, then -1 is returned.
Returns:
long the home service id
See Also:
getHomeService(), setHomeServiceId(long)

setHomeServiceId

public void setHomeServiceId(long id)
Set the user home service object id for this session.
Parameters:
id - the home service id
See Also:
getHomeService(), getHomeServiceId()

getLocale

public java.util.Locale getLocale()
Returns the locale of the session. Logic for finding the locate of the session: Use the Logged in Users locale (if present) else Use PAlang attribute (if present) else Use the Accept-Language HTTP Header in case of HTTP requests else Use the Locale specified in site configuration

Oracle Application Server Wireless Java API Reference
B10400-01

Copyright © 2003 Oracle Corporation. All Rights Reserved.