Class LegacyDocument

  • All Implemented Interfaces:
    Document<Object>

    public class LegacyDocument
    extends AbstractDocument<Object>
    This document is fully compatible with Java SDK 1.* stored documents. It is not compatible with other SDKs. It should be used to interact with legacy documents and code, but it is recommended to switch to the unifying document types (Json* and String) if possible to guarantee better interoperability in the future.
    Since:
    2.0
    Author:
    Michael Nitschinger
    • Method Detail

      • create

        public static LegacyDocument create​(String id,
                                            Object content,
                                            long cas)
        Creates a LegacyDocument which the document id, JSON content and the CAS value.
        Parameters:
        id - the per-bucket unique document id.
        content - the content of the document.
        cas - the CAS (compare and swap) value for optimistic concurrency.
        Returns:
        a LegacyDocument.
      • create

        public static LegacyDocument create​(String id,
                                            int expiry,
                                            Object content)
        Creates a LegacyDocument which the document id, JSON content and the expiration time.
        Parameters:
        id - the per-bucket unique document id.
        expiry - the expiration time of the document.
        content - the content of the document.
        Returns:
        a LegacyDocument.
      • create

        public static LegacyDocument create​(String id,
                                            int expiry,
                                            Object content,
                                            long cas)
        Creates a LegacyDocument which the document id, JSON content, CAS value, expiration time and status code. This factory method is normally only called within the client library when a response is analyzed and a document is returned which is enriched with the status code. It does not make sense to pre populate the status field from the user level code.
        Parameters:
        id - the per-bucket unique document id.
        expiry - the expiration time of the document.
        content - the content of the document.
        cas - the CAS (compare and swap) value for optimistic concurrency.
        Returns:
        a LegacyDocument.
      • create

        public static LegacyDocument create​(String id,
                                            int expiry,
                                            Object content,
                                            long cas,
                                            MutationToken mutationToken)
        Creates a LegacyDocument which the document id, JSON content, CAS value, expiration time and status code. This factory method is normally only called within the client library when a response is analyzed and a document is returned which is enriched with the status code. It does not make sense to pre populate the status field from the user level code.
        Parameters:
        id - the per-bucket unique document id.
        expiry - the expiration time of the document.
        content - the content of the document.
        cas - the CAS (compare and swap) value for optimistic concurrency.
        Returns:
        a LegacyDocument.