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) voidcreateFollowerForProfile(String profileId, String followedProfileId) Creates a single instance ofCreateFollowerRequestfor the supplied profile id and toFollow id.voiddeleteFollowerForProfile(String profileId, String profileToUnfollowId) Deletes the single instance ofCreateFollowerRequestfor the supplied profile id.dev.morphia.DatastoregetFolloweesForProfile(String profileId, int offset, int count) Fetches all followees for the supplied profile.getFollowerForProfile(String profileId, String followedId) FetchesProfileinstance for the supplied profile id and followed id.getFollowersForProfile(String profileId, int offset, int count) Fetches all followers for the supplied profile.voidsetDatastore(dev.morphia.Datastore datastore) voidsetDozerMapper(MapperRegistry dozerMapperRegistry) voidsetMongoDBUtils(MongoDBUtils mongoDBUtils) voidsetMongoProfileDao(MongoProfileDao mongoProfileDao)
-
Constructor Details
-
MongoFollowerDao
public MongoFollowerDao()
-
-
Method Details
-
getFollowersForProfile
Description copied from interface:FollowerDaoFetches all followers for the supplied profile.- Specified by:
getFollowersForProfilein 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:FollowerDaoFetches all followees for the supplied profile.- Specified by:
getFolloweesForProfilein 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:FollowerDaoFetchesProfileinstance for the supplied profile id and followed id. Throwing aNotFoundExceptionif the follower does not exist for the supplied profile id.- Specified by:
getFollowerForProfilein 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:FollowerDaoCreates a single instance ofCreateFollowerRequestfor the supplied profile id and toFollow id.- Specified by:
createFollowerForProfilein interfaceFollowerDao- Parameters:
profileId- the profile idfollowedProfileId- the object to insert into the db
-
deleteFollowerForProfile
Description copied from interface:FollowerDaoDeletes the single instance ofCreateFollowerRequestfor the supplied profile id. Throwing aNotFoundExceptionif the follower does not exist for the supplied profile id.- Specified by:
deleteFollowerForProfilein 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
-