Class TableInfo
java.lang.Object
com.lightstreamer.interfaces.metadata.TableInfo
Used by Lightstreamer to provide value objects to the calls
to methods
MetadataProvider.notifyNewTables(java.lang.String, java.lang.String, com.lightstreamer.interfaces.metadata.TableInfo[])
,
MetadataProvider.notifyTablesClose(java.lang.String, com.lightstreamer.interfaces.metadata.TableInfo[])
, and
MetadataProvider.notifyMpnSubscriptionActivation(java.lang.String, java.lang.String, com.lightstreamer.interfaces.metadata.TableInfo, com.lightstreamer.interfaces.metadata.MpnSubscriptionInfo)
.
The attributes of every Table (i.e.: Subscription) to be added or removed
to a Session have to be written to a TableInfo instance.
The object also provides useful queries and operations that can be performed
on its specific Table (i.e.: Subscription).-
Constructor Summary
ConstructorDescriptionTableInfo
(int winIndex, Mode mode, String group, String dataAdapter, String schema, int min, int max, String selector, String[] itemNames, SubscriptionStatistics[] itemSubscrStats) Used by Lightstreamer to create a TableInfo instance, collecting the various attributes of a Table (i.e.: Subscription). -
Method Summary
Modifier and TypeMethodDescriptionEnforces the unsubscription of this Table (i.e.: Subscription).Returns the name of the Data Adapter to which the Table (i.e.: Subscription) refers.getId()
Returns the name of the Item Group (or specification of the Item List) to which the subscribed Items belong.int
getMax()
Returns the index of the last Item in the Group to be considered in the Table (i.e.: Subscription).int
getMin()
Returns the index of the first Item in the Group to be considered in the Table (i.e.: Subscription).getMode()
Returns the publishing Mode for the Items in the Table (i.e.: Subscription) (it must be the same across all the Table).Returns the name of the Field Schema (or specification of the Field List) used for the subscribed Items.Returns the name of the optional Selector associated to the Table (i.e.: Subscription).String[]
Returns the array of the Item names involved in this Table (i.e.: Subscription).Returns an array that contains the statistics related with the activity of all items involved in this Table (i.e.: Subscription).int
Returns a unique identifier of the client subscription request within the session.toString()
-
Constructor Details
-
TableInfo
public TableInfo(int winIndex, @Nonnull Mode mode, @Nonnull String group, @Nonnull String dataAdapter, @Nonnull String schema, int min, int max, @Nullable String selector, @Nonnull String[] itemNames, @Nullable SubscriptionStatistics[] itemSubscrStats) Used by Lightstreamer to create a TableInfo instance, collecting the various attributes of a Table (i.e.: Subscription).- Parameters:
winIndex
- Unique identifier of the client subscription request within the session.mode
- Publishing Mode for the Items in the Table (i.e.: Subscription) (it must be the same across all the Table).group
- The name of the Item Group (or specification of the Item List) to which the subscribed Items belong.dataAdapter
- The name of the Data Adapter to which the Table (i.e.: Subscription) refers.schema
- The name of the Field Schema (or specification of the Field List) used for the subscribed Items.selector
- The name of the optional Selector associated to the table (i.e.: Subscription).min
- The 1-based index of the first Item in the Group to be considered in the Table (i.e.: Subscription).max
- The 1-based index of the last Item in the Group to be considered in the Table (i.e.: Subscription).itemNames
- The array of Item names involved in this Table (i.e.: Subscription).itemSubscrStats
- An optional array that contains the statistics related with the activity of this subscription.
-
-
Method Details
-
getWinIndex
public int getWinIndex()Returns a unique identifier of the client subscription request within the session. This allows for matching the corresponding subscription and unsubscription requests. Note that, for clients based on a very old version of a client library or text protocol, subscription requests may involve multiple Tables (i.e.: Subscriptions), hence multiple objects of this type can be supplied in a single array byMetadataProvider.notifyNewTables(java.lang.String, java.lang.String, com.lightstreamer.interfaces.metadata.TableInfo[])
andMetadataProvider.notifyTablesClose(java.lang.String, com.lightstreamer.interfaces.metadata.TableInfo[])
. In this case, the value returned is the same for all these objects and the single Tables (i.e.: Subscriptions) can be identified by their relative position in the array.- Returns:
- a Window identifier.
-
getMode
Returns the publishing Mode for the Items in the Table (i.e.: Subscription) (it must be the same across all the Table).- Returns:
- a publishing Mode.
-
getId
Returns the name of the Item Group (or specification of the Item List) to which the subscribed Items belong.- Returns:
- an Item Group name (or Item List specification).
-
getDataAdapter
Returns the name of the Data Adapter to which the Table (i.e.: Subscription) refers.- Returns:
- a Data Adapter name.
-
getSchema
Returns the name of the Field Schema (or specification of the Field List) used for the subscribed Items.- Returns:
- a Field Schema name (or Field List specification).
-
getSelector
Returns the name of the optional Selector associated to the Table (i.e.: Subscription).- Returns:
- a Selector name, or null if no Selector was associated to the Table.
-
getMin
public int getMin()Returns the index of the first Item in the Group to be considered in the Table (i.e.: Subscription). Such restriction can be specified in the client request.- Returns:
- a 1-based index.
-
getMax
public int getMax()Returns the index of the last Item in the Group to be considered in the Table (i.e.: Subscription). Such restriction can be specified in the client request.- Returns:
- a 1-based index.
-
getSubscribedItems
Returns the array of the Item names involved in this Table (i.e.: Subscription). The sequence of names is the same one returned byMetadataProvider.getItems(String, String, String, String)
when decoding of the group name, but restricted, in case a first and/or last Item was specified in the client request (seegetMin()
andgetMax()
).- Returns:
- an Array of Item names.
-
getSubscriptionStatistics
Returns an array that contains the statistics related with the activity of all items involved in this Table (i.e.: Subscription). Each entry refers to one item and the order is the same as returned bygetSubscribedItems()
. These statistics are available only on the objects supplied by calls toMetadataProvider.notifyTablesClose(java.lang.String, com.lightstreamer.interfaces.metadata.TableInfo[])
, so that the statistics will refer to the whole life of the subscription.- Returns:
- an Array of statistics-gathering objects or null.
-
forceUnsubscription
Enforces the unsubscription of this Table (i.e.: Subscription). If the unsubscription was already performed, the call does nothing. The latter holds, in particular, when this object has been obtained from an invocation ofMetadataProvider.notifyTablesClose(java.lang.String, com.lightstreamer.interfaces.metadata.TableInfo[])
.
The unsubscription is usually requested by the client, but this method can override the client intentions. In this case, the client will just receive the notification of the unsubscription according with the API in use, but with no other information as to the cause.
Invoking this request while still insideMetadataProvider.notifyNewTables(java.lang.String, java.lang.String, com.lightstreamer.interfaces.metadata.TableInfo[])
is pointless; however, the request will be held, then carried out after the underlying subscription attempt has finished.
Note: the operation is only available when this object has been obtained from an invocation ofMetadataProvider.notifyNewTables(java.lang.String, java.lang.String, com.lightstreamer.interfaces.metadata.TableInfo[])
which has provided an array of TableInfo with a single element (this one); otherwise it will do nothing. However, the case of arrays with multiple elements is only possible when extremely old client SDKs are in use.
The operation is also not available on objects obtained from an invocation ofMetadataProvider.notifyMpnSubscriptionActivation(java.lang.String, java.lang.String, com.lightstreamer.interfaces.metadata.TableInfo, com.lightstreamer.interfaces.metadata.MpnSubscriptionInfo)
.- Returns:
- A CompletionStage that provides the operation outcome.
Note that any continuations requested to this CompletionStage
without explicitly providing an Executor will be performed in the same
thread pool used for
MetadataProvider.notifyNewTables(java.lang.String, java.lang.String, com.lightstreamer.interfaces.metadata.TableInfo[])
, hence they are expected to execute fast.
-
toString
-