Class MongoSaveDataDocumentDao
java.lang.Object
dev.getelements.elements.dao.mongo.savedata.MongoSaveDataDocumentDao
- All Implemented Interfaces:
SaveDataDocumentDao
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckedUpdate
(SaveDataDocument document) Updates an existingSaveDataDocument
.createSaveDataDocument
(SaveDataDocument document) Creates a newSaveDataDocument
in the database.void
deleteSaveDocument
(String saveDataDocumentId) Deletes the save game document.findMongoSaveDataDocument
(String saveDataDocumentId) findProfileSaveDataDocumentBySlot
(String profileId, int slot) Finds the profile scoped save data document supplying the user id and the slot.findSaveDataDocument
(String saveDataDocumentId) Finds aSaveDataDocument
from the supplied id.findUserSaveDataDocumentBySlot
(String userId, int slot) Finds the user-scoped save data document supplying the user id and the slot.forceUpdateSaveDataDocument
(SaveDataDocument document) Updates an existingSaveDataDocument
.dev.morphia.Datastore
getSaveDataDocuments
(int offset, int count, String userId, String profileId) Gets all save data documents matching the supplied criteria.getSaveDataDocuments
(int offset, int count, String userId, String profileId, String query) Gets all save data documents matching the supplied criteria.void
setDatastore
(dev.morphia.Datastore datastore) void
setMapper
(MapperRegistry mapperRegistry) void
setMongoDBUtils
(MongoDBUtils mongoDBUtils) void
setMongoPasswordUtils
(MongoPasswordUtils mongoPasswordUtils) void
setMongoProfileDao
(MongoProfileDao mongoProfileDao) void
setMongoUserDao
(MongoUserDao mongoUserDao) void
setValidationHelper
(ValidationHelper validationHelper) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.getelements.elements.sdk.dao.SaveDataDocumentDao
getProfileSaveDataDocumentBySlot, getSaveDataDocument, getUserSaveDataDocumentBySlot
-
Constructor Details
-
MongoSaveDataDocumentDao
public MongoSaveDataDocumentDao()
-
-
Method Details
-
findSaveDataDocument
Description copied from interface:SaveDataDocumentDao
Finds aSaveDataDocument
from the supplied id.- Specified by:
findSaveDataDocument
in interfaceSaveDataDocumentDao
- Parameters:
saveDataDocumentId
- the save data document ID- Returns:
- an
Optional<SaveDataDocument>
with the data
-
findMongoSaveDataDocument
-
findUserSaveDataDocumentBySlot
Description copied from interface:SaveDataDocumentDao
Finds the user-scoped save data document supplying the user id and the slot.- Specified by:
findUserSaveDataDocumentBySlot
in interfaceSaveDataDocumentDao
- Parameters:
userId
-slot
-- Returns:
- the
SaveDataDocument
-
findProfileSaveDataDocumentBySlot
Description copied from interface:SaveDataDocumentDao
Finds the profile scoped save data document supplying the user id and the slot.- Specified by:
findProfileSaveDataDocumentBySlot
in interfaceSaveDataDocumentDao
- Parameters:
profileId
- the profile Idslot
- the slot- Returns:
- the
SaveDataDocument
-
getSaveDataDocuments
public Pagination<SaveDataDocument> getSaveDataDocuments(int offset, int count, String userId, String profileId) Description copied from interface:SaveDataDocumentDao
Gets all save data documents matching the supplied criteria.- Specified by:
getSaveDataDocuments
in interfaceSaveDataDocumentDao
- Parameters:
offset
- the index of the offsetcount
- the count of documents immediately following the offsetuserId
- the user id, specify null or empty string to exclude filtering by user idprofileId
- 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
public Pagination<SaveDataDocument> getSaveDataDocuments(int offset, int count, String userId, String profileId, String query) Description copied from interface:SaveDataDocumentDao
Gets all save data documents matching the supplied criteria.- Specified by:
getSaveDataDocuments
in interfaceSaveDataDocumentDao
- Parameters:
offset
- the index of the offsetcount
- the count of documents immediately following the offsetuserId
- the user id, specify null or empty string to exclude filtering by user idprofileId
- the profile idk specify null or empty string to exclude filtering by profile idquery
- the search query to use when filtering results.- Returns:
- a
Pagination<SaveDataDocument>
of all documents matching the query
-
createSaveDataDocument
Description copied from interface:SaveDataDocumentDao
Creates a newSaveDataDocument
in the database.- Specified by:
createSaveDataDocument
in interfaceSaveDataDocumentDao
- Parameters:
document
- the document to create- Returns:
- the document as it was created in the database
-
forceUpdateSaveDataDocument
Description copied from interface:SaveDataDocumentDao
Updates an existingSaveDataDocument
. This method ignores the version check and will forcibly overwrite the contents of the save file.- Specified by:
forceUpdateSaveDataDocument
in interfaceSaveDataDocumentDao
- Parameters:
document
- the document to update- Returns:
- the document as it was written to the database
-
checkedUpdate
Description copied from interface:SaveDataDocumentDao
Updates an existingSaveDataDocument
. This method ensures that the supplied version matches that of the database before the write takes.- Specified by:
checkedUpdate
in interfaceSaveDataDocumentDao
- Parameters:
document
- the document- Returns:
- the document as it was written to the database
-
deleteSaveDocument
Description copied from interface:SaveDataDocumentDao
Deletes the save game document.- Specified by:
deleteSaveDocument
in interfaceSaveDataDocumentDao
- Parameters:
saveDataDocumentId
- the save game document ID
-
getMongoDBUtils
-
setMongoDBUtils
-
getDatastore
public dev.morphia.Datastore getDatastore() -
setDatastore
@Inject public void setDatastore(dev.morphia.Datastore datastore) -
getMapper
-
setMapper
-
getMongoUserDao
-
setMongoUserDao
-
getMongoProfileDao
-
setMongoProfileDao
-
getValidationHelper
-
setValidationHelper
-
getMongoPasswordUtils
-
setMongoPasswordUtils
-