Class MongoFollowerDao
java.lang.Object
dev.getelements.elements.dao.mongo.MongoFollowerDao
- All Implemented Interfaces:
FollowerDao
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondev.morphia.aggregation.Aggregation
<?> aggregateMutualFollowers
(MongoProfile mongoProfile) void
createFollowerForProfile
(String profileId, String followedProfileId) Creates a single instance ofCreateFollowerRequest
for the supplied profile id and toFollow id.void
deleteFollowerForProfile
(String profileId, String profileToUnfollowId) Deletes the single instance ofCreateFollowerRequest
for the supplied profile id.dev.morphia.Datastore
getFolloweesForProfile
(String profileId, int offset, int count) Fetches all followees for the supplied profile.getFollowerForProfile
(String profileId, String followedId) FetchesProfile
instance for the supplied profile id and followed id.getFollowersForProfile
(String profileId, int offset, int count) Fetches all followers for the supplied profile.void
setDatastore
(dev.morphia.Datastore datastore) void
setDozerMapper
(MapperRegistry dozerMapperRegistry) void
setMongoDBUtils
(MongoDBUtils mongoDBUtils) void
setMongoProfileDao
(MongoProfileDao mongoProfileDao)
-
Constructor Details
-
MongoFollowerDao
public MongoFollowerDao()
-
-
Method Details
-
getFollowersForProfile
Description copied from interface:FollowerDao
Fetches all followers for the supplied profile.- Specified by:
getFollowersForProfile
in interfaceFollowerDao
- Parameters:
profileId
- the id of the logged in profileoffset
- the offsetcount
- the number of results to return- Returns:
- a
Pagination
-
getFolloweesForProfile
Description copied from interface:FollowerDao
Fetches all followees for the supplied profile.- Specified by:
getFolloweesForProfile
in interfaceFollowerDao
- Parameters:
profileId
- the id of the logged in profileoffset
- the offsetcount
- the number of results to return- Returns:
- a
Pagination
-
getFollowerForProfile
Description copied from interface:FollowerDao
FetchesProfile
instance for the supplied profile id and followed id. Throwing aNotFoundException
if the follower does not exist for the supplied profile id.- Specified by:
getFollowerForProfile
in interfaceFollowerDao
- Parameters:
profileId
- the id of the logged in profilefollowedId
- the id of the followed profile- Returns:
- a
Profile
-
aggregateMutualFollowers
-
createFollowerForProfile
Description copied from interface:FollowerDao
Creates a single instance ofCreateFollowerRequest
for the supplied profile id and toFollow id.- Specified by:
createFollowerForProfile
in interfaceFollowerDao
- Parameters:
profileId
- the profile idfollowedProfileId
- the object to insert into the db
-
deleteFollowerForProfile
Description copied from interface:FollowerDao
Deletes the single instance ofCreateFollowerRequest
for the supplied profile id. Throwing aNotFoundException
if the follower does not exist for the supplied profile id.- Specified by:
deleteFollowerForProfile
in interfaceFollowerDao
- Parameters:
profileId
- the id of the logged in profileprofileToUnfollowId
- the id of the profile to unfollow
-
getDatastore
public dev.morphia.Datastore getDatastore() -
setDatastore
@Inject public void setDatastore(dev.morphia.Datastore datastore) -
getMongoDBUtils
-
setMongoDBUtils
-
getDozerMapper
-
setDozerMapper
-
getMongoProfileDao
-
setMongoProfileDao
-