com.ibm.retail.AEF.session
Interface AEFSession

All Superinterfaces:
java.rmi.Remote

public interface AEFSession
extends java.rmi.Remote

An AEFSession provides an object encapsulation of a POS terminal session. The AEFSession provides access to the data and function provided by the POS application. An instance of an AEFSession is distinguished by the terminal number associated with the session. Each session is identified by a unique terminal number. A session runs in either in "real" terminal mode (i.e., in a POS Terminal with real devices) or in a "virtual" terminal mode (i.e., in a server environment with emulated devices.
To perform an action on an AEFSession (e.g., logon(), addItem()), use the POSAutomationProvider interface.
To access data and monitor events associated with an AEFSession, use the use the POSDataProvider interface.

See Also:
Accessing the POSDataProvider, Accessing the POSAutomationProvider

Method Summary
 void addSessionStatusListener(com.ibm.retail.AEF.session.SessionStatusListener listener)
          Add a listener for SessionStatus events.
 void addSessionTraceSocketHandler(java.lang.String host, int port)
          Add a socket handler to the session trace.
 void addToEventQueue(com.ibm.retail.AEF.util.AEFEventQueueRunnable obj)
          Add a runnable object to the sessions event queue.
 void dumpSessionTrace()
          Dump the session trace buffer to the trace file.
 com.ibm.retail.AEF.data.ApplicationDataConnector getApplicationDataConnector()
          Get the ApplicationDataConnector for this terminal session.
 java.net.InetSocketAddress getHealthServerAddress()
          Get the address of the AEF Health Server for this session.
 com.ibm.retail.AEF.automation.POSAutomationProvider getPOSAutomationProvider()
          Get the POSAutomationProvider (automation API) for this terminal session.
 com.ibm.retail.AEF.data.POSDataProvider getPOSDataProvider()
          Get the POSDataProvider associated with this terminal session.
 int getSessionTraceLevel()
          Returns the current trace level for the session.
 java.lang.String getTerminalNumber()
          Get the terminal number for this terminal session.
 java.lang.String[] getTraceBuffer()
          Returns a String array of the trace buffer.
 com.ibm.retail.AEF.workstation.Workstation getWorkstation()
          Returns the Workstation object for this session.
 boolean isApplicationActive()
          Is the terminal sales application active?
 boolean isAutoDumpSessionTrace()
          Indicates if the session trace buffer auto dumps for AEF exceptions.
 boolean isAvailable()
          Indicate if this session is available.
 boolean isReady()
          Indicate if this session ready for client actions.
 boolean isReserved()
          Indicate if this session is reserved.
 boolean isSessionTraceEnabled(int level)
          Indicates if session trace is enabled for this session for a specified log level.
 boolean isTSSSession()
          Indicates if this a virtual session object.
 boolean isVirtualSession()
          Indicates if this a virtual session object.
 void reference()
          Increment the client reference count for this session.
 void release()
          Decrement the client reference count for this session.
 void removeSessionStatusListener(com.ibm.retail.AEF.session.SessionStatusListener listener)
          Remove a listener for SessionStatus events.
 void removeSessionTraceSocketHandler()
          Remove the session trace socket handler.
 void sessionTrace(int level, java.lang.String msg)
          Write to the session trace buffer with the specified level.
 void setSessionTraceLevel(int level)
          Set the trace level for the session.
 void startApplication()
          Start the terminal sales application.
 void stopApplication()
          Stop the terminal sales application.
 void terminate()
          Cause the session to perform any cleanup required before it is terminated.
 void waitForPendingEvents()
          Wait for events currently pending on the session event queue to complete.
 boolean waitUntilReady(int timeout)
          Wait until this session is ready for processing.
 

Method Detail

getPOSDataProvider

public com.ibm.retail.AEF.data.POSDataProvider getPOSDataProvider()
                                                           throws java.rmi.RemoteException
Get the POSDataProvider associated with this terminal session.
The POSDataProvider provides access to listener interfaces and access to the data associated with the AEFSession.

Returns:
POSDataProvider object for this terminal session
Throws:
java.rmi.RemoteException

getPOSAutomationProvider

public com.ibm.retail.AEF.automation.POSAutomationProvider getPOSAutomationProvider()
                                                                             throws java.rmi.RemoteException
Get the POSAutomationProvider (automation API) for this terminal session.
The POSAutomationProvider allows actions (e.g., logon, add an item) to be performed on the AEFSession.

Returns:
POSAutomationProvider object for this terminal session
Throws:
java.rmi.RemoteException

getApplicationDataConnector

public com.ibm.retail.AEF.data.ApplicationDataConnector getApplicationDataConnector()
                                                                             throws java.rmi.RemoteException
Get the ApplicationDataConnector for this terminal session.
The ApplicationDataConnector provides the interface for sending XML event data from the POS application to the AEFSession.

Returns:
ApplicationDataConnector object for this terminal session
Throws:
java.rmi.RemoteException

getTerminalNumber

public java.lang.String getTerminalNumber()
                                   throws java.rmi.RemoteException
Get the terminal number for this terminal session. The terminal number uniquely identifies the session.

Returns:
terminal number for this terminal session
Throws:
java.rmi.RemoteException

isAvailable

public boolean isAvailable()
                    throws java.rmi.RemoteException
Indicate if this session is available.
An AEFSession is available if no other client has referenced the session.

Returns:
true if this session is available
Throws:
java.rmi.RemoteException
See Also:
Referencing a session, Obtaining an available session

isReserved

public boolean isReserved()
                   throws java.rmi.RemoteException
Indicate if this session is reserved.
An AEFSession that is reserved is not considered available to clients that attempt to obtain a session through SessionServer.getAvailableSession(). Sessions that are reserved can only be obtained through SessionServer.getSession().

Returns:
true if this session is reserved
Throws:
java.rmi.RemoteException
See Also:
Obtaining an available session, Obtaining a specific session

isReady

public boolean isReady()
                throws java.rmi.RemoteException
Indicate if this session ready for client actions. A sessions must be "ready" before it can process action requests from the automation API.

Returns:
true if this session is ready
Throws:
java.rmi.RemoteException
See Also:
waitUntilReady

waitUntilReady

public boolean waitUntilReady(int timeout)
                       throws java.rmi.RemoteException
Wait until this session is ready for processing. Return true if the session is ready. If not ready , the method will timeout and return false.

Parameters:
timeout - timeout value in milliseconds
Returns:
true if session is ready
Throws:
java.rmi.RemoteException
See Also:
isReady

reference

public void reference()
               throws java.rmi.RemoteException
Increment the client reference count for this session.
Referencing a session removes it from the pool of available sessions. Use the release() method to return it to the pool of available sessions.

Throws:
java.rmi.RemoteException
See Also:
release

release

public void release()
             throws java.rmi.RemoteException,
                    AEFException
Decrement the client reference count for this session. When all clients referencing a session have released the session, it is returned to the pool of available sessions.

Throws:
java.rmi.RemoteException
AEFException - Among the possible AEFException error codes are:
AEFConst.CLIENT_SESSION_MISMATCH
See Also:
Reference a session

isVirtualSession

public boolean isVirtualSession()
                         throws java.rmi.RemoteException
Indicates if this a virtual session object. A virtual session runs with emulated devices, not in a real POS terminal.

Returns:
true if this session is a virtual session.
Throws:
java.rmi.RemoteException

isTSSSession

public boolean isTSSSession()
                     throws java.rmi.RemoteException
Indicates if this a virtual session object. A virtual session runs with emulated devices, not in a real POS terminal.

Returns:
true if this session is a virtual session.
Throws:
java.rmi.RemoteException

addToEventQueue

public void addToEventQueue(com.ibm.retail.AEF.util.AEFEventQueueRunnable obj)
                     throws java.rmi.RemoteException
Add a runnable object to the sessions event queue. Objects added to the event queue are enqueued on the session's event queue thread and are executed when it reaches the front of the queue.

Parameters:
obj - object to be enqueued
Throws:
java.rmi.RemoteException

waitForPendingEvents

public void waitForPendingEvents()
                          throws java.rmi.RemoteException
Wait for events currently pending on the session event queue to complete. Objects added to the event queue are enqueued on the session's event queue thread and are executed when it reaches the front of the queue. This method will block until the current set of pending events have completed.

Throws:
java.rmi.RemoteException

getWorkstation

public com.ibm.retail.AEF.workstation.Workstation getWorkstation()
                                                          throws java.rmi.RemoteException
Returns the Workstation object for this session.

Returns:
Workstation object for this session
Throws:
java.rmi.RemoteException

isSessionTraceEnabled

public boolean isSessionTraceEnabled(int level)
                              throws java.rmi.RemoteException
Indicates if session trace is enabled for this session for a specified log level. Session trace provides an diagnostic in-memory trace of session behavior.

Parameters:
level - level of messages to be logged
Throws:
java.rmi.RemoteException

sessionTrace

public void sessionTrace(int level,
                         java.lang.String msg)
                  throws java.rmi.RemoteException
Write to the session trace buffer with the specified level. The message will only be written if the current session trace level is set at or below the given level.
 SessionTrace.DUMP   = Write an error message
 SessionTrace.COARSE = Low tracing message
 SessionTrace.MEDIUM = Medium tracing message
 SessionTrace.FINE   = High tracing message
 

Parameters:
level - level of message
msg - message to be written to the session trace buffer
Throws:
java.rmi.RemoteException

setSessionTraceLevel

public void setSessionTraceLevel(int level)
                          throws java.rmi.RemoteException
Set the trace level for the session. This allows you to control the level of trace information written to the session trace buffer.
 SessionTrace.OFF    = Turn the session trace off
 SessionTrace.DUMP   = Write to trace on error only
 SessionTrace.COARSE = Low tracing
 SessionTrace.MEDIUM = Medium tracing
 SessionTrace.FINE   = High tracing
 

Parameters:
level - level of message
Throws:
java.rmi.RemoteException

getSessionTraceLevel

public int getSessionTraceLevel()
                         throws java.rmi.RemoteException
Returns the current trace level for the session.

Returns:
Current session trace level
Throws:
java.rmi.RemoteException

dumpSessionTrace

public void dumpSessionTrace()
                      throws java.rmi.RemoteException
Dump the session trace buffer to the trace file.
The trace filename pattern is defined in config.properties using the property trace.file.pattern.

Throws:
java.rmi.RemoteException

isAutoDumpSessionTrace

public boolean isAutoDumpSessionTrace()
                               throws java.rmi.RemoteException
Indicates if the session trace buffer auto dumps for AEF exceptions. This property is set in session.properties "trace.autodump".

Returns:
true if trace.autodump is ON, otherwise false.
Throws:
java.rmi.RemoteException

getTraceBuffer

public java.lang.String[] getTraceBuffer()
                                  throws java.rmi.RemoteException
Returns a String array of the trace buffer.

Returns:
array of strings containing contents of trace buffer
Throws:
java.rmi.RemoteException

addSessionTraceSocketHandler

public void addSessionTraceSocketHandler(java.lang.String host,
                                         int port)
                                  throws java.rmi.RemoteException,
                                         java.io.IOException
Add a socket handler to the session trace. A socket handler allows the session trace buffer to be monitored from a remote client via a socket connection.

Parameters:
host - hostname
port - port number
Throws:
java.rmi.RemoteException
java.io.IOException

removeSessionTraceSocketHandler

public void removeSessionTraceSocketHandler()
                                     throws java.rmi.RemoteException
Remove the session trace socket handler.

Throws:
java.rmi.RemoteException

addSessionStatusListener

public void addSessionStatusListener(com.ibm.retail.AEF.session.SessionStatusListener listener)
                              throws java.rmi.RemoteException
Add a listener for SessionStatus events.

Parameters:
listener - SessionStatusListener to be added
Throws:
java.rmi.RemoteException

removeSessionStatusListener

public void removeSessionStatusListener(com.ibm.retail.AEF.session.SessionStatusListener listener)
                                 throws java.rmi.RemoteException
Remove a listener for SessionStatus events.

Parameters:
listener - SessionStatusListener to be removed
Throws:
java.rmi.RemoteException

startApplication

public void startApplication()
                      throws java.rmi.RemoteException,
                             AEFException
Start the terminal sales application.
Note: This method is needed only for sessions where the terminal sales application is not started automatically. This is controlled by the session.properties property:
start.pos.sales.application=false
The terminal sales application program name is configured using session.properties:
pos.sales.application=R::h0:/adx_ipgm/EAMTS10L.286

Throws:
java.rmi.RemoteException
AEFException - Among the possible AEFException error codes are:
AEFConst.ERROR_STARTING_POS_APPLICATION

stopApplication

public void stopApplication()
                     throws java.rmi.RemoteException,
                            AEFException
Stop the terminal sales application.
Note: this method applies only to virtual (CSS) sessions.

Throws:
java.rmi.RemoteException
AEFException - Among the possible AEFException error codes are:
AEFConst.API_VALID_FOR_TSS_ONLY
AEFConst.ERROR_STOPPING_POS_APPLICATION

terminate

public void terminate()
               throws java.rmi.RemoteException,
                      AEFException
Cause the session to perform any cleanup required before it is terminated.
Note: this method applies only to virtual (CSS) sessions.

Throws:
java.rmi.RemoteException
AEFException - Among the possible AEFException error codes are:
AEFConst.API_VALID_FOR_TSS_ONLY
AEFConst.ERROR_STOPPING_POS_APPLICATION

isApplicationActive

public boolean isApplicationActive()
                            throws java.rmi.RemoteException
Is the terminal sales application active?
Note: this method applies only to virtual (CSS) sessions.

Throws:
java.rmi.RemoteException

getHealthServerAddress

public java.net.InetSocketAddress getHealthServerAddress()
                                                  throws java.rmi.RemoteException,
                                                         AEFException
Get the address of the AEF Health Server for this session. The HealthServer provides a socket interface for pinging the AEF instance.

Returns:
address of the AEF HealthServer socket
Throws:
java.rmi.RemoteException
AEFException


Copyright © 2004 IBM. All Rights Reserved.
Generated: July 19 2004