public class ClientSession extends Object implements HostSessionManagerListener2, ClientSessionInterface
Modifier and Type | Method and Description |
---|---|
void |
checkInactivity(int inactivityWarning,
int inactivityTimeout)
Checks if a warning message should be displayed on the client due to
inactivity or if the session should be closed.
|
void |
clientTrace(String text)
Performs a trace output (normally after a call to
doClientVerboseTrace . |
Transaction |
createTransaction()
Create Transaction depending on the current codepage for this session.
|
protected VirtualSessionManager |
createVirtualSessionManager(ClientSessionInterface csi)
Creates the VirtualSessionManager.
|
void |
displayTerminal()
Creates the terminal window, gets the contents of the terminal window,
hides all the panels, and displays it.
|
void |
displayTerminal(boolean keepVisible)
Creates the terminal window, gets the contents of the terminal window,
hides all the panels, and displays it.
|
void |
displayTerminal(boolean keepVisible,
String heading)
Creates the terminal window, gets the contents of the terminal window,
hides all the panels, and displays it.
|
void |
dispose()
Disposes of the client session.
|
boolean |
doClientVerboseTrace()
Checks if client verbose trace is turned on.
|
boolean |
doesScreenContainData()
Checks if the host screen contains data.
|
boolean |
doesScreenMatch(PhantomHostScreen phantomScreen)
Checks if a host screen currently matches.
|
void |
enableWriteCache(IniFile ini)
Enables the write cache of string for the Java Client.
|
boolean |
exitApplication()
Exits the current client session.
|
void |
flagClientEventForProcessing()
Flags a client event to be processed asynchronously.
|
void |
flagHostEventForProcessing()
Flags a host event to be processed asynchronously.
|
ClientCommunicationInterface |
getClientCommunicationInterface()
Gets the client communication interface..
|
ClientCommunicationListener |
getClientCommunicationListener()
Gets the non-Java client listener.
|
ClientConnectionData |
getClientConnectionData()
Gets the client connection data.
|
ClientSessionManager |
getClientSessionManager()
Gets a instance of the Client Session Manager.
|
ClientWorker |
getClientWorker()
Get client worker.
|
Object |
getComponentLockObject()
Gets the lock object for synchronization for Control Components.
|
long |
getConnectionID()
Gets the client connection ID.
|
HostSession |
getCurrentHostSession()
Gets the current host session.
|
HostScreen |
getHostScreen()
Gets the host screen.
|
HostSessionManager |
getHostSessionManager()
Gets the host session manager.
|
long |
getLastTransactionTime()
The last transaction time in "System.currentTimeMillis()".
|
Object |
getLockObject()
Gets the lock object (the virtual session manager).
|
Transaction |
getModalReturnCode(int replyType)
Gets the return code (Transaction) for a modal server-client request.
|
PhantomRuntime |
getRuntimeApplication(String name)
Gets a runtime application of an ID.
|
int |
getSessionType()
Gets the session type.
|
VirtualSessionManager |
getVirtualSessionManager()
Gets the VirtualSessionManager.
|
boolean |
grabSessionFromPool(String[] runtimeIDs,
int hostID)
Checks if there is a session pooling handler that can be used for this
client session.
|
boolean |
hardCloseCommunication()
Closes the client communication link without notification.
|
boolean |
hasBeenDisposed(long time)
Checks if session has been disposed of for a certain amount of milliseconds.
|
boolean |
hasFullDuplexClient()
Checks if this session is a full duplex NetPhantom Client, same as
hasJavaClient() . |
boolean |
hasJavaClient()
Checks if this session is connected to a NetPhantom Java Client.
|
boolean |
hasSessionTimedOut(long timeoutMillis)
Checks if a session has been inactive for a certain amount of time.
|
boolean |
initialize()
Initiates a new session that is not connected to the NetPhantom Java
Client.
|
boolean |
initialize(boolean isEditor)
Initiates a new session and indicates if it should be run in editor mode.
|
Object |
invokeAndWait(ServerAction serverAction)
Invokes the server action in the client worker thread and waits for a
reply.
|
void |
invokeLater(ServerAction serverAction)
Invokes the server action in the client worker thread later and doesn't
wait for a reply.
|
boolean |
isClientTerminalDisplayed()
Checks if the client is displaying the terminal window.
|
boolean |
isClientTerminalDisplayedProgrammatically()
Checks if the client is displaying the terminal window programmatically.
|
boolean |
isDisposed()
Checks if the session is disposed.
|
boolean |
isEditor()
Is this an editor instance.
|
boolean |
isEditorParallelRun()
Checks the flag to indicate that the instance runs in parallel with the
editor.
|
boolean |
isHostInducedHostChange()
Checks if a host change (typically in a VirtualControl.refresh) is induced
from host or from local host interaction.
|
boolean |
isHostInErrorState()
Checks if the current host session is in error state.
|
boolean |
isHostLocked()
Checks if the current host session is locked.
|
boolean |
isMainThread()
Checks if the current calling thread is the main thread.
|
boolean |
isServerAdministration()
Checks if the server administration is the current application.
|
void |
logEvent(int id)
Logs an event for the client.
|
void |
logEvent(int id,
String param)
Logs an event for the client.
|
void |
onHostConnectChange(boolean connected)
Notifies the session of a connect state change.
|
void |
onHostCursorPositionChange(int x,
int y)
Informs that the cursor position has changed.
|
void |
onHostDataStreamProcessing(boolean isEntering)
Called when entering or exiting data stream processing.
|
void |
onHostFieldChange()
Notifies the session that fields have changed.
|
void |
onHostPrinterSessionFailure(Throwable exception)
Called when a printer session has had a failure.
|
void |
onHostScreenChange()
Notifies the session of a screen change.
|
void |
onHostSessionChange(HostSession hostSession,
boolean isNewSession)
Called when the current host session is changed.
|
void |
onHostSessionFailure(String description)
Deprecated.
as of NetPhantom Version 3.8
|
void |
onHostSessionFailure(Throwable exception)
Called when a session has had a failure.
|
void |
onHostStateChange()
Notifies the session of a state change (such as insert mode, lock state,
error state).
|
void |
postClientTransaction(Transaction trans)
Posts a client transaction for processing.
|
boolean |
postMessageBoxTransaction(VirtualMessageBox vmb)
Post a transaction to sent to the client from queue.
|
void |
processCheckInactivity(int inactivityWarning,
int inactivityTimeout)
Checks if a warning message should be displayed on the client due to
inactivity or if the session should be closed.
|
void |
processClientEvent()
Process a new client event.
|
void |
processClientTransaction(Transaction trans)
Processes events posted to the client worker for processing in the virtual
session manager.
|
void |
processHostEvent()
Process a new host event.
|
void |
removeTerminal()
Removes the terminal window and displays all the panels again.
|
void |
removeTerminal(boolean alwaysRemove)
Removes the terminal window and displays all the panels again.
|
void |
sendNegotiateSSL()
Sends the negotiate SSL transaction to the client and waits for the reader
thread to reply (it gets held for a while).
|
void |
sendTransaction(Transaction trans)
Sends a transaction to the client.
|
void |
sendTransaction(Transaction trans,
boolean doSetLastTransactionTime)
Sends a transaction to the client.
|
void |
setHostSessionManager(HostSessionManager manager)
Sets the host session manager.
|
void |
setLastTransactionTime(boolean doWarning)
Sets the last timestamp for a transaction between the client and the
server.
|
void |
setModalReturnCode(Transaction trans)
Sets the return code for a server-client request (message box).
|
void |
setVirtualSessionManager(VirtualSessionManager manager)
Sets the VirtualSessionManager.
|
void |
soundAlarm()
Sound alarm on the client, not issued from the terminal host
but from the server.
|
void |
soundAlarm(boolean fromHost)
Sound alarm on the client.
|
boolean |
waitForScreenChange(long msTime)
Waits for a screen change for a certain time.
|
boolean |
waitForUnlock(long msTime)
Waits for the lock state to disappear for a certain time.
|
public int getSessionType()
getSessionType
in interface ClientSessionInterface
public boolean initialize() throws OutOfMemoryError
OutOfMemoryError
- In case of out-of-memory.public boolean initialize(boolean isEditor)
protected VirtualSessionManager createVirtualSessionManager(ClientSessionInterface csi)
public Object getLockObject()
getLockObject
in interface HostSessionManagerListener
public boolean isDisposed()
isDisposed
in interface ClientSessionInterface
public boolean hasBeenDisposed(long time)
public void dispose()
dispose
in interface ClientSessionInterface
public boolean hardCloseCommunication()
public void sendNegotiateSSL()
public boolean isEditor()
public boolean isEditorParallelRun()
public boolean isServerAdministration()
public ClientCommunicationInterface getClientCommunicationInterface()
getClientCommunicationInterface
in interface ClientSessionInterface
public long getConnectionID()
public boolean doesScreenMatch(PhantomHostScreen phantomScreen)
doesScreenMatch
in interface HostSessionManagerListener
public VirtualSessionManager getVirtualSessionManager()
getVirtualSessionManager
in interface ClientSessionInterface
public void setVirtualSessionManager(VirtualSessionManager manager)
public PhantomRuntime getRuntimeApplication(String name)
public ClientSessionManager getClientSessionManager()
public final ClientConnectionData getClientConnectionData()
getClientConnectionData
in interface ClientSessionInterface
public void enableWriteCache(IniFile ini)
public void sendTransaction(Transaction trans)
sendTransaction(trans,true)
.sendTransaction
in interface ClientSessionInterface
trans
- The transaction to send.public void sendTransaction(Transaction trans, boolean doSetLastTransactionTime)
sendTransaction
in interface ClientSessionInterface
trans
- The transaction to send.doSetLastTransactionTime
- Flag indicating if the last transaction time
is also always set along with the warning time.public void flagClientEventForProcessing()
flagClientEventForProcessing
in interface ClientSessionInterface
public void flagHostEventForProcessing()
flagHostEventForProcessing
in interface ClientSessionInterface
public void postClientTransaction(Transaction trans)
postClientTransaction
in interface ClientSessionInterface
public boolean postMessageBoxTransaction(VirtualMessageBox vmb)
public void setModalReturnCode(Transaction trans)
setModalReturnCode
in interface ClientSessionInterface
public Transaction getModalReturnCode(int replyType)
getModalReturnCode
in interface ClientSessionInterface
public HostScreen getHostScreen()
getHostScreen
in interface ClientSessionInterface
public HostSessionManager getHostSessionManager()
getHostSessionManager
in interface ClientSessionInterface
public void setHostSessionManager(HostSessionManager manager)
public HostSession getCurrentHostSession()
getCurrentHostSession
in interface ClientSessionInterface
public boolean isHostLocked()
isHostLocked
in interface ClientSessionInterface
public boolean isHostInErrorState()
isHostInErrorState
in interface ClientSessionInterface
public boolean isHostInducedHostChange()
public boolean waitForUnlock(long msTime)
waitForUnlock
in interface ClientSessionInterface
public boolean waitForScreenChange(long msTime)
waitForScreenChange
in interface ClientSessionInterface
public Object getComponentLockObject()
public void onHostConnectChange(boolean connected)
onHostConnectChange
in interface HostSessionManagerListener
public boolean doesScreenContainData()
doesScreenContainData
in interface ClientSessionInterface
public void onHostStateChange()
onHostStateChange
in interface HostSessionManagerListener
public void onHostFieldChange()
onHostFieldChange
in interface HostSessionManagerListener
public void onHostScreenChange()
onHostScreenChange
in interface HostSessionManagerListener
public void onHostCursorPositionChange(int x, int y)
onHostCursorPositionChange
in interface HostSessionManagerListener
public void processHostEvent()
processHostEvent
in interface ClientSessionInterface
public void processClientEvent()
processClientEvent
in interface ClientSessionInterface
public void processClientTransaction(Transaction trans)
processClientTransaction
in interface ClientSessionInterface
public boolean isMainThread()
isMainThread
in interface ClientSessionInterface
public boolean exitApplication()
The connection to the client will be closed and the terminal sessions stopped. The session will then be restarted for use by another client session.
exitApplication
in interface ClientSessionInterface
public void displayTerminal()
displayTerminal
in interface ClientSessionInterface
public void displayTerminal(boolean keepVisible)
public void displayTerminal(boolean keepVisible, String heading)
public void removeTerminal()
removeTerminal
in interface ClientSessionInterface
public void removeTerminal(boolean alwaysRemove)
public boolean isClientTerminalDisplayed()
isClientTerminalDisplayed
in interface ClientSessionInterface
public boolean isClientTerminalDisplayedProgrammatically()
public void soundAlarm()
soundAlarm
in interface ClientSessionInterface
soundAlarm
in interface HostSessionManagerListener
public void soundAlarm(boolean fromHost)
fromHost
- Flag indicating the origin of the alarm is the terminal host.public ClientWorker getClientWorker()
getClientWorker
in interface ClientSessionInterface
@Deprecated public void onHostSessionFailure(String description)
onHostSessionFailure
in interface HostSessionManagerListener
public void onHostSessionFailure(Throwable exception)
onHostSessionFailure
in interface HostSessionManagerListener2
public void onHostPrinterSessionFailure(Throwable exception)
public void logEvent(int id)
logEvent
in interface ClientSessionInterface
public void logEvent(int id, String param)
logEvent
in interface ClientSessionInterface
public void setLastTransactionTime(boolean doWarning)
doWarning
- Also resets the last warning time.public long getLastTransactionTime()
public void checkInactivity(int inactivityWarning, int inactivityTimeout)
public void processCheckInactivity(int inactivityWarning, int inactivityTimeout)
processCheckInactivity
in interface ClientSessionInterface
public boolean hasSessionTimedOut(long timeoutMillis)
true
if session would timeout after the timeoutMillis
milliseconds or it has already timed out, false
otherwise.public boolean doClientVerboseTrace()
doClientVerboseTrace
in interface ClientSessionInterface
public void clientTrace(String text)
doClientVerboseTrace
.clientTrace
in interface ClientSessionInterface
public Transaction createTransaction()
createTransaction
in interface ClientSessionInterface
public boolean hasFullDuplexClient()
hasJavaClient()
.hasFullDuplexClient
in interface ClientSessionInterface
public boolean hasJavaClient()
hasJavaClient
in interface ClientSessionInterface
public ClientCommunicationListener getClientCommunicationListener()
public boolean grabSessionFromPool(String[] runtimeIDs, int hostID)
This function will change the hostSessionManager
in the case
of a successful grab or a session in the session pool.
public void onHostSessionChange(HostSession hostSession, boolean isNewSession)
onHostSessionChange
in interface HostSessionManagerListener
public void onHostDataStreamProcessing(boolean isEntering)
onHostDataStreamProcessing
in interface HostSessionManagerListener
public void invokeLater(ServerAction serverAction)
public Object invokeAndWait(ServerAction serverAction)
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.