setCommandSecondLevelFields method

void setCommandSecondLevelFields(
  1. List<String>? fields
)

Setter method that sets the "Field List" to be subscribed to through Lightstreamer Server for the second-level items.

It can only be used on COMMAND Subscriptions.
Any call to this method will override any "Field List" or "Field Schema" previously specified for the second-level.
Calling this method enables the two-level behavior:
in synthesis, each time a new key is received on the COMMAND Subscription, the key value is treated as an Item name and an underlying Subscription for this Item is created and subscribed to automatically, to feed fields specified by this method. This mono-item Subscription is specified through an "Item List" containing only the Item name received. As a consequence, all the conditions provided for subscriptions through Item Lists have to be satisfied. The item is subscribed to in "MERGE" mode, with snapshot request and with the same maximum frequency setting as for the first-level items (including the "unfiltered" case). All other Subscription properties are left as the default. When the key is deleted by a DELETE command on the first-level Subscription, the associated second-level Subscription is also unsubscribed from.
Specifying null as parameter will disable the two-level behavior.

Lifecycle This method can only be called while the Subscription instance is in its "inactive" state.

Throws IllegalArgumentException if any of the field names in the "Field List" contains a space or is empty/null.

Throws IllegalStateException if the Subscription is currently "active".

Throws IllegalStateException if the Subscription mode is not "COMMAND".

  • fields An array of Strings containing a list of fields to be subscribed to through the server.
    Ensure that no name conflict is generated between first-level and second-level fields. In case of conflict, the second-level field will not be accessible by name, but only by position.

  • See Subscription.setCommandSecondLevelFieldSchema

Implementation

external void setCommandSecondLevelFields(List<String>? fields);