Class BlueMindRestSession.Session

java.lang.Object
org.exoplatform.caldav.client.bluemind.BlueMindRestSession.Session
All Implemented Interfaces:
AutoCloseable
Enclosing class:
BlueMindRestSession

public final class BlueMindRestSession.Session extends Object implements AutoCloseable
An open session: the REST root and the key every call carries. Paths are given relative to the root and always start with /api/; a query may follow, and is never named in a message.
  • Method Details

    • userUid

      public String userUid()
      The directory entry uid BlueMind authenticated this session as, the segment of the account's DAV principal /dav/principals/__uids__/<uid>/.
      Returns:
      the uid, or null when the login answer named none
    • domainUid

      public String domainUid()
      The uid of the domain the authenticated account belongs to: the {domainUid} segment of BlueMind's per-user REST paths.
      Returns:
      the domain uid, or null when the login answer named none
    • get

      A GET.
      Parameters:
      path - the path under the root, query included if any
      Returns:
      the answer
    • post

      public BlueMindRestSession.Answer post(String path, String body, String contentType)
      A POST with a body.
      Parameters:
      path - the path under the root
      body - the body text
      contentType - its media type, sent exactly as given
      Returns:
      the answer
    • put

      public BlueMindRestSession.Answer put(String path, String body, String contentType)
      A PUT with a body.
      Parameters:
      path - the path under the root
      body - the body text
      contentType - its media type, sent exactly as given
      Returns:
      the answer
    • delete

      public BlueMindRestSession.Answer delete(String path)
      A DELETE.
      Parameters:
      path - the path under the root, query included if any
      Returns:
      the answer
    • close

      public void close()
      Logs out a session nothing keeps (closeIfMine()); a failure is only noted. A kept session stays in the store, for the next call to reuse.
      Specified by:
      close in interface AutoCloseable
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • named

      public URI named(String path)
      The URI a message may name for a path: root and path, without the query.
      Parameters:
      path - the path under the root
      Returns:
      the URI, query stripped