Interface MetadataControlListener


public interface MetadataControlListener
Used by Lightstreamer to receive requests about sessions and any asynchronous severe error notification from the Remote Metadata Adapter. The listener instance is supplied to the Data Adapter by Lightstreamer Kernel (through the Remote Server) through a setListener call.
See Also:
  • Method Details

    • forceSessionTermination

      @Nonnull CompletionStage<Void> forceSessionTermination(@Nonnull String sessionID)
      Enforces the termination of the specified session. If currently there is no such session, the call does nothing. The call does nothing also if such session exists but it is bound to a different Adapter Set.
      If the session is terminated, the originating client will receive the notification of the termination according with the API in use, together with a proper cause code.
      Invoking this request while still inside the execution of MetadataProvider.notifyNewSession(java.lang.String, java.lang.String, java.util.Map<java.lang.String, java.lang.String>) related with the supplied session ID is pointless; however, the request will be held, then carried out after the underlying session initiation has finished. If the session termination occurs while the client creation request is still in place, the client request will return as failed.
      Parameters:
      sessionID - The ID of the session to be closed.
      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 a Remote Server's internal thread, hence they are expected to execute fast. Also note that if the session with the specified ID is not found the operation will be just considered as fulfilled.
    • forceSessionTermination

      @Nonnull CompletionStage<Void> forceSessionTermination(@Nonnull String sessionID, int causeCode, @Nullable String causeMessage)
      Enforces the termination of the specified session. If currently there is no such session, the call does nothing. The call does nothing also if such session exists but it is bound to a different Adapter Set.
      If the session is terminated, the originating client will receive the notification of the termination according with the API in use, together with the specified cause code and optional custom message.
      Invoking this request while still inside the execution of MetadataProvider.notifyNewSession(java.lang.String, java.lang.String, java.util.Map<java.lang.String, java.lang.String>) related with the supplied session ID is pointless; however, the request will be held, then carried out after the underlying session initiation has finished. If the session termination occurs while the client creation request is still in place, the client request will return as failed.
      Parameters:
      sessionID - The ID of the session to be closed.
      causeCode - Error code that can be used to distinguish the cause of the closure. It must be a negative integer, or zero to mean an unspecified problem.
      causeMessage - Error message to be sent to the client, or null.
      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 a Remote Server's internal thread, hence they are expected to execute fast. Also note that if the session with the specified ID is not found the operation will be just considered as fulfilled.
    • forceUnsubscription

      @Nonnull CompletionStage<Boolean> forceUnsubscription(@Nonnull String sessionID, @Nonnull TableInfo table)
      Enforces the unsubscription of a Table (i.e.: Subscription). If the unsubscription was already performed, the call does nothing. The Table is identified by a session ID and a TableInfo object that have been received from an invocation of MetadataProvider.notifyNewTables(java.lang.String, java.lang.String, com.lightstreamer.adapters.remote.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 inside MetadataProvider.notifyNewTables(java.lang.String, java.lang.String, com.lightstreamer.adapters.remote.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 if the related invocation of MetadataProvider.notifyNewTables(java.lang.String, java.lang.String, com.lightstreamer.adapters.remote.TableInfo[]) has provided an array of TableInfo with a single element (this one). However, the case of arrays with multiple elements is only possible when extremely old client SDKs are in use. Moreover, the operation is available only if previously enabled through MetadataProvider.enableTableUnsubscription(String, TableInfo[]).
      Parameters:
      sessionID - The ID of the session to which the table belongs.
      table - a TableInfo object obtained from an invocation of MetadataProvider.notifyNewTables(java.lang.String, java.lang.String, com.lightstreamer.adapters.remote.TableInfo[]).
      Returns:
      A CompletionStage that provides the operation outcome. If the outcome is False, the operation was not enabled, hence not attempted at all.
      Note that any continuations requested to this CompletionStage without explicitly providing an Executor will be performed in a Remote Server's internal thread, hence they are expected to execute fast. Also note that if the session with the specified ID is not found the operation will be just considered as fulfilled.
    • failure

      void failure(@Nullable Exception exception)
      Called by a Remote Metadata Adapter to notify Lightstreamer Kernel of the occurrence of a severe problem that can compromise future operation of the Metadata Adapter.
      Parameters:
      exception - Any Exception object, with the description of the problem.