public final class LSProxy
extends java.lang.Object
LSClient
Constructor and Description |
---|
LSProxy(ProxyInfo info,
PushErrorListener errorListener,
PushStatusListener statusListener)
Creates an LSProxy, by specifying some connection policy preferences
and a listener to receive asynchronous errors notifications.
|
Modifier and Type | Method and Description |
---|---|
void |
clearConnection()
Requests the stopping of push activity and the cancellation of all
current subscriptions.
|
void |
endTran()
Completes a subscription requests transaction.
|
ConnectionConstraints |
getConnectionConstraints()
Returns the constraints currently requested on the overall data flow
from the Connection.
|
boolean |
isPushing()
Returns the current connection state.
|
void |
setConnectionConstraints(ConnectionConstraints constraints)
Changes the constraints to be applied on the overall data flow
from the Connection.
|
void |
startPushConnection(ConnectionInfo info)
Requests the starting of push activity.
|
void |
startTran()
Starts a subscription requests transaction.
|
void |
stopPushConnection()
Requests the stopping of push activity.
|
void |
subscribeBandwidth(BandwidthListener bwListener)
Adds a listener to samplings about connection activity.
|
void |
subscribeItem(UpdateListener itemListener,
Item item,
java.lang.String[] schema)
Requests the subscription of some Fields for an Item and supplies
a listener to receive value Updates and an initial Snapshot, if it is
available.
|
void |
subscribeItems(UpdateListener itemListener,
Item[] items,
java.lang.String[] schema)
Requests the subscription of some Fields for a set of Items and supplies
a listener to receive information for all the Items.
|
void |
unsubscribeBandwidth(BandwidthListener bwListener)
Removes a listener to samplings about connection activity.
|
void |
unsubscribeItem(UpdateListener itemListener,
Item item,
java.lang.String[] schema)
Removes a subscription previously requested.
|
void |
unsubscribeItems(UpdateListener itemListener,
Item[] items,
java.lang.String[] schema)
Removes a subscription previously requested for a set of items.
|
public LSProxy(ProxyInfo info, PushErrorListener errorListener, PushStatusListener statusListener)
info
- supplies connection policy preferences. It must not be null.
A copy of the object is stored internally.errorListener
- receives asynchronous errors notifications. It
must not be null.statusListener
- receives asynchronous notifications on the connection
state. It must not be null.public void startPushConnection(ConnectionInfo info) throws PushException
info
- supplies connection informations and preferences. It must
not be null. A copy of the object is stored internally.PushException
- thrown if the connection attempt has failed.public void stopPushConnection()
public void clearConnection()
stopPushConnection()
public boolean isPushing()
public void setConnectionConstraints(ConnectionConstraints constraints)
constraints
- collects available constraints.
It should not be null; to unset all constraints, use an empty
structure, instead.
A copy of the object is stored internally.public ConnectionConstraints getConnectionConstraints()
public void subscribeBandwidth(BandwidthListener bwListener)
bwListener
- receives samplings about connection activity. It must
not be null.public void unsubscribeBandwidth(BandwidthListener bwListener)
bwListener
- samplings listener to remove. It must not be null.public void startTran()
public void endTran()
public void subscribeItem(UpdateListener itemListener, Item item, java.lang.String[] schema)
itemListener
- receives value Updates and error notifications
about the Item. It must not be null.item
- Specification of an Item to subscribe, together with its
subscription preferences. It must not be null. The object may be stored
internally, thus it should not be modified anymore.
Different Item objects can refer to the same information Item and can
specify either the same or different subscription preferences.schema
- Array with the names of the Fields to be subscribed.
The order of the names is unimportant. None of these can be null.public void unsubscribeItem(UpdateListener itemListener, Item item, java.lang.String[] schema)
itemListener
- listener for the subscription to remove. It must
not be null.item
- Item whose subscription is to be removed. It must not be
null.schema
- Array with the names of the Fields whose subscription
is to be removed. The order of the names is unimportant. None of
these can be null.public void subscribeItems(UpdateListener itemListener, Item[] items, java.lang.String[] schema)
itemListener
- receives value Updates and error notifications
about the Item. It must not be null.items
- Array with the specifications of the Items to subscribe,
together with their subscription preferences. None of these can be
null. The Item objects may be stored internally, thus they should
not be modified anymore.schema
- Array with the names of the Fields to be subscribed.
The order of the names is unimportant. None of these can be null.subscribeItem(com.lightstreamer.ls_proxy.UpdateListener, com.lightstreamer.ls_proxy.Item, java.lang.String[])
public void unsubscribeItems(UpdateListener itemListener, Item[] items, java.lang.String[] schema)
itemListener
- listener for all the subscriptions to remove.
It must not be null.items
- Array with the Items whose subscription is to be removed.
None of these can be null.schema
- Array with the names of the Fields whose subscription
is to be removed. The order of the names is unimportant. None of
these can be null.unsubscribeItem(com.lightstreamer.ls_proxy.UpdateListener, com.lightstreamer.ls_proxy.Item, java.lang.String[])