Class MongoFCMRegistrationDao
java.lang.Object
dev.getelements.elements.dao.mongo.MongoFCMRegistrationDao
- All Implemented Interfaces:
FCMRegistrationDao
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateRegistration
(FCMRegistration fcmRegistration) Creates an instance ofFCMRegistration
and stores it in the database.void
deleteRegistration
(String fcmRegistrationId) Deletes an instance ofFCMRegistration
based on the supplied id.void
deleteRegistrationWithRequestingProfile
(Profile profile, String fcmRegistrationId) Deletes an instance ofFCMRegistration
based on the supplied id.dev.morphia.Datastore
getRegistrationsForRecipient
(String recipientId) Gets aStream<FCMRegistration>
containing all currently registeredFCMRegistration
instances associated witht he suppliedProfile
id of the recipient.void
setDatastore
(dev.morphia.Datastore datastore) void
setMapper
(MapperRegistry mapperRegistry) void
setMongoApplicationDao
(MongoApplicationDao mongoApplicationDao) void
setMongoDBUtils
(MongoDBUtils mongoDBUtils) void
setMongoProfileDao
(MongoProfileDao mongoProfileDao) void
setValidationHelper
(ValidationHelper validationHelper) updateRegistration
(FCMRegistration fcmRegistration) Updates an instance ofFCMRegistration
in the database.void
validate
(FCMRegistration fcmRegistration) 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.FCMRegistrationDao
getDistinctRegistrationsForRecipient
-
Constructor Details
-
MongoFCMRegistrationDao
public MongoFCMRegistrationDao()
-
-
Method Details
-
createRegistration
Description copied from interface:FCMRegistrationDao
Creates an instance ofFCMRegistration
and stores it in the database.- Specified by:
createRegistration
in interfaceFCMRegistrationDao
- Parameters:
fcmRegistration
- theFCMRegistration
- Returns:
- the
FCMRegistration
instance as it was created in the database
-
updateRegistration
Description copied from interface:FCMRegistrationDao
Updates an instance ofFCMRegistration
in the database. Reassigning the values ofFCMRegistration.getProfile()
orFCMRegistration.getRegistrationToken()
as necessary- Specified by:
updateRegistration
in interfaceFCMRegistrationDao
- Parameters:
fcmRegistration
- theFCMRegistration
instance- Returns:
- the
FCMRegistration
isntance as it was written to the database
-
deleteRegistration
Description copied from interface:FCMRegistrationDao
Deletes an instance ofFCMRegistration
based on the supplied id. The id value corresponds to the value returned byFCMRegistration.getId()
.- Specified by:
deleteRegistration
in interfaceFCMRegistrationDao
- Parameters:
fcmRegistrationId
- the id of theFCMRegistration
as supplied byFCMRegistration.getId()
-
deleteRegistrationWithRequestingProfile
Description copied from interface:FCMRegistrationDao
Deletes an instance ofFCMRegistration
based on the supplied id. The id value corresponds to the value returned byFCMRegistration.getId()
. Additionally, this must refuse the if the suppliedProfile
does not match the owner of the correspendongFCMRegistration
.- Specified by:
deleteRegistrationWithRequestingProfile
in interfaceFCMRegistrationDao
- Parameters:
fcmRegistrationId
- the id of theFCMRegistration
as supplied byFCMRegistration.getId()
-
validate
-
getRegistrationsForRecipient
Description copied from interface:FCMRegistrationDao
Gets aStream<FCMRegistration>
containing all currently registeredFCMRegistration
instances associated witht he suppliedProfile
id of the recipient.- Specified by:
getRegistrationsForRecipient
in interfaceFCMRegistrationDao
- Parameters:
recipientId
- theProfile
id of the recipient, as returned byProfile.getId()
- Returns:
- a
Stream<FCMRegistration>
containing all matchingFCMRegistration
instances
-
getMapper
-
setMapper
-
getDatastore
public dev.morphia.Datastore getDatastore() -
setDatastore
@Inject public void setDatastore(dev.morphia.Datastore datastore) -
getMongoProfileDao
-
setMongoProfileDao
-
getValidationHelper
-
getMongoApplicationDao
-
setMongoApplicationDao
-
setValidationHelper
-
getMongoDBUtils
-
setMongoDBUtils
-