public abstract class ModelEventHandler extends java.lang.Object implements EventHandler
DEFAULT_TIMEOUT
Constructor and Description |
---|
ModelEventHandler() |
Modifier and Type | Method and Description |
---|---|
void |
clientConnected(ClientConnectedEvent event)
Called when a client connects to the host session.
|
void |
clientDisconnected(ClientDisconnectedEvent event)
Called when a client disconnects from the host session.
|
void |
errorReported(ErrorReportedEvent event)
Called the moment a top level error outside the context of an event
handler.
|
void |
executeLogin(ExecuteLoginEvent event)
Called immediately after a network connection has been established with
the host system.
|
void |
executeLogout(ExecuteLogoutEvent event)
Called before a network connection with the host system is dropped.
|
java.util.List |
formatError(FormatErrorEvent event)
Called before an error is returned to a client.
|
void |
moveCursor(ModelMoveCursorEvent event)
Called when the cursor needs to move to a specific location on the
terminal screen and the current entity, if any, has not defined how to
move the cursor.
|
void |
moveCursorBackward(ModelMoveCursorBackwardEvent event)
Called when VHI wants to move the cursor to the previous rest position
on the screen and the current entity, if any, has not defined a move
cursor backward operation.
|
void |
moveCursorForward(ModelMoveCursorForwardEvent event)
Called when VHI wants to move the cursor to the next at rest position on
the screen and the current entity, if any, has not defined a move cursor
forward operation.
|
java.lang.String |
processString(ProcessStringEvent event)
Called to process a string from the client.
|
void |
unrecognizedScreen(UnrecognizedScreenEvent event)
Called to handle the arrival at an unrecognized screen.
|
public void errorReported(ErrorReportedEvent event) throws ApptrieveException
Any exception thrown from this event will be logged but otherwise ignored.
event
- the event instanceApptrieveException
public java.util.List formatError(FormatErrorEvent event) throws ApptrieveException
Error messages can be created using one of the
Event.createErrorMessage(int)
methods.
Note that upon returning from this event, the connector used by the client to connect to VHI will often append an additional error message onto the stack. This error message provides information about which API method was invoked.
Any exception thrown from this event will be logged but otherwise ignored.
event
- the event instanceErrorMessage
objectsApptrieveException
public void clientConnected(ClientConnectedEvent event) throws ApptrieveException
If an exception is thrown from this event the VHI server will log the error and fail the client connection. The design tool will simply report the exception and move on.
event
- the event instanceApptrieveException
public void clientDisconnected(ClientDisconnectedEvent event) throws ApptrieveException
Any exception thrown from this event will be logged but otherwise ignored.
event
- the event instanceApptrieveException
public void unrecognizedScreen(UnrecognizedScreenEvent event) throws ApptrieveException
If the host application is still at an unrecognized screen upon returning from the event, the current client request will fail with a dead session error.
event
- the event instanceApptrieveException
public void executeLogin(ExecuteLoginEvent event) throws ApptrieveException
event
- the event instanceApptrieveException
public void executeLogout(ExecuteLogoutEvent event) throws ApptrieveException
event
- the event instanceApptrieveException
public void moveCursorForward(ModelMoveCursorForwardEvent event) throws ApptrieveException
VHI will iteratively fire this event while writing attributes on a character mode host. Upon returning from the event, VHI will check if the new cursor position corresponds to an attribute that needs writing and write to it.
This event will fire in the situation where the move cursor
event is not defined on either the current entity or the model. Calling
defaultMoveCursor in either of these events would also cause this event
to fire. See moveCursor(com.wrq.vhi.script.api.ModelMoveCursorEvent)
for the list of commands.
If this event leaves the cursor position unchanged, VHI will begin iteratively calling the move cursor backwards event or command list, if defined, in lieu of this event.
Any exception thrown from this event will cause the current attribute write or command to fail.
event
- the event instanceApptrieveException
public void moveCursorBackward(ModelMoveCursorBackwardEvent event) throws ApptrieveException
If the move cursor forward event or command list ever leaves the
cursor position unchanged this event will begin to iteratively fire.
See moveCursorForward(com.wrq.vhi.script.api.ModelMoveCursorForwardEvent)
for details.
Any exception thrown from this event will cause the current attribute write or command to fail.
event
- the event instanceApptrieveException
public void moveCursor(ModelMoveCursorEvent event) throws ApptrieveException
If no method to move the cursor forward or backward is defined for a character mode model, this event will fire to position the cursor at each attribute and field before writing.
If the cursor is not positioned at the specified location upon returning from the event, VHI will fail the current client request.
Any exception thrown from this event will cause the current attribute write or command to fail.
event
- the event instanceApptrieveException
public java.lang.String processString(ProcessStringEvent event) throws ApptrieveException
Any exception thrown from this event will be propagated back to the client.
event
- the event instanceApptrieveException