Class MongoProfileDao
java.lang.Object
dev.getelements.elements.dao.mongo.MongoProfileDao
- All Implemented Interfaces:
ProfileDao
Created by patricktwohig on 6/28/17.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateOrReactivateProfile(Profile profile, Map<String, Object> metadata) Creates or reactivates an inactive profile.createOrRefreshProfile(Profile profile) Creates, reactivates, or refreshes aProfile.findActiveMongoProfile(Profile profile) findActiveMongoProfile(String profileId) findActiveMongoProfile(org.bson.types.ObjectId profileId) findActiveProfile(String profileId) Finds the profile with the supplied profile ID.findActiveProfileForUser(String profileId, String userId) Finds the profile with the supplied profile ID.getActiveMongoProfile(Profile profile) getActiveMongoProfile(String profileId) getActiveMongoProfile(org.bson.types.ObjectId objectId) getActiveMongoProfilesForUser(org.bson.types.ObjectId mongoUserObjectId) getActiveProfile(String profileId) Gets the specific active profile with the id, or throws aNotFoundExceptionif the profile can't be found.getActiveProfiles(int offset, int count, String search) Gets actives profiles specifying the offset and the count, specifying a search filter.getActiveProfiles(int offset, int count, String applicationNameOrId, String userId, Long lowerBoundTimestamp, Long upperBoundTimestamp) Gets actives profiles specifying the offset and the count.dev.morphia.Datastoredev.morphia.query.Query<MongoProfile> parseLegacyQuery(String search) voidsetBeanMapper(MapperRegistry beanMapperRegistry) voidsetBooleanQueryParser(BooleanQueryParser booleanQueryParser) voidsetDatastore(dev.morphia.Datastore datastore) voidsetMongoApplicationDao(MongoApplicationDao mongoApplicationDao) voidsetMongoConcurrentUtils(MongoConcurrentUtils mongoConcurrentUtils) voidsetMongoDBUtils(MongoDBUtils mongoDBUtils) voidsetMongoLargeObjectDao(MongoLargeObjectDao mongoLargeObjectDao) voidsetMongoUserDao(MongoUserDao mongoUserDao) voidsetValidationHelper(ValidationHelper validationHelper) voidsoftDeleteProfile(String profileId) Deletes a profile by marking it as inactive.voidsoftDeleteProfilesForUser(MongoUser mongoUser) transform(MongoProfile input) updateActiveProfile(Profile profile, Map<String, Object> metadata) Updates the specific active profile with the id, or throws aNotFoundExceptionif the profile can't be found.updateMetadata(Profile profile, Map<String, Object> metadata) Updates metadata for the specifiedProfile, ignoring changes to all other fields.updateMetadata(String profileId, Map<String, Object> metadata) Updates metadata for the specifiedProfile, ignoring changes to all other fields.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.ProfileDao
createOrReactivateProfile, updateActiveProfile
-
Constructor Details
-
MongoProfileDao
public MongoProfileDao()
-
-
Method Details
-
findActiveProfile
Description copied from interface:ProfileDaoFinds the profile with the supplied profile ID. Returning null if no profile matches the requested profile ID.- Specified by:
findActiveProfilein interfaceProfileDao- Parameters:
profileId- the profile ID- Returns:
- the active profile with the supplied ID, or null if not found.
-
findActiveMongoProfile
-
findActiveMongoProfile
-
findActiveMongoProfile
-
findActiveProfileForUser
Description copied from interface:ProfileDaoFinds the profile with the supplied profile ID. Returning null if no profile matches the requested profile ID and user ID.- Specified by:
findActiveProfileForUserin interfaceProfileDao- Parameters:
profileId- the profileIduserId- the id of the profile- Returns:
- the active profile, or null if not found
-
getActiveProfiles
public Pagination<Profile> getActiveProfiles(int offset, int count, String applicationNameOrId, String userId, Long lowerBoundTimestamp, Long upperBoundTimestamp) Description copied from interface:ProfileDaoGets actives profiles specifying the offset and the count.- Specified by:
getActiveProfilesin interfaceProfileDao- Parameters:
offset- the offsetcount- the countapplicationNameOrId- the application name or ID (may be null)userId- the user ID (may be null)lowerBoundTimestamp- optional last login lower bound cutoff in ms (inclusive). If negative valued, defaults to unix epoch.upperBoundTimestamp- optional last login upper bound cutoff in ms (inclusive). If negative valued, defaults to current server time.- Returns:
- a
PaginationofProfileobjects.
-
getActiveProfiles
Description copied from interface:ProfileDaoGets actives profiles specifying the offset and the count, specifying a search filter.- Specified by:
getActiveProfilesin interfaceProfileDao- Parameters:
offset- the offsetcount- the countsearch- the search string- Returns:
- a
PaginationofProfileobjects.
-
parseLegacyQuery
-
getActiveProfile
Description copied from interface:ProfileDaoGets the specific active profile with the id, or throws aNotFoundExceptionif the profile can't be found.- Specified by:
getActiveProfilein interfaceProfileDao- Returns:
- the
Profilethat was requested, never null
-
getActiveMongoProfile
-
getActiveMongoProfile
-
getActiveMongoProfile
-
getActiveMongoProfilesForUser
-
getActiveMongoProfilesForUser
public Stream<MongoProfile> getActiveMongoProfilesForUser(org.bson.types.ObjectId mongoUserObjectId) -
updateActiveProfile
Description copied from interface:ProfileDaoUpdates the specific active profile with the id, or throws aNotFoundExceptionif the profile can't be found. TheProfile.getId()is used to key the profile being updated.- Specified by:
updateActiveProfilein interfaceProfileDao- Parameters:
metadata- the profile metadata- Returns:
- the
Profileas it was written into the database
-
updateMetadata
Description copied from interface:ProfileDaoUpdates metadata for the specifiedProfile, ignoring changes to all other fields.- Specified by:
updateMetadatain interfaceProfileDao- Parameters:
profileId- the profilemetadata- the metadata- Returns:
- the updated
Profile
-
updateMetadata
Description copied from interface:ProfileDaoUpdates metadata for the specifiedProfile, ignoring changes to all other fields.- Specified by:
updateMetadatain interfaceProfileDao- Parameters:
profile- the profilemetadata- the metadata- Returns:
- the updated
Profile
-
createOrReactivateProfile
Description copied from interface:ProfileDaoCreates or reactivates an inactive profile. If the profile is active then this throws aDuplicateException. The newly created or reactivated profile will contain the ID of the profile as requested. The value ofProfile.getId()will be ignored and updates will be keyed using theUserandApplication.- Specified by:
createOrReactivateProfilein interfaceProfileDao- Parameters:
metadata- the profile metadata- Returns:
- the
Profileas it was written into the database
-
createOrRefreshProfile
Description copied from interface:ProfileDaoCreates, reactivates, or refreshes aProfile. This is similar toProfileDao.createOrReactivateProfile(Profile)except that it will upsert theProfile.If the profile is already active, then this will perform minimal updates of the profile as it is supplied. Specifically, it will not update the display name, application, and user field. It will only update the image url, if it was supplied.
- Specified by:
createOrRefreshProfilein interfaceProfileDao- Parameters:
profile- the user- Returns:
- the
Profile, as written to the database
-
softDeleteProfile
Description copied from interface:ProfileDaoDeletes a profile by marking it as inactive. Data is otherwise retained in the database.- Specified by:
softDeleteProfilein interfaceProfileDao- Parameters:
profileId- the profile ID
-
softDeleteProfilesForUser
-
transform
-
getMongoDBUtils
-
setMongoDBUtils
-
getDatastore
public dev.morphia.Datastore getDatastore() -
setDatastore
@Inject public void setDatastore(dev.morphia.Datastore datastore) -
getBeanMapper
-
setBeanMapper
-
getValidationHelper
-
setValidationHelper
-
getMongoUserDao
-
setMongoUserDao
-
getMongoApplicationDao
-
setMongoApplicationDao
-
getMongoConcurrentUtils
-
setMongoConcurrentUtils
-
getMongoLargeObjectDao
-
setMongoLargeObjectDao
-
getBooleanQueryParser
-
setBooleanQueryParser
-