public abstract class Server extends Object
start()
and finally disposed through close()
.
If any preliminary initialization on the supplied Adapter
implementation object has to be performed, it should be done through
a custom, dedicated method before invoking start()
.
Further reuse of the same instance is not supported.Constructor and Description |
---|
Server() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Stops the management of the Remote Adapter and destroys
the threads used by this Server.
|
ExceptionHandler |
getExceptionHandler()
Gets the handler for error conditions occurring on the Remote Server.
|
String |
getName()
Gets the name, used for logging purposes, associated to the Server instance.
|
OutputStream |
getNotifyStream()
Gets the stream used by the Remote Adapter in order to send asyncronous
data to the Remote Adapter.
|
String |
getRemotePassword()
Gets the password credential to be sent to the Proxy Adapter upon connection.
The default value is null. |
String |
getRemoteUser()
Gets the user-name credential to be sent to the Proxy Adapter upon connection.
The default value is null. |
OutputStream |
getReplyStream()
Gets the stream used by the Remote Adapter in order to forward the answers
to the Proxy Adapter.
|
InputStream |
getRequestStream()
Gets the stream used by the Proxy Adapter in order to forward the requests
to the Remote Adapter.
|
void |
setExceptionHandler(ExceptionHandler handler)
Sets the handler for error conditions occurring on the Remote Server.
|
static void |
setLoggerProvider(com.lightstreamer.log.LoggerProvider loggerProvider)
Static method that permits to configure the logging system used by the library.
|
void |
setName(String name)
Sets a name for the Server instance; used for logging purposes.
|
void |
setNotifyStream(OutputStream outputStream)
Sets the stream used by the Remote Adapter in order to send asyncronous
data to the Remote Adapter.
|
void |
setRemotePassword(String password)
Sets the password credential to be sent to the Proxy Adapter upon connection.
|
void |
setRemoteUser(String user)
Sets the user-name credential to be sent to the Proxy Adapter upon connection.
|
void |
setReplyStream(OutputStream outputStream)
Sets the stream used by the Remote Adapter in order to forward the answers
to the Proxy Adapter.
|
void |
setRequestStream(InputStream inputStream)
Sets the stream used by the Proxy Adapter in order to forward the requests
to the Remote Adapter.
|
void |
start()
Starts the communication between the Remote Adapter and the Proxy Adapter
through the supplied streams.
|
public final void setName(@Nonnull String name)
name
- a name to identify the instance.@Nonnull public final String getName()
public final void setRemoteUser(@Nullable String user)
user
- a user name.public final void setRemotePassword(@Nullable String password)
password
- a password.@Nullable public final String getRemoteUser()
@Nullable public final String getRemotePassword()
public final void setRequestStream(@Nonnull InputStream inputStream)
inputStream
- the stream used by the Proxy Adapter in order to forward the requests
to the Remote Adapter@Nonnull public final InputStream getRequestStream()
public final void setReplyStream(@Nonnull OutputStream outputStream)
outputStream
- the stream used by the Remote Adapter in order to forward the answers
to the Proxy Adapter.@Nonnull public final OutputStream getReplyStream()
public final void setNotifyStream(@Nonnull OutputStream outputStream)
outputStream
- the stream used by the Remote Adapter in order to send asyncronous
data to the Remote Adapter.@Nonnull public final OutputStream getNotifyStream()
public final void setExceptionHandler(@Nullable ExceptionHandler handler)
handler
- the handler for error conditions occurring on the Remote Server.@Nullable public final ExceptionHandler getExceptionHandler()
public final void start() throws RemotingException, DataProviderException, MetadataProviderException
RemotingException
- An error occurred while setting up the
communication channels. The adapter was not started.DataProviderException
- No longer thrown.MetadataProviderException
- No longer thrown.public final void close()
public static void setLoggerProvider(@Nullable com.lightstreamer.log.LoggerProvider loggerProvider)
loggerProvider
- A LoggerProvider
instance that will be used to generate log messages by the library classes.Copyright © 2021. All rights reserved.