Interface MetadataControlListener


public interface MetadataControlListener
Used by Lightstreamer Kernel to receive requests about sessions and any asynchronous severe error notification from the Metadata Adapter. The listener instance is supplied to the Metadata Adapter by Lightstreamer Kernel 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(String, String, Map) 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 the SERVER thread pool, 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(String, String, Map) 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 the SERVER thread pool, 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(@Nonnull Throwable e)
      Called by a Metadata Adapter to notify Lightstreamer Kernel of the occurrence of a severe problem that can compromise future operation of the Metadata Adapter. This causes the whole Server to exit, so that an external recovery mechanism may come into action.
      Parameters:
      e - any java.lang.Throwable object, with the description of the problem.