|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.lightstreamer.ls_client.LSClient
public class LSClient
Incapsulates a single connector to Lightstreamer Server.
| Constructor Summary | |
|---|---|
LSClient()
Empty constructor. |
|
| Method Summary | |
|---|---|
void |
batchRequests(int batchSize)
Signals that the next subscription and unsubscription requests can be accumulated and sent to Lightstreamer Server with a single connection. |
void |
changeConstraints(ConnectionConstraints constraints)
Requests new bandwidth and frequency constraints for the current connection. |
void |
closeBatch()
Closes a pending batch. |
void |
closeConnection()
Closes the connection to the Server, if one is open. |
void |
forceUnsubscribeTable(SubscribedTableKey tableKey)
Tries to unsubscribe a table for which a previous unsubscribe has been called but an exception has been received. |
void |
openConnection(ConnectionInfo info,
ConnectionListener listener)
Opens a connection to the Server with the supplied parameters. |
void |
sendMessage(java.lang.String message)
Sends a message to Lightstreamer Server. |
SubscribedTableKey[] |
subscribeItems(ExtendedTableInfo items,
ExtendedTableListener listener)
Subscribes a set of items, which share the same schema and other subscription parameters. |
SubscribedTableKey[] |
subscribeItems(ExtendedTableInfo items,
FastItemsListener listener)
Same as the other overload, but notifies events to a different listener. |
SubscribedTableKey |
subscribeTable(ExtendedTableInfo table,
ExtendedTableListener listener)
Subscribes a table to the Server. |
SubscribedTableKey |
subscribeTable(SimpleTableInfo table,
SimpleTableListener listener)
Subscribes a table to the Server. |
void |
unbatchRequest()
Signals that one of the requests previously scheduled for batching is no longer going to be issued. |
void |
unsubscribeTable(SubscribedTableKey tableKey)
Unsubscribes a table previously subscribed to the Server. |
void |
unsubscribeTables(SubscribedTableKey[] tableKeys)
Unsubscribes a set of tables previously subscribed to the Server. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LSClient()
| Method Detail |
|---|
public void batchRequests(int batchSize)
throws SubscrException
batchSize - number of incoming subscription and unsubscription
requests that can be batched. A zero value means an unlimited number
of requests (the batch must be closed by calling closeBatch).
SubscrException - Thrown if the connection is currently closed.
public void changeConstraints(ConnectionConstraints constraints)
throws PushConnException,
PushServerException
constraints - Collects bandwidth and frequency constraints
for data flow from the Connection. It should not be null; to unset all
constraints, use an empty structure, instead.
PushConnException - Thrown in case of connection problems.
PushServerException - Thrown in case of errors in the supplied
parameters or in Server answer.
In normal conditions, this exception should never happen.public void closeBatch()
public void closeConnection()
public void forceUnsubscribeTable(SubscribedTableKey tableKey)
throws SubscrException,
PushServerException,
PushConnException
tableKey - Handle to a table as returned by a subscribe* call.
SubscrException - Thrown if the connection has already been
closed or the supplied table is currently subscribed. In this case,
there wasn't a zombie subscription in the Server for the supplied
table.
PushConnException - Thrown in case of connection problems.
In this case, nothing has changed in the Server.
PushServerException - Thrown in case of errors in the supplied
parameters or in Server answer. In this case there wasn't a zombie
subscription in the Server for the supplied table.
public void openConnection(ConnectionInfo info,
ConnectionListener listener)
throws PushConnException,
PushServerException,
PushUserException
info - Contains the Server address and the connection parameters.listener - Receives notification for connection events.
PushConnException - Thrown in case of connection problems.
PushServerException - Thrown in case of errors in the supplied
parameters or in Server answer.
In normal operation, this should not happen.
PushUserException - Thrown in case the connection was refused
after the checks in Lightstreamer Server Metadata Provider.
public void sendMessage(java.lang.String message)
throws PushConnException,
PushServerException,
PushUserException
message - Any text string, to be interpreted by the Metadata
Adapter. It should not be null.
PushConnException - Thrown in case of connection problems.
PushServerException - Thrown in case of errors in the supplied
parameters or in Server answer.
In normal conditions, this exception should never happen.
PushUserException - Thrown in case the message was refused
after the checks in Lightstreamer Server Metadata Provider.
public SubscribedTableKey[] subscribeItems(ExtendedTableInfo items,
ExtendedTableListener listener)
throws SubscrException,
PushServerException,
PushUserException,
PushConnException
items - Contains the specification and request parameters
of the items to subscribe. The structure is the same as that used in
subscribeTable, but the items will not be subscribed as a table.listener - Receives notification of data updates and subscription
termination. Subscribed items are identified to the listener by name.
The same listener can be used across multiple subscribedItems calls,
provided that the involved items are different. The method onUnsubscrAll
will not be called on this listener.
SubscrException - Thrown if the connection is closed.
PushConnException - Thrown in case of connection problems.
PushServerException - Thrown in case of errors in the supplied
parameters or in Server answer. In this case, some zombie subscriptions
may remain in the Server.
In normal conditions, this exception should never happen.
PushUserException - Thrown in case the subscription was refused
after the checks in Lightstreamer Server Metadata Provider.
public SubscribedTableKey[] subscribeItems(ExtendedTableInfo items,
FastItemsListener listener)
throws SubscrException,
PushServerException,
PushUserException,
PushConnException
items - Contains the specification and request parameters
of the items to subscribe.listener - Receives notification of data updates and subscription
termination.
SubscrException - Thrown if the connection is closed.
PushConnException - Thrown in case of connection problems.
PushServerException - Thrown in case of errors in the supplied
parameters or in Server answer.
PushUserException - Thrown in case the subscription was refused
after the checks in Lightstreamer Server Metadata Provider.subscribeItems(ExtendedTableInfo, ExtendedTableListener)
public SubscribedTableKey subscribeTable(ExtendedTableInfo table,
ExtendedTableListener listener)
throws SubscrException,
PushServerException,
PushUserException,
PushConnException
table - Contains the specification and request parameters
of the table to subcribe.listener - Receives notification of data updates and subscription
termination.
SubscrException - Thrown if the connection is closed.
PushConnException - Thrown in case of connection problems.
PushServerException - Thrown in case of errors in the supplied
parameters or in Server answer.
In normal conditions, this exception should never happen.
PushUserException - Thrown in case the subscription was refused
after the checks in Lightstreamer Server Metadata Provider.
public SubscribedTableKey subscribeTable(SimpleTableInfo table,
SimpleTableListener listener)
throws SubscrException,
PushServerException,
PushUserException,
PushConnException
table - Contains the specification and request parameters
of the table to subcribe.listener - Receives notification of data updates and subscription
termination.
SubscrException - Thrown if the connection is closed.
PushConnException - Thrown in case of connection problems.
PushServerException - Thrown in case of errors in the supplied
parameters or in Server answer.
In normal conditions, this exception should never happen.
PushUserException - Thrown in case the subscription was refused
after the checks in Lightstreamer Server Metadata Provider.public void unbatchRequest()
public void unsubscribeTable(SubscribedTableKey tableKey)
throws SubscrException,
PushServerException,
PushConnException
tableKey - Handle to a table as returned by a subscribe* call.
SubscrException - Thrown if the supplied table is not currently
subscribed. This occurs also if the table has already been unsubscribed
or the connection has already been closed; this may not be a problem
from the client's point of view.
PushConnException - Thrown in case of connection problems.
In this case, a zombie subscription will probably remain in the Server.
PushServerException - Thrown in case of errors in the supplied
parameters or in Server answer. In this case, a zombie subscription
may remain in the Server.
In normal conditions, this exception should never happen.
public void unsubscribeTables(SubscribedTableKey[] tableKeys)
throws SubscrException,
PushServerException,
PushConnException
tableKeys - Array of handles to tables as returned by one
or more subscribe* calls.
SubscrException - Thrown if the connection has already been
closed; this may not be a problem from the client's point of view.
PushConnException - Thrown in case of connection problems.
In this case, zombie subscriptions will probably remain in the Server.
PushServerException - Thrown in case of errors in the supplied
parameters or in Server answer. In this case, some zombie subscriptions
may remain in the Server.
In normal conditions, this exception should never happen.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||