NextApp Echo2
v2.1.1

nextapp.echo2.webrender
Class UserInstance

java.lang.Object
  extended by nextapp.echo2.webrender.UserInstance
All Implemented Interfaces:
java.io.Serializable, java.util.EventListener, javax.servlet.http.HttpSessionActivationListener, javax.servlet.http.HttpSessionBindingListener

public abstract class UserInstance
extends java.lang.Object
implements javax.servlet.http.HttpSessionActivationListener, javax.servlet.http.HttpSessionBindingListener, java.io.Serializable

An abstract base class representing a single user-instance of an application hosted in an application container.

See Also:
Serialized Form

Field Summary
static java.lang.String PROPERTY_CLIENT_CONFIGURATION
           
static java.lang.String PROPERTY_SERVER_DELAY_MESSAGE
           
 
Constructor Summary
UserInstance(Connection conn)
          Creates a new UserInstance.
 
Method Summary
 java.lang.String getCharacterEncoding()
          Returns the default character encoding in which responses should be rendered.
 ClientConfiguration getClientConfiguration()
          the ServerDelayMessage displayed during client/server-interactions.
 ClientProperties getClientProperties()
          Retrieves the ClientProperties object providing information about the client of this instance.
 long getCurrentTransactionId()
          Returns the current transaction id.
 long getNextTransactionId()
          Increments the current transaction id and returns it.
 ServerDelayMessage getServerDelayMessage()
          Retrieves the ServerDelayMessage displayed during client/server-interactions.
 java.lang.String getServiceUri(Service service)
          Determines the URI to invoke the specified Service.
 java.lang.String getServiceUri(Service service, java.lang.String[] parameterNames, java.lang.String[] parameterValues)
          Determines the URI to invoke the specified Service with additional request parameters.
 java.lang.String getServletUri()
          Returns the URI of the servlet managing this UserInstance.
 javax.servlet.http.HttpSession getSession()
          Returns the HttpSession containing this UserInstance.
 UserInstanceUpdateManager getUserInstanceUpdateManager()
          Returns the UserInstanceUpdateManager providing information about updated UserInstance properties.
 void sessionDidActivate(javax.servlet.http.HttpSessionEvent e)
           
 void sessionWillPassivate(javax.servlet.http.HttpSessionEvent e)
           
 void setClientConfiguration(ClientConfiguration clientConfiguration)
          Sets the ClientConfiguration information containing application-specific client behavior settings.
 void setServerDelayMessage(ServerDelayMessage serverDelayMessage)
          Sets the ServerDelayMessage displayed during client/server-interactions.
 void valueBound(javax.servlet.http.HttpSessionBindingEvent e)
          Listener implementation of HttpSessionBindingListener.
 void valueUnbound(javax.servlet.http.HttpSessionBindingEvent e)
          Listener implementation of HttpSessionBindingListener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_CLIENT_CONFIGURATION

public static final java.lang.String PROPERTY_CLIENT_CONFIGURATION
See Also:
Constant Field Values

PROPERTY_SERVER_DELAY_MESSAGE

public static final java.lang.String PROPERTY_SERVER_DELAY_MESSAGE
See Also:
Constant Field Values
Constructor Detail

UserInstance

public UserInstance(Connection conn)
Creates a new UserInstance.

Parameters:
conn - the client/server Connection for which the instance is being instantiated
Method Detail

getCharacterEncoding

public java.lang.String getCharacterEncoding()
Returns the default character encoding in which responses should be rendered.

Returns:
the default character encoding in which responses should be rendered

getClientConfiguration

public ClientConfiguration getClientConfiguration()
the ServerDelayMessage displayed during client/server-interactions. Retrieves the ClientConfiguration information containing application-specific client behavior settings.

Returns:
the relevant ClientProperties

getClientProperties

public ClientProperties getClientProperties()
Retrieves the ClientProperties object providing information about the client of this instance.

Returns:
the relevant ClientProperties

getCurrentTransactionId

public long getCurrentTransactionId()
Returns the current transaction id.

Returns:
the current transaction id

getNextTransactionId

public long getNextTransactionId()
Increments the current transaction id and returns it.

Returns:
the current transaction id, after an increment

getServerDelayMessage

public ServerDelayMessage getServerDelayMessage()
Retrieves the ServerDelayMessage displayed during client/server-interactions.

Returns:
the ServerDelayMessage

getServiceUri

public java.lang.String getServiceUri(Service service)
Determines the URI to invoke the specified Service.

Parameters:
service - the Service
Returns:
the URI

getServiceUri

public java.lang.String getServiceUri(Service service,
                                      java.lang.String[] parameterNames,
                                      java.lang.String[] parameterValues)
Determines the URI to invoke the specified Service with additional request parameters. The additional parameters are provided by way of the parameterNames and parameterValues arrays. The value of a parameter at a specific index in the parameterNames array is provided in the parameterValues array at the same index. The arrays must thus be of equal length. Null values are allowed in the parameterValues array, and in such cases only the parameter name will be rendered in the returned URI.

Parameters:
service - the Service
parameterNames - the names of the additional URI parameters
parameterValues - the values of the additional URI parameters
Returns:
the URI

getServletUri

public java.lang.String getServletUri()
Returns the URI of the servlet managing this UserInstance.

Returns:
the URI

getUserInstanceUpdateManager

public UserInstanceUpdateManager getUserInstanceUpdateManager()
Returns the UserInstanceUpdateManager providing information about updated UserInstance properties.

Returns:
the UserInstanceUpdateManager

getSession

public javax.servlet.http.HttpSession getSession()
Returns the HttpSession containing this UserInstance.

Returns:
the HttpSession

sessionDidActivate

public void sessionDidActivate(javax.servlet.http.HttpSessionEvent e)
Specified by:
sessionDidActivate in interface javax.servlet.http.HttpSessionActivationListener
See Also:
HttpSessionActivationListener.sessionDidActivate(javax.servlet.http.HttpSessionEvent)

sessionWillPassivate

public void sessionWillPassivate(javax.servlet.http.HttpSessionEvent e)
Specified by:
sessionWillPassivate in interface javax.servlet.http.HttpSessionActivationListener
See Also:
HttpSessionActivationListener.sessionWillPassivate(javax.servlet.http.HttpSessionEvent)

setClientConfiguration

public void setClientConfiguration(ClientConfiguration clientConfiguration)
Sets the ClientConfiguration information containing application-specific client behavior settings.

Parameters:
clientConfiguration - the new ClientConfiguration

setServerDelayMessage

public void setServerDelayMessage(ServerDelayMessage serverDelayMessage)
Sets the ServerDelayMessage displayed during client/server-interactions.

Parameters:
serverDelayMessage - the new ServerDelayMessage

valueBound

public void valueBound(javax.servlet.http.HttpSessionBindingEvent e)
Listener implementation of HttpSessionBindingListener. Stores reference to session when invoked.

Specified by:
valueBound in interface javax.servlet.http.HttpSessionBindingListener
See Also:
HttpSessionBindingListener.valueBound(HttpSessionBindingEvent)

valueUnbound

public void valueUnbound(javax.servlet.http.HttpSessionBindingEvent e)
Listener implementation of HttpSessionBindingListener. Removes reference to session when invoked.

Specified by:
valueUnbound in interface javax.servlet.http.HttpSessionBindingListener
See Also:
HttpSessionBindingListener.valueUnbound(HttpSessionBindingEvent)

NextApp Echo2
v2.1.1