Class RemoteApi

java.lang.Object
me.ahoo.cosid.store.remote.RemoteApi

public final class RemoteApi extends Object
The HTTP API (no version prefix, D30) of cosid-server (08-remote.md §2): the paths, the error codes of the error body {code, message} and the field names both sides use. Keys and namespaces travel in request bodies, never in paths.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    POST {namespace, ownerKey, incarnation, limit, ttlMs, toleranceMs, slotOffset?, preferredSlot?} → the lease and reason, duplicateOwnerKey; exhausted: 409.
    static final String
    400: a parameter is missing or out of its limits.
    static final String
    503: the blocking pool is full; the response carries Retry-After: 1.
    static final String
    403: the token may not use that namespace or key.
    static final String
    409: the generator is disabled.
    static final String
    GET ?count=n → {ids: [...]}, from the generator named default; /{generator} names another.
    static final String
    409: the owner or fence of the lease no longer match (renew, release).
    static final String
    405: the path takes another method.
    static final String
    409: the namespace was first used with another limit, tolerance or slot offset.
    static final String
    404: no such path or generator.
    static final String
    422: the range would pass Long.MAX_VALUE.
    static final String
    410: the range key is sealed.
    static final String
    POST {namespace, slot, ownerKey, incarnation, fence, expiresAt?, floor?, ceiling?, storeNow?, lastIssued} → 204; lost: 409.
    static final String
    POST {namespace, slot, ownerKey, incarnation, fence, expiresAt?, floor?, ceiling?, storeNow?, ttlMs, toleranceMs} → the lease; lost: 409.
    static final String
    POST {key, size, initialOffset} → {start, end}; sealed: 410.
    static final String
    POST {key} → 204; 501 when the backing store cannot seal.
    static final String
    501: the backing store cannot seal keys.
    static final String
    409: every slot below the limit is held; the body also carries earliestExpiresAt.
    static final String
    500: the backing store failed.
    static final String
    504: the backing store timed out; the client reports a StoreTimeoutException cause.
    static final String
    429: the client already uses as many range keys in the namespace as the server allows.
    static final String
    429: the client already uses range keys in as many namespaces as the server allows.
    static final String
    401: no token, or an unknown one.
    static final String
    501: the backing store lacks the primitive.
  • Method Summary

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • RESERVE

      public static final String RESERVE
      POST {key, size, initialOffset} → {start, end}; sealed: 410.
      See Also:
    • SEAL

      public static final String SEAL
      POST {key} → 204; 501 when the backing store cannot seal.
      See Also:
    • ACQUIRE

      public static final String ACQUIRE
      POST {namespace, ownerKey, incarnation, limit, ttlMs, toleranceMs, slotOffset?, preferredSlot?} → the lease and reason, duplicateOwnerKey; exhausted: 409. slotOffset (0 by default) is recorded with the namespace.
      See Also:
    • RENEW

      public static final String RENEW
      POST {namespace, slot, ownerKey, incarnation, fence, expiresAt?, floor?, ceiling?, storeNow?, ttlMs, toleranceMs} → the lease; lost: 409. The window fields are those of the lease, sent back as they were.
      See Also:
    • RELEASE

      public static final String RELEASE
      POST {namespace, slot, ownerKey, incarnation, fence, expiresAt?, floor?, ceiling?, storeNow?, lastIssued} → 204; lost: 409.
      See Also:
    • IDS

      public static final String IDS
      GET ?count=n → {ids: [...]}, from the generator named default; /{generator} names another.
      See Also:
    • BAD_REQUEST

      public static final String BAD_REQUEST
      400: a parameter is missing or out of its limits.
      See Also:
    • UNAUTHORIZED

      public static final String UNAUTHORIZED
      401: no token, or an unknown one.
      See Also:
    • FORBIDDEN

      public static final String FORBIDDEN
      403: the token may not use that namespace or key.
      See Also:
    • NOT_FOUND

      public static final String NOT_FOUND
      404: no such path or generator.
      See Also:
    • METHOD_NOT_ALLOWED

      public static final String METHOD_NOT_ALLOWED
      405: the path takes another method.
      See Also:
    • SLOTS_EXHAUSTED

      public static final String SLOTS_EXHAUSTED
      409: every slot below the limit is held; the body also carries earliestExpiresAt.
      See Also:
    • LEASE_LOST

      public static final String LEASE_LOST
      409: the owner or fence of the lease no longer match (renew, release).
      See Also:
    • NAMESPACE_MISMATCH

      public static final String NAMESPACE_MISMATCH
      409: the namespace was first used with another limit, tolerance or slot offset.
      See Also:
    • GENERATOR_DISABLED

      public static final String GENERATOR_DISABLED
      409: the generator is disabled.
      See Also:
    • RANGE_SEALED

      public static final String RANGE_SEALED
      410: the range key is sealed.
      See Also:
    • RANGE_EXHAUSTED

      public static final String RANGE_EXHAUSTED
      422: the range would pass Long.MAX_VALUE.
      See Also:
    • TOO_MANY_KEYS

      public static final String TOO_MANY_KEYS
      429: the client already uses as many range keys in the namespace as the server allows.
      See Also:
    • TOO_MANY_NAMESPACES

      public static final String TOO_MANY_NAMESPACES
      429: the client already uses range keys in as many namespaces as the server allows.
      See Also:
    • STORE_ERROR

      public static final String STORE_ERROR
      500: the backing store failed.
      See Also:
    • SEAL_UNSUPPORTED

      public static final String SEAL_UNSUPPORTED
      501: the backing store cannot seal keys.
      See Also:
    • UNSUPPORTED

      public static final String UNSUPPORTED
      501: the backing store lacks the primitive.
      See Also:
    • STORE_TIMEOUT

      public static final String STORE_TIMEOUT
      504: the backing store timed out; the client reports a StoreTimeoutException cause.
      See Also:
    • BUSY

      public static final String BUSY
      503: the blocking pool is full; the response carries Retry-After: 1.
      See Also: