Class NetServerManager
NetServerChannels
.
Channels are added to this collection using the createChannel
method, and they are removed from the collection using the
release
method of the channel.
There exists only one NetServerManager
, which can be obtain using the
getNetServerManager
method.
-
Constructor Summary
ConstructorDescriptionNetServerManager
(Object owner, Object options) Constructs a newNetServerManager
instance. -
Method Summary
Modifier and TypeMethodDescriptioncreateChannel
(String name, URI netserURI, URI layoutURI, boolean encryptAll, boolean autoLogin) Creates aNetServerChannel
indexed byname
.createClient
(String channelName, String description, DesktopTask task) Creates a NetServer client bound to specified desktop task.getChannel
(String channelName) Returns theNetServerChannel
indexed by the given name.Returns an unmodifiable collection with allNetServerChannel
.boolean
Returnstrue
if tracing inbound and outbound messages.void
release()
Closes thisNetServerManager
, relinquishing any underlying resources.void
setTracing
(boolean tracing) Enables or disables tracing of inbound and outbound messages.
-
Constructor Details
-
NetServerManager
Constructs a newNetServerManager
instance.- Parameters:
owner
- the owner of this NetServerManager.options
- the options of this NetServerManager.- Throws:
NullPointerException
- if an argument isnull
.IllegalArgumentException
- if an argument is invalid.Exception
- if another error occurs.
-
-
Method Details
-
isTracing
public boolean isTracing()Returnstrue
if tracing inbound and outbound messages.- Returns:
true
if tracing inbound and outbound messages.
-
setTracing
public void setTracing(boolean tracing) Enables or disables tracing of inbound and outbound messages.- Parameters:
tracing
- iftrue
messages will be traced.
-
getChannels
Returns an unmodifiable collection with allNetServerChannel
.- Returns:
- an unmodifiable collection with all
NetServerChannel
. - Throws:
IllegalStateException
- if this NetServerManager is closed.
-
getChannel
Returns theNetServerChannel
indexed by the given name. Returnsnull
if the channel is not defined.- Parameters:
channelName
- the name of theNetServerChannel
.- Returns:
- the channel or
null
if the channel is not defined. - Throws:
NullPointerException
- ifchannelName
isnull
.IllegalStateException
- if this NetServerManager is closed.
-
createClient
Creates a NetServer client bound to specified desktop task.- Parameters:
channelName
- the name of the NetServer channel.description
- the description of the NetServer client.task
- a desktop task instance (can be null).- Returns:
- a new NetServer client bound to specified task.
- Throws:
NullPointerException
- if an argument isnull
.IllegalArgumentException
- if channel does not exist.IllegalStateException
- if this NetServerManager is closed.
-
createChannel
public NetServerChannel createChannel(String name, URI netserURI, URI layoutURI, boolean encryptAll, boolean autoLogin) throws Exception Creates aNetServerChannel
indexed byname
. There can be one oneNetServerChannel
with a given name, so if a channel is already defined with the specifiedname
, the existing channel is returned instead of creating a new one.netserURI
specifies the direct or indirect address of OBCOM NetServer. The protocol (scheme) ofnetserURI
can be either "net
" for classic connections, or "nets
" for SSL/TLS connections. IfnetserURI
does not specify a protocol, it is interpreted as the relative address of a servlet that comunicates with OBCOM NetServer. In this case,netserURI
is converted to an absolute address using the desktop secure codebase. Examples of valid netserURI:net://www.obcom.cl:10104 nets://0.0.0.0:10114 netservlet
layoutURI
specifies the address used to download layouts. IflayoutURI
is relative, it is converted to an absolute address using the desktop secure codebase.layoutURI
must contain at least one occurrence of the special placeholder character "*". Before each download, all occurrences of this placeholder are replaced with the name of the requieredLayout
. Examples of valid layoutURI:layouts/*.jsp http://www.obcom.cl/desktopfx/layouts/*.aspx
- Parameters:
name
- the name of theNetServerChannel
.netserURI
- the server URI of theNetServerChannel
.layoutURI
- the layout URI of theNetServerChannel
.encryptAll
- iftrue
all messages are sent encrypted.autoLogin
- iftrue
login is performed after connecting.- Returns:
- a new
NetServerChannel
indexed byname
. - Throws:
NullPointerException
- if an argument isnull
.IllegalArgumentException
- if an argument is invalid.Exception
- if another error occurs.
-
release
public void release()Closes thisNetServerManager
, relinquishing any underlying resources. No other method of thisNetServerManager
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.
-