Package dev.getelements.elements.sdk.dao
Interface FCMRegistrationDao
- All Known Implementing Classes:
MongoFCMRegistrationDao
public interface FCMRegistrationDao
Manipulates instances of
FCMRegistration in the underlying database.-
Method Summary
Modifier and TypeMethodDescriptioncreateRegistration(FCMRegistration fcmRegistration) Creates an instance ofFCMRegistrationand stores it in the database.voiddeleteRegistration(String fcmRegistrationId) Deletes an instance ofFCMRegistrationbased on the supplied id.voiddeleteRegistrationWithRequestingProfile(Profile profile, String fcmRegistrationId) Deletes an instance ofFCMRegistrationbased on the supplied id.default Stream<FCMRegistration> getDistinctRegistrationsForRecipient(String recipientId) Ensures that theStreamreturned will only contain eachFCMRegistrationonce, and only once.getRegistrationsForRecipient(String recipientId) Gets aStream<FCMRegistration>containing all currently registeredFCMRegistrationinstances associated witht he suppliedProfileid of the recipient.updateRegistration(FCMRegistration fcmRegistration) Updates an instance ofFCMRegistrationin the database.
-
Method Details
-
createRegistration
Creates an instance ofFCMRegistrationand stores it in the database.- Parameters:
fcmRegistration- theFCMRegistration- Returns:
- the
FCMRegistrationinstance as it was created in the database
-
updateRegistration
Updates an instance ofFCMRegistrationin the database. Reassigning the values ofFCMRegistration.getProfile()orFCMRegistration.getRegistrationToken()as necessary- Parameters:
fcmRegistration- theFCMRegistrationinstance- Returns:
- the
FCMRegistrationisntance as it was written to the database
-
deleteRegistration
Deletes an instance ofFCMRegistrationbased on the supplied id. The id value corresponds to the value returned byFCMRegistration.getId().- Parameters:
fcmRegistrationId- the id of theFCMRegistrationas supplied byFCMRegistration.getId()
-
deleteRegistrationWithRequestingProfile
Deletes an instance ofFCMRegistrationbased on the supplied id. The id value corresponds to the value returned byFCMRegistration.getId(). Additionally, this must refuse the if the suppliedProfiledoes not match the owner of the correspendongFCMRegistration.- Parameters:
fcmRegistrationId- the id of theFCMRegistrationas supplied byFCMRegistration.getId()
-
getRegistrationsForRecipient
Gets aStream<FCMRegistration>containing all currently registeredFCMRegistrationinstances associated witht he suppliedProfileid of the recipient.- Parameters:
recipientId- theProfileid of the recipient, as returned byProfile.getId()- Returns:
- a
Stream<FCMRegistration>containing all matchingFCMRegistrationinstances
-
getDistinctRegistrationsForRecipient
Ensures that theStreamreturned will only contain eachFCMRegistrationonce, and only once. The default implementation of this method uses a technique similar toStream.distinct(), but implementations may opt to use the underlying database to optimize this operation.- Parameters:
recipientId- theProfileid of the recipient, as returned byProfile.getId()- Returns:
- a
Stream<FCMRegistration>containing all matchingFCMRegistrationinstances
-