public interface Session
Modifier and Type | Method and Description |
---|---|
void |
addConnectionListener(ConnectionListener listener)
Registers a listener that will receive connection events from this
Session instance.
|
void |
connect()
Attempts a connection to the host.
|
void |
disconnect()
Disconnects from the host.
|
ConnectionState |
getConnectionState()
Returns the current state of the host connection.
|
String |
getDeviceName()
This method will return the connected device name if available, or the
configured device name, or null if no device name was configured.
|
OIA |
getOIA()
Returns the operator information area object (OIA) associated with the
session.
|
PresentationSpace |
getPresentationSpace()
Returns the presentation space object associated with the session.
|
SessionType |
getType()
Returns the type of host session.
|
boolean |
isConnected()
Determines whether the connection to the host is connected and ready.
|
boolean |
removeConnectionListener(ConnectionListener listener)
Unregisters an event listener that no longer wishes to receive connection
events.
|
void |
setDeviceName(String name)
Configure a new device name for the session.
|
void connect()
ConnectionState.DISCONNECTED
.
When this method is called, the connection state is first set to
ConnectionState.CONNECTING
. Only after the connection has been
established is the status changed to ConnectionState.CONNECTED
.
You may choose to implement a timer in your code so if a connection does
not succeed after a certain amount of time, you can call
disconnect
to cancel the connection attempt. Otherwise, the
connection attempt may proceed indefinitely. This call returns
immediately, status and errors are reported via
ConnectionListener
.void disconnect()
ConnectionState.DISCONNECTING
. Only after the connection has
disconnected is the status changed to
ConnectionState.DISCONNECTED
. This call returns immediately,
status and errors are reported via ConnectionListener
.boolean isConnected()
ConnectionState.CONNECTED
, false otherwise.ConnectionState getConnectionState()
String getDeviceName()
void setDeviceName(String name)
name
- to use on the next connect.IllegalStateException
- if an attempt is made to set this property
while the session is connected.void addConnectionListener(ConnectionListener listener)
listener
- the object that wishes to receive communication events.boolean removeConnectionListener(ConnectionListener listener)
listener
- the object that wishes to stop receiving notification.SessionType getType()
PresentationSpace getPresentationSpace()
OIA getOIA()
Copyright © 2020 Micro Focus. All rights reserved.