com.lightstreamer.ls_client
Class SimpleTableInfo

java.lang.Object
  extended by com.lightstreamer.ls_client.SimpleTableInfo
Direct Known Subclasses:
ExtendedTableInfo

public class SimpleTableInfo
extends java.lang.Object

Contains the specification of a table to be subscribed to Lightstreamer Server.


Field Summary
static java.lang.String COMMAND
          String constant for COMMAND subscription mode.
static java.lang.String DISTINCT
          String constant for DISTINCT subscription mode.
static java.lang.String MERGE
          String constant for MERGE subscription mode.
static java.lang.String RAW
          String constant for RAW subscription mode.
 
Constructor Summary
SimpleTableInfo(java.lang.String group, java.lang.String mode, java.lang.String schema, boolean snap)
          Constructs a table specification with basic table attributes.
 
Method Summary
 void requestUnfilteredDispatching()
          Requests that events for the items in the table are dispatched in an unfiltered way.
 void setRange(int start, int end)
          Specifies a subrange of the specified Group of items to be requested.
 void setRequestedBufferSize(int bufferSize)
          Sets the requested size for the Server ItemEventBuffer for all the items in the table.
 void setRequestedDistinctSnapshotLength(int snapshotLength)
          Sets the requested length for the snapshot to be received for all the items in the table.
 void setRequestedMaxFrequency(double maxFrequency)
          Sets the maximum update frequency for all the items in the table.
 void setSelector(java.lang.String selector)
          Specifies a selector to be applied by the Server to the updates pertaining to all the Items in the Group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMMAND

public static final java.lang.String COMMAND
String constant for COMMAND subscription mode.

See Also:
Constant Field Values

DISTINCT

public static final java.lang.String DISTINCT
String constant for DISTINCT subscription mode.

See Also:
Constant Field Values

MERGE

public static final java.lang.String MERGE
String constant for MERGE subscription mode.

See Also:
Constant Field Values

RAW

public static final java.lang.String RAW
String constant for RAW subscription mode.

See Also:
Constant Field Values
Constructor Detail

SimpleTableInfo

public SimpleTableInfo(java.lang.String group,
                       java.lang.String mode,
                       java.lang.String schema,
                       boolean snap)
                throws SubscrException
Constructs a table specification with basic table attributes.

Parameters:
group - Name of the Group of items in the table.
mode - Subscription mode for all items in the table.
schema - Name of the Schema for all items in the table.
snap - If true, requires the snapshot for all items in the table. The snapshot can be requested only for MERGE, DISTINCT and COMMAND Items mode.
Throws:
SubscrException - Thrown if the snapshot request is not compatible with the supplied subscription mode.
Method Detail

requestUnfilteredDispatching

public void requestUnfilteredDispatching()
                                  throws SubscrException
Requests that events for the items in the table are dispatched in an unfiltered way. This setting is stronger than the setting of the maximum update frequency and can lead to the subscription refusal by the Metadata Provider. It is also stronger than the setting for the buffer size. The unfiltered dispatching can be specified only for MERGE, DISTINCT and COMMAND Items mode.

Throws:
SubscrException - Thrown if unfiltered dispatching is not compatible with the supplied subscription mode.

setRange

public void setRange(int start,
                     int end)
Specifies a subrange of the specified Group of items to be requested.

Parameters:
start - 1-based Index of the first item in the Group.
end - 1-based Index of the last item in the Group.

setRequestedBufferSize

public void setRequestedBufferSize(int bufferSize)
                            throws SubscrException
Sets the requested size for the Server ItemEventBuffer for all the items in the table. If not specified, a 1 element buffer is intended if mode is MERGE and a 0 value (unlimited buffer) is intended if mode is DISTINCT. However, the real Server buffer size can be limited by the Metadata Provider. The buffer size can be specified only for MERGE and DISTINCT Items mode. It is ignored if requestUnfilteredDispatching() is also called.

Parameters:
bufferSize - the size requested for the ItemEventBuffers.
Throws:
SubscrException - Thrown if buffer size setting is not compatible with the supplied subscription mode.

setRequestedDistinctSnapshotLength

public void setRequestedDistinctSnapshotLength(int snapshotLength)
                                        throws SubscrException
Sets the requested length for the snapshot to be received for all the items in the table. If not specified, the snapshot length will be determined by the Server. The snapshot length can be specified only for DISTINCT Items mode.

Parameters:
snapshotLength - the length requested for the snapshot.
Throws:
SubscrException - Thrown if snapshot length setting is not compatible with the supplied parameters.

setRequestedMaxFrequency

public void setRequestedMaxFrequency(double maxFrequency)
                              throws SubscrException
Sets the maximum update frequency for all the items in the table. It can only be used in order to lower the frequency granted by the Metadata Provider. The update frequency can be specified only for MERGE, DISTINCT and COMMAND Items mode; in the latter case, the frequency limit only applies to consecutive "update" events for the same key value. It is ignored if requestUnfilteredDispatching() is also called.

Parameters:
maxFrequency - the frequency requested for the items.
Throws:
SubscrException - Thrown if maximum frequency setting is not compatible with the supplied subscription mode.
Edition Note:
A further global frequency limit is also imposed by the Server, if it is running in Presto edition; this specific limit also applies to RAW mode and to unfiltered dispatching.

setSelector

public void setSelector(java.lang.String selector)
Specifies a selector to be applied by the Server to the updates pertaining to all the Items in the Group.

Parameters:
selector - name of a Selector. It will be interpreted by the Metadata Provider.