no.gar.glink.api
Class GlinkEvent

java.lang.Object
  extended by no.gar.glink.api.GlinkEvent

public class GlinkEvent
extends java.lang.Object

Identifies the type of events that a GlinkEventListener may receive. A GlinkEvent gets delivered whenever a Glink event has occured. The eventCode contains the event type and the source of the GlinkApi object that generated the event.

See Also:
GlinkEventListener

Field Summary
static int COMMAND_KEY_TYPED
          A command key has been typed.
static int CONNECTED
           
static int DATA_BLOCK
          Notifies that a data block has been received.
static int DISCONNECTED
           
static int ERROR_DETECTED
          The getValue method returns the error code.
static int INTERACTIVE_COM_PARAMS_REQUESTED
          Notifies that the Glink communication module needs additional parameters.
static int KEY_TYPED
          A key has been typed.
static int MESSAGE_MODE_DATA
          In message mode operation, notifies that data received from host is available and may be picked up with the messageModeReceive method.
static int PRINT_DATA
          Notifies that print data is available.
static int PRINT_STARTED
          Notifies that print has started but not available yet.
static int SCREEN_AREA_MATCH
          The getValue method returns the GlinkScreenArea identity value.
static int STARTED
           
static int STOPPED
           
static int STRING_RECEIVED
          The getValue method returns the string identity value.
static int TURN_LOST
          Notifies that this side does not have the turn (permission) to send data and should instead expect to receive data from the other side (host).
static int TURN_RECEIVED
          Notifies that this side have the turn (permission) to send data.
static int VE_CONFIG_ERROR
          Error type: An error with the configuration is detected.
static int VE_CONNECTION_ERROR
          Error type: An error with the connection is detected.
static int VE_DGA_SCR_NOT_LICENSED
          Error type: DGA in screen mode has not been licensed.
static int VE_EMULATION_ERROR
          Error type: An error with the emulation is detected.
static int VE_LOGON_FAILED
          Error type: User name or user password is missing or wrong.
static int VE_NO_API_LICENSE
          Error type: License key allowing use of the API not found.
static int VE_NO_CNX_LICENSE
          Error type: License key allowing use of connector not found.
static int VE_OUT_OF_MEMORY
          Error type: The Java VM reported out of memory when loading Glink.
static int VE_SESSIONS_ERROR
          Error type: The GlinkApi.getAvailableSessions failed.
static int VE_STARTUP_ERROR
          Error type: Glink failed to start.
static int VE_TOOMANY_INSTANCES
          Error type: Too many simultaneous instances for Pro version.
 
Constructor Summary
GlinkEvent(int eventCode, GlinkApi source)
           
GlinkEvent(int eventCode, GlinkApi source, int value)
           
GlinkEvent(int eventCode, GlinkApi source, int value, java.lang.String valueText)
           
 
Method Summary
 int getEventCode()
          The application should check the Glink event code to determine which Glink event did occur, for example that the Glink session was connected or disconnected.
 GlinkApi getSource()
          The method returns the GlinkApi object that generated the event.
 int getValue()
          Some Glink events have a value set that gives more information about the given event.
 java.lang.String getValueText()
          Some Glink events have additional text information about the given event.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMMAND_KEY_TYPED

public static final int COMMAND_KEY_TYPED
A command key has been typed. The getValue method returns the value of the command key.

See Also:
GlinkApi.notifyCommandKey(int), GlinkKey, getValue(), Constant Field Values

CONNECTED

public static final int CONNECTED
See Also:
Constant Field Values

DATA_BLOCK

public static final int DATA_BLOCK
Notifies that a data block has been received. This event is posted only if GlinkApi.notifyDataBlocks(true) is called first. The event is normally not needed, yoy should wait for the TURN_RECEIVED before processing the received data. If enabled you'll receive a DATA_BLOCK event each time the emulator has finished processing a block of data received in a single TCP read.

See Also:
GlinkApi.notifyDataBlocks(boolean), TURN_RECEIVED, Constant Field Values

DISCONNECTED

public static final int DISCONNECTED
See Also:
Constant Field Values

ERROR_DETECTED

public static final int ERROR_DETECTED
The getValue method returns the error code. See the VE_xxx values for the type of error.

See Also:
getValue(), Constant Field Values

INTERACTIVE_COM_PARAMS_REQUESTED

public static final int INTERACTIVE_COM_PARAMS_REQUESTED
Notifies that the Glink communication module needs additional parameters. The Ggate and DSA communication modules may be configured with parameters that should be supplied or modified by the user when connecting to the host application. These parameters are referred to as interactive communication parameters.

If the INTERACTIVE_COM_PARAMS_REQUESTED event is posted, then the GlinkApi application must at least do the following GlinkApi method calls:

glink.setInteractiveComParams(glink.getInteractiveComParams());
for Glink to continue the connecting process.

See Also:
GlinkApi.getInteractiveComParams(), GlinkApi.setInteractiveComParams(java.util.Vector), Constant Field Values

KEY_TYPED

public static final int KEY_TYPED
A key has been typed. The getValue method returns the value of the key as an integer. The getValueText method returns the value of the key as a one character long string.

See Also:
GlinkApi.notifyKey(int), getValue(), Constant Field Values

MESSAGE_MODE_DATA

public static final int MESSAGE_MODE_DATA
In message mode operation, notifies that data received from host is available and may be picked up with the messageModeReceive method. Please note that it may be more convienient to let other events trigger the messageModeReceive call, for example the GlinkEvent.TURN_RECEIVED if generated (two way alternate sessions), or set up a string notification event for CrLf or just Etx.

See Also:
GlinkApi.messageModeReceive(), GlinkApi.notifyString(java.lang.String, boolean, int, boolean), Constant Field Values

PRINT_DATA

public static final int PRINT_DATA
Notifies that print data is available. If the printer type configured is GlinkApi, then a PRINT_DATA event will be posted whenever a print data block is available. The getValueText method returns the posted print data block and the getValues method returns a last print block flag; 1 is returned for the last print block and 0 is returned for intermediate blocks.

See Also:
GlinkConfiguration.setParameter(java.lang.String), Constant Field Values

PRINT_STARTED

public static final int PRINT_STARTED
Notifies that print has started but not available yet. Print data is not available until a PRINT_DATA event is posted. PRINT_STARTED events will be posted only if the printer type configured is GlinkApi.

See Also:
PRINT_DATA, Constant Field Values

SCREEN_AREA_MATCH

public static final int SCREEN_AREA_MATCH
The getValue method returns the GlinkScreenArea identity value.

See Also:
GlinkApi.notifyScreenArea, getValue(), Constant Field Values

STARTED

public static final int STARTED
See Also:
Constant Field Values

STOPPED

public static final int STOPPED
See Also:
Constant Field Values

STRING_RECEIVED

public static final int STRING_RECEIVED
The getValue method returns the string identity value.

See Also:
getValue(), Constant Field Values

TURN_LOST

public static final int TURN_LOST
Notifies that this side does not have the turn (permission) to send data and should instead expect to receive data from the other side (host).

See Also:
GlinkApi.isTurnKnown(), Constant Field Values

TURN_RECEIVED

public static final int TURN_RECEIVED
Notifies that this side have the turn (permission) to send data.

See Also:
GlinkApi.isTurnKnown(), Constant Field Values

VE_CONFIG_ERROR

public static final int VE_CONFIG_ERROR
Error type: An error with the configuration is detected. The session name is not set or a config with the session name specified is not found or an error has occured while loading the config.

The error is only reported if Glink is not visible, otherwise the session dialog box is displayed or a default config is loaded.

See Also:
getValue(), GlinkApi.setVisible(boolean), GlinkApi.sessionName, Constant Field Values

VE_CONNECTION_ERROR

public static final int VE_CONNECTION_ERROR
Error type: An error with the connection is detected. Use the getValueText() method to get the error message.

See Also:
Constant Field Values

VE_DGA_SCR_NOT_LICENSED

public static final int VE_DGA_SCR_NOT_LICENSED
Error type: DGA in screen mode has not been licensed.

See Also:
Constant Field Values

VE_EMULATION_ERROR

public static final int VE_EMULATION_ERROR
Error type: An error with the emulation is detected. Use the getValueText() method to get the error message.

See Also:
Constant Field Values

VE_LOGON_FAILED

public static final int VE_LOGON_FAILED
Error type: User name or user password is missing or wrong.

The error is reported only if Glink is not visible, otherwise the logon dialog box is displayed.

See Also:
getValue(), GlinkApi.setVisible(boolean), Constant Field Values

VE_NO_API_LICENSE

public static final int VE_NO_API_LICENSE
Error type: License key allowing use of the API not found.

See Also:
Constant Field Values

VE_NO_CNX_LICENSE

public static final int VE_NO_CNX_LICENSE
Error type: License key allowing use of connector not found.

See Also:
Constant Field Values

VE_OUT_OF_MEMORY

public static final int VE_OUT_OF_MEMORY
Error type: The Java VM reported out of memory when loading Glink. Use the getValueText() method to get the error message.

See Also:
Constant Field Values

VE_SESSIONS_ERROR

public static final int VE_SESSIONS_ERROR
Error type: The GlinkApi.getAvailableSessions failed. Use the getValueText() method to get the error message.

See Also:
Constant Field Values

VE_STARTUP_ERROR

public static final int VE_STARTUP_ERROR
Error type: Glink failed to start. Use the getValueText() method to get the error message.

See Also:
Constant Field Values

VE_TOOMANY_INSTANCES

public static final int VE_TOOMANY_INSTANCES
Error type: Too many simultaneous instances for Pro version.

See Also:
Constant Field Values
Constructor Detail

GlinkEvent

public GlinkEvent(int eventCode,
                  GlinkApi source)

GlinkEvent

public GlinkEvent(int eventCode,
                  GlinkApi source,
                  int value)

GlinkEvent

public GlinkEvent(int eventCode,
                  GlinkApi source,
                  int value,
                  java.lang.String valueText)
Method Detail

getEventCode

public int getEventCode()
The application should check the Glink event code to determine which Glink event did occur, for example that the Glink session was connected or disconnected.


getSource

public GlinkApi getSource()
The method returns the GlinkApi object that generated the event.


getValue

public int getValue()
Some Glink events have a value set that gives more information about the given event.


getValueText

public java.lang.String getValueText()
Some Glink events have additional text information about the given event.