public abstract class NetServerChannel extends Object
kill client
" command in an OBCOM NetServer
console. If the communication channel is lost for any other reason, it is
automatically re-established as soon as required.
In order to maximize reusability and to reduce the number of physical network
connections, the NetServerChannel
communication link is implemented
as a shared (multiplexed) channel. For this reason, a client application
cannot use a NetServerChannel
directly, but it has to acquire a
NetServerClient
instance using the createClient
method. It is through this NetServerClient
that the client
application communicates with the OBCOM NetServer server environment.
Modifier and Type | Method and Description |
---|---|
void |
addListener(ConnectionListener listener)
Adds the supplied connecion listener to this channel.
|
void |
assignLayout(NetServerMessage message)
The
message is assigned the layout identified by its LayoutName label. |
NetServerClient |
createClient(String description,
DesktopTask task)
Creates a NetServerClient associatted with a
DesktopTask . |
boolean |
getAutoAssignLayout()
Returns
true if the assignLayout method is automatically applied to all reply or published
messages received from the OBCOM NetServer. |
boolean |
getAutoLogin()
Returns
true if login is performed after connecting to OBCOM
NetServer. |
Collection<NetServerClient> |
getClients()
Returns a collection with all clients of this
NetServerChannel . |
boolean |
getEncryptAll()
Returns
true if all messages are sent encrypted to OBCOM
NetServer. |
Layout |
getLayout(String name)
Returns the
Layout with the specified name . |
URI |
getLayoutURI()
Returns the URI used to download the required messages layouts.
|
boolean |
getLogChannelErrors()
Returns
true if NetServerChannel errors are logged. |
NetServerManager |
getManager()
Returns the NetServerManager of this
NetServerChannel . |
int |
getMulticastMessages()
Returns the number of multicast messages this channel has read.
|
String |
getName()
Returns the name of this
NetServerChannel . |
URI |
getNetServerURI()
Returns the protocol, host and port of the OBCOM NetServer.
|
int |
getReaderBytes()
Returns the number of bytes this channel has read.
|
int |
getReaderMessages()
Returns the number of messages this channel has read.
|
String |
getStationName()
Returns the name of the station of this channel.
|
String |
getStationSerial()
Returns the serial number of the station of this channel.
|
boolean |
getVerifyLayoutSignatures()
Returns
true if the signatures of downloaded layouts are verified. |
int |
getWriterBytes()
Returns the number of bytes this channel has written.
|
int |
getWriterMessages()
Returns the number of messages this channel has written.
|
boolean |
isAlive()
Returns
true if this NetServerChannel is alive. |
boolean |
isConnected()
Returns
true if connected to the OBCOM NetServer. |
boolean |
isTracing()
Returns
true if tracing inbound and outbound messages. |
protected void |
logChannelProperties()
Called once to generate log message with the properties of this channel.
|
void |
release()
Closes this
NetServerChannel , relinquishing any underlying
resources. |
void |
removeListener(ConnectionListener listener)
Removes the supplied connecion listener from this channel.
|
void |
setAutoAssignLayout(boolean value)
Changes whether the
assignLayout
method is automatically applied to all reply or published messages
received from the OBCOM NetServer. |
void |
setLogChannelErrors(boolean value)
Changes whether
NetServerChannel errors are logged.. |
void |
setStationName(String name)
Changes the name of the station of this channel.
|
void |
setStationSerial(String serial)
Changes the serial number of the station of this channel.
|
void |
setVerifyLayoutSignatures(boolean value)
Changes whether the signatures of downloaded layouts are verified.
|
public final NetServerManager getManager()
NetServerChannel
.NetServerChannel
.public final String getName()
NetServerChannel
.NetServerChannel
.public final URI getNetServerURI()
public final URI getLayoutURI()
public final boolean isConnected()
true
if connected to the OBCOM NetServer.true
if connected to the OBCOM NetServer.public final boolean isAlive()
true
if this NetServerChannel
is alive. A NetServerChannel
becomes dead when a system operator executes the
"kill client
" command in an OBCOM NetServer console.true
if this NetServerChannel
is alive.public final boolean getEncryptAll()
true
if all messages are sent encrypted to OBCOM
NetServer.true
if all messages are sent encrypted to OBCOM
NetServer.public final boolean getAutoLogin()
true
if login is performed after connecting to OBCOM
NetServer.true
if login is performed after connecting to OBCOM
NetServer.public final String getStationName()
public final void setStationName(String name)
name
- the name of the station of this channel.IllegalArgumentException
- if name
is invalid.public final String getStationSerial()
public final void setStationSerial(String serial)
serial
- the serial number of the station of this channel.IllegalArgumentException
- if serial
is invalid.public final void addListener(ConnectionListener listener)
listener
- the connecion listener to add to this channel.NullPointerException
- if listener
is null
.public final void removeListener(ConnectionListener listener)
listener
- the connecion listener to remove from this channel.NullPointerException
- if listener
is null
.public final boolean isTracing()
true
if tracing inbound and outbound messages.true
if tracing inbound and outbound messages.public final int getMulticastMessages()
public final int getReaderBytes()
public final int getReaderMessages()
public final int getWriterBytes()
public final int getWriterMessages()
public final boolean getVerifyLayoutSignatures()
true
if the signatures of downloaded layouts are verified.true
if the signatures of downloaded layouts are verified.public final void setVerifyLayoutSignatures(boolean value)
value
- if true
the signatures of downloaded layouts will
be verified. Otherwise the signatures will be assigned to layouts
without verification.public final Layout getLayout(String name) throws Exception
Layout
with the specified name
. If the layout
is not available in the cache, it is downloaded, compiled, stored in the
cache and returned to the caller of this method. The signature of the
downloaded layout will be verified if getVerifyLayoutSignatures()
returns true
, otherwise the signature will be assigned to the
layout without verification.name
- name of the required Layout
.Layout
with the specified name
.NullPointerException
- if name
is null
.Exception
- if an error occurs while loading the layout.public final boolean getAutoAssignLayout()
true
if the assignLayout
method is automatically applied to all reply or published
messages received from the OBCOM NetServer.true
if the assignLayout
method is applied to all
reply or published messages.public final void setAutoAssignLayout(boolean value)
assignLayout
method is automatically applied to all reply or published messages
received from the OBCOM NetServer.value
- if true
the assignLayout
method will be
applied to all reply or published messages.public final void assignLayout(NetServerMessage message) throws Exception
message
is assigned the layout identified by its LayoutName
label. If the message
has no such label, then nothing is done. If the message
has a LayoutSignature
label, it is compared with the signature of the assigned layout, and an
exception if thrown if the signatures are not equal.message
- the message that will be assigned a layout.NullPointerException
- if message
is null
.IllegalArgumentException
- if the signatures of the message
and the layout are not equal.Exception
- if another error occurs.public final Collection<NetServerClient> getClients()
NetServerChannel
.NetServerChannel
.public final NetServerClient createClient(String description, DesktopTask task)
DesktopTask
.description
- the description of the NetServerClient.task
- a desktop task instance (can be null).NullPointerException
- if description
is null
.protected void logChannelProperties()
public final boolean getLogChannelErrors()
true
if NetServerChannel
errors are logged.true
if NetServerChannel
errors are logged.public final void setLogChannelErrors(boolean value)
NetServerChannel
errors are logged..value
- if true
channel errors are logged.public void release()
NetServerChannel
, relinquishing any underlying
resources. No other method of this NetServerChannel
can be used
after this method has been issued. Calling this method more than once is
allowed but has no effect after the first invocation.Copyright © OBCOM INGENIERIA S.A. (Chile). All Rights Reserved.