at.spardat.xma.session
Class XMASessionServer

java.lang.Object
  extended byat.spardat.xma.session.XMASession
      extended byat.spardat.xma.session.XMASessionServer

public class XMASessionServer
extends XMASession

The representation of a XMA session at the server side.


Constructor Summary
XMASessionServer(javax.servlet.http.HttpSession httpSession, javax.security.auth.Subject subject, java.lang.String contextPath)
          Constructor which creates an XMASessionServer and binds this as an attribute to the provided httpSession.
 
Method Summary
 byte[] getApplicationVersion()
          Application Hash-Code built from application descriptors.
 java.lang.String getBootRuntimeVersion()
           
 java.lang.String getClientIPAddress()
           
 ComponentServer getComponent(short id)
          Returns the ComponentServer registered for the provided id or null if there is no such component.
 java.lang.String getComponentClassName(java.lang.String namComponent)
          Given the short name of a component (which is also the name of the class without the package name), this method returns the fully qualified name of the components class.
 XMAContext getContext()
          Returns the execution context of this session.
 java.lang.String getContextPath()
          Returns the context path of the enclosing web-application.
 void getCounts(int[] counts)
          Requires that counts holds an array of size at least 3 and returns the following counts in the array elements: The number of stateful components active in this session, the number of pages in all these components and the estimated number of bytes of all pages in all components in this session.
 javax.servlet.http.HttpSession getHttpSession()
          Returns the servlet session that this XMASession is an attribute of.
 PluginManager getPluginManager()
          Returns the PluginManager that must be used to retrieve client side plugin implementations.
 java.util.Map getServerHighCounts()
           
 javax.security.auth.Subject getSubject()
          Returns the subject as supplied by the JAAS conforming login module.
static XMASession getXMASession()
          Returns the XMASession bound to the currently executing thread.
static XMASessionServer getXMASession(javax.servlet.http.HttpSession httpSession)
          Returns the XMASessionServer object that is bound to the given httpSession or null if none is bound yet.
 boolean isAtServer()
          Returns true if this session is in the server JVM.
 void registerComponent(ComponentServer cs)
          Registers a Component with this session if the component is stateful.
 void removeComponent(short id)
          Removes a component with a given id from this.
static void setSessionAsThreadLocal(XMASessionServer session)
          Sets the provided session as the current threads session.
 
Methods inherited from class at.spardat.xma.session.XMASession
checkPermission, getApplicationVersionShort
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMASessionServer

public XMASessionServer(javax.servlet.http.HttpSession httpSession,
                        javax.security.auth.Subject subject,
                        java.lang.String contextPath)
Constructor which creates an XMASessionServer and binds this as an attribute to the provided httpSession.

Parameters:
httpSession - the servlet session this is an attribute of.
contextPath - the context path of the webapplication without leading slash.
Throws:
java.lang.IllegalStateException - if there is already an XMASession bound to the provided httpSession.
Method Detail

getContextPath

public java.lang.String getContextPath()
Returns the context path of the enclosing web-application.

Returns:
a String never null. The leading slash of the context path is not returned.

getXMASession

public static XMASessionServer getXMASession(javax.servlet.http.HttpSession httpSession)
Returns the XMASessionServer object that is bound to the given httpSession or null if none is bound yet.


getContext

public XMAContext getContext()
Returns the execution context of this session. All callers of this method may rely on the fact that the information stored in the XMAContext remain stable, i.e., won't change over the lifetime of this session. This pertains to the authenticated user, the mandant and the environment.

Specified by:
getContext in class XMASession
Returns:
context never null.

getSubject

public javax.security.auth.Subject getSubject()
Returns the subject as supplied by the JAAS conforming login module.

Specified by:
getSubject in class XMASession
Returns:
the subject provided by the login module.

registerComponent

public void registerComponent(ComponentServer cs)
Registers a Component with this session if the component is stateful.

Parameters:
cs - the Component to register. cs is required to 1) have a valid id set and 2) that a component with this id is not registered yet.
Throws:
java.lang.IllegalArgumentException - if some of above mentioned conditions is violated.

removeComponent

public void removeComponent(short id)
Removes a component with a given id from this. This method does nothing if there is no component with the provided id managed in this.

May only be called from ComponentServer!!!!!


getComponent

public ComponentServer getComponent(short id)
Returns the ComponentServer registered for the provided id or null if there is no such component.


getComponentClassName

public java.lang.String getComponentClassName(java.lang.String namComponent)
Given the short name of a component (which is also the name of the class without the package name), this method returns the fully qualified name of the components class.

Parameters:
namComponent - the name of the component
Returns:
the fully qualified class name

getCounts

public void getCounts(int[] counts)
Requires that counts holds an array of size at least 3 and returns the following counts in the array elements: The number of stateful components active in this session, the number of pages in all these components and the estimated number of bytes of all pages in all components in this session.


getHttpSession

public javax.servlet.http.HttpSession getHttpSession()
Returns the servlet session that this XMASession is an attribute of.

Returns:
HttpSession never null.

getXMASession

public static XMASession getXMASession()
Returns the XMASession bound to the currently executing thread. You may use this mehthod only after a RemoteCall has been dispatched to the XMA server which executes in this thread and the thread did not change. This is normally the case but it needs not be so in all cases.


setSessionAsThreadLocal

public static void setSessionAsThreadLocal(XMASessionServer session)
Sets the provided session as the current threads session. May be null to reset the session at the end of an RemoteCall execution.


getPluginManager

public PluginManager getPluginManager()
Description copied from class: XMASession
Returns the PluginManager that must be used to retrieve client side plugin implementations.

Specified by:
getPluginManager in class XMASession
Returns:
a PluginManagerClient that is never null.

getApplicationVersion

public byte[] getApplicationVersion()
Application Hash-Code built from application descriptors.

Specified by:
getApplicationVersion in class XMASession
Returns:
Application Version Hash-Code

isAtServer

public boolean isAtServer()
Description copied from class: XMASession
Returns true if this session is in the server JVM.

Specified by:
isAtServer in class XMASession
See Also:
XMASession.isAtServer()

getServerHighCounts

public java.util.Map getServerHighCounts()
Returns:
Returns the serverHighCounts_.

getBootRuntimeVersion

public java.lang.String getBootRuntimeVersion()
Returns:
The Clients Bootruntime Version. Returns '<1.4.0' for a Bootruntime before 1.4.0.
Since:
version_number

getClientIPAddress

public java.lang.String getClientIPAddress()
Returns:
The Clients IP Address Version
Since:
version_number