Interface SaveDataDocumentDao

All Known Implementing Classes:
MongoSaveDataDocumentDao

public interface SaveDataDocumentDao
Accesses save data documents from the database.
  • Method Details

    • getSaveDataDocument

      default SaveDataDocument getSaveDataDocument(String saveDataDocumentId)
      Gets a SaveDataDocument from the supplied id.
      Parameters:
      saveDataDocumentId - the database-assigned unique id of the save document
      Returns:
      the save data document, never null
      Throws:
      SaveDataNotFoundException - if no such save document exists
    • getUserSaveDataDocumentBySlot

      default SaveDataDocument getUserSaveDataDocumentBySlot(String userId, int slot)
      Gets the user-scoped save data document supplying the user id and the slot.
      Parameters:
      userId -
      slot -
      Returns:
      the SaveDataDocument
    • getProfileSaveDataDocumentBySlot

      default SaveDataDocument getProfileSaveDataDocumentBySlot(String profileId, int slot)
      Gets the profile scoped save data document supplying the user id and the slot.
      Parameters:
      profileId - the profile Id
      slot - the slot
      Returns:
      the SaveDataDocument
    • findSaveDataDocument

      Optional<SaveDataDocument> findSaveDataDocument(String saveDataDocumentId)
      Finds a SaveDataDocument from the supplied id.
      Parameters:
      saveDataDocumentId - the save data document ID
      Returns:
      an Optional<SaveDataDocument> with the data
    • findUserSaveDataDocumentBySlot

      Optional<SaveDataDocument> findUserSaveDataDocumentBySlot(String userId, int slot)
      Finds the user-scoped save data document supplying the user id and the slot.
      Parameters:
      userId -
      slot -
      Returns:
      the SaveDataDocument
    • findProfileSaveDataDocumentBySlot

      Optional<SaveDataDocument> findProfileSaveDataDocumentBySlot(String profileId, int slot)
      Finds the profile scoped save data document supplying the user id and the slot.
      Parameters:
      profileId - the profile Id
      slot - the slot
      Returns:
      the SaveDataDocument
    • getSaveDataDocuments

      Pagination<SaveDataDocument> getSaveDataDocuments(int offset, int count, String userId, String profileId)
      Gets all save data documents matching the supplied criteria.
      Parameters:
      offset - the index of the offset
      count - the count of documents immediately following the offset
      userId - the user id, specify null or empty string to exclude filtering by user id
      profileId - the profile idk specify null or empty string to exclude filtering by profile id
      Returns:
      a Pagination<SaveDataDocument> of all documents matching the query
    • getSaveDataDocuments

      Pagination<SaveDataDocument> getSaveDataDocuments(int offset, int count, String userId, String profileId, String query)
      Gets all save data documents matching the supplied criteria.
      Parameters:
      offset - the index of the offset
      count - the count of documents immediately following the offset
      userId - the user id, specify null or empty string to exclude filtering by user id
      profileId - the profile idk specify null or empty string to exclude filtering by profile id
      query - the search query to use when filtering results.
      Returns:
      a Pagination<SaveDataDocument> of all documents matching the query
    • createSaveDataDocument

      SaveDataDocument createSaveDataDocument(SaveDataDocument document)
      Creates a new SaveDataDocument in the database.
      Parameters:
      document - the document to create
      Returns:
      the document as it was created in the database
    • forceUpdateSaveDataDocument

      SaveDataDocument forceUpdateSaveDataDocument(SaveDataDocument document)
      Updates an existing SaveDataDocument. This method ignores the version check and will forcibly overwrite the contents of the save file.
      Parameters:
      document - the document to update
      Returns:
      the document as it was written to the database
    • checkedUpdate

      SaveDataDocument checkedUpdate(SaveDataDocument document)
      Updates an existing SaveDataDocument. This method ensures that the supplied version matches that of the database before the write takes.
      Parameters:
      document - the document
      Returns:
      the document as it was written to the database
      Throws:
      SaveDataNotFoundException - if the document was not found, or the version mismatched
    • deleteSaveDocument

      void deleteSaveDocument(String saveDataDocumentId)
      Deletes the save game document.
      Parameters:
      saveDataDocumentId - the save game document ID