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 newSaveDataDocumentin the database.voiddeleteSaveDocument(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 aSaveDataDocumentfrom 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.DatastoregetSaveDataDocuments(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.voidsetDatastore(dev.morphia.Datastore datastore) voidsetMapper(MapperRegistry mapperRegistry) voidsetMongoDBUtils(MongoDBUtils mongoDBUtils) voidsetMongoPasswordUtils(MongoPasswordUtils mongoPasswordUtils) voidsetMongoProfileDao(MongoProfileDao mongoProfileDao) voidsetMongoUserDao(MongoUserDao mongoUserDao) voidsetValidationHelper(ValidationHelper validationHelper) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.getelements.elements.sdk.dao.SaveDataDocumentDao
getProfileSaveDataDocumentBySlot, getSaveDataDocument, getUserSaveDataDocumentBySlot
-
Constructor Details
-
MongoSaveDataDocumentDao
public MongoSaveDataDocumentDao()
-
-
Method Details
-
findSaveDataDocument
Description copied from interface:SaveDataDocumentDaoFinds aSaveDataDocumentfrom the supplied id.- Specified by:
findSaveDataDocumentin interfaceSaveDataDocumentDao- Parameters:
saveDataDocumentId- the save data document ID- Returns:
- an
Optional<SaveDataDocument>with the data
-
findMongoSaveDataDocument
-
findUserSaveDataDocumentBySlot
Description copied from interface:SaveDataDocumentDaoFinds the user-scoped save data document supplying the user id and the slot.- Specified by:
findUserSaveDataDocumentBySlotin interfaceSaveDataDocumentDao- Parameters:
userId-slot-- Returns:
- the
SaveDataDocument
-
findProfileSaveDataDocumentBySlot
Description copied from interface:SaveDataDocumentDaoFinds the profile scoped save data document supplying the user id and the slot.- Specified by:
findProfileSaveDataDocumentBySlotin 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:SaveDataDocumentDaoGets all save data documents matching the supplied criteria.- Specified by:
getSaveDataDocumentsin 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:SaveDataDocumentDaoGets all save data documents matching the supplied criteria.- Specified by:
getSaveDataDocumentsin 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:SaveDataDocumentDaoCreates a newSaveDataDocumentin the database.- Specified by:
createSaveDataDocumentin interfaceSaveDataDocumentDao- Parameters:
document- the document to create- Returns:
- the document as it was created in the database
-
forceUpdateSaveDataDocument
Description copied from interface:SaveDataDocumentDaoUpdates an existingSaveDataDocument. This method ignores the version check and will forcibly overwrite the contents of the save file.- Specified by:
forceUpdateSaveDataDocumentin interfaceSaveDataDocumentDao- Parameters:
document- the document to update- Returns:
- the document as it was written to the database
-
checkedUpdate
Description copied from interface:SaveDataDocumentDaoUpdates an existingSaveDataDocument. This method ensures that the supplied version matches that of the database before the write takes.- Specified by:
checkedUpdatein interfaceSaveDataDocumentDao- Parameters:
document- the document- Returns:
- the document as it was written to the database
-
deleteSaveDocument
Description copied from interface:SaveDataDocumentDaoDeletes the save game document.- Specified by:
deleteSaveDocumentin 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
-