Interface Session

All Known Subinterfaces:
AsyncSession, SubscriptionSession, SyncSession
All Known Implementing Classes:
LocalAsyncSession, LocalSyncSession, MessageBusAsyncSession, MessageBusSyncSession

public interface Session
Superclass of all document api sessions. A session provides a handle through which an application can work with a document repository. There are various session subclasses for various types of interaction with the repository.

Each session can be used by multiple client application threads, i.e they are multithread safe.

Author:
bratseth
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Destroys this session and frees up any resources it has held.
    Returns the next response of this session.
    getNext(int timeoutMilliseconds)
    Returns the next response of this session.
  • Method Details

    • getNext

      Response getNext()
      Returns the next response of this session. This method returns immediately.
      Returns:
      the next response, or null if no response is ready at this time
    • getNext

      Response getNext(int timeoutMilliseconds) throws InterruptedException
      Returns the next response of this session. This will block until a response is ready or until the given timeout is reached
      Parameters:
      timeoutMilliseconds - the max time to wait for a response.
      Returns:
      the next response, or null if no response becomes ready before the timeout expires
      Throws:
      InterruptedException - if this thread is interrupted while waiting
    • destroy

      void destroy()
      Destroys this session and frees up any resources it has held. Making further calls on a destroyed session causes a runtime exception.