Class MongoRankDao
java.lang.Object
dev.getelements.elements.dao.mongo.MongoRankDao
- All Implemented Interfaces:
RankDao
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondev.morphia.aggregation.Aggregation<?> aggregateScoresForMutualFollowers(MongoProfile mongoProfile, MongoLeaderboard mongoLeaderboard, long leaderboardEpoch) dev.morphia.DatastoregetRanks(String leaderboardNameOrId, int offset, int count, long leaderboardEpoch, Function<dev.morphia.query.Query<MongoScore>, dev.morphia.query.Query<MongoScore>> queryTransformer) getRanksForFriends(String leaderboardNameOrId, String profileId, int offset, int count, long leaderboardEpoch) Given theLeaderboardname or ID, this will return allRankinstances sorted in order.getRanksForFriendsRelative(String leaderboardNameOrId, String profileId, int offset, int count, long leaderboardEpoch) Given theLeaderboardname or ID, this will return allRankinstances sorted in order.getRanksForGlobal(String leaderboardNameOrId, int offset, int count, long leaderboardEpoch) Given theLeaderboardname or ID, this will return allRankinstances sorted in order.getRanksForGlobalRelative(String leaderboardNameOrId, String profileId, int offset, int count, long leaderboardEpoch) Given theLeaderboardname or ID, this will return allRankinstances sorted in order.getRanksForGlobalTabular(String leaderboardNameOrId, long leaderboardEpoch) Gets the ranks for a leaderboard as a tabulation.getRanksForMutualFollowers(String leaderboardNameOrId, String profileId, int offset, int count, long leaderboardEpoch) Given theLeaderboardname or ID, this will return allRankinstances sorted in order.getRanksForMutualFollowersRelative(String leaderboardNameOrId, String profileId, int offset, int count, long leaderboardEpoch) Given theLeaderboardname or ID, this will return allRankinstances sorted in order.getRanksRelative(String leaderboardNameOrId, MongoProfile mongoProfile, int offset, int count, long leaderboardEpoch, Function<dev.morphia.query.Query<MongoScore>, dev.morphia.query.Query<MongoScore>> queryTransformer, Function<dev.morphia.query.Query<MongoScore>, dev.morphia.query.Query<MongoScore>> countQueryTransformer) voidsetDatastore(dev.morphia.Datastore datastore) voidsetDozerMapper(MapperRegistry dozerMapperRegistry) voidsetMongoDBUtils(MongoDBUtils mongoDBUtils) voidsetMongoFollowerDao(MongoFollowerDao mongoFollowerDao) voidsetMongoFriendDao(MongoFriendDao mongoFriendDao) voidsetMongoLeaderboardDao(MongoLeaderboardDao mongoLeaderboardDao) voidsetMongoProfileDao(MongoProfileDao mongoProfileDao)
-
Constructor Details
-
MongoRankDao
public MongoRankDao()
-
-
Method Details
-
getRanksForGlobal
public Pagination<Rank> getRanksForGlobal(String leaderboardNameOrId, int offset, int count, long leaderboardEpoch) Description copied from interface:RankDaoGiven theLeaderboardname or ID, this will return allRankinstances sorted in order.- Specified by:
getRanksForGlobalin interfaceRankDao- Parameters:
leaderboardNameOrId- the value ofLeaderboard.getId()orLeaderboard.getName()offset- the offset in the datasetcount- the number of results to returnleaderboardEpoch- the epoch timestamp- Returns:
- a
Pagination<Rank>containing all ranks
-
getRanksForGlobalRelative
public Pagination<Rank> getRanksForGlobalRelative(String leaderboardNameOrId, String profileId, int offset, int count, long leaderboardEpoch) Description copied from interface:RankDaoGiven theLeaderboardname or ID, this will return allRankinstances sorted in order. This allows the the result set to be skipped forward to make the suppliedProfileappear in= the result set.- Specified by:
getRanksForGlobalRelativein interfaceRankDao- Parameters:
leaderboardNameOrId- the value ofLeaderboard.getId()orLeaderboard.getName()profileId- the value ofProfile.getId()count- the number of results to returnleaderboardEpoch- the epoch timestamp- Returns:
- a
Pagination<Rank>containing all ranks
-
getRanksForFriends
public Pagination<Rank> getRanksForFriends(String leaderboardNameOrId, String profileId, int offset, int count, long leaderboardEpoch) Description copied from interface:RankDaoGiven theLeaderboardname or ID, this will return allRankinstances sorted in order. This allows the the result set to be skipped forward to make the suppliedProfileappear int the result set.- Specified by:
getRanksForFriendsin interfaceRankDao- Parameters:
leaderboardNameOrId- the value ofLeaderboard.getId()orLeaderboard.getName()profileId- the value ofProfile.getId()offset- the offset in the dataset, may be negativecount- the number of results to returnleaderboardEpoch- the epoch timestamp- Returns:
- a
Pagination<Rank>containing all ranks
-
getRanksForFriendsRelative
public Pagination<Rank> getRanksForFriendsRelative(String leaderboardNameOrId, String profileId, int offset, int count, long leaderboardEpoch) Description copied from interface:RankDaoGiven theLeaderboardname or ID, this will return allRankinstances sorted in order. This allows the the result set to be skipped forward to make the suppliedProfileappear int the result set.Additionally this will filter the results to only include friends of the supplied
Profile.- Specified by:
getRanksForFriendsRelativein interfaceRankDao- Parameters:
leaderboardNameOrId- the value ofLeaderboard.getId()orLeaderboard.getName()profileId- the value ofProfile.getId()offset- the offset in the dataset, may be negativecount- the number of results to return @return aPagination<Rank>containing all ranksleaderboardEpoch- the epoch timestamp
-
getRanksForMutualFollowers
public Pagination<Rank> getRanksForMutualFollowers(String leaderboardNameOrId, String profileId, int offset, int count, long leaderboardEpoch) Description copied from interface:RankDaoGiven theLeaderboardname or ID, this will return allRankinstances sorted in order. This allows the the result set to be skipped forward to make the suppliedProfileappear int the result set.- Specified by:
getRanksForMutualFollowersin interfaceRankDao- Parameters:
leaderboardNameOrId- the value ofLeaderboard.getId()orLeaderboard.getName()profileId- the value ofProfile.getId()offset- the offset in the dataset, may be negativecount- the number of results to returnleaderboardEpoch- the epoch timestamp- Returns:
- a
Pagination<Rank>containing all ranks
-
getRanksForMutualFollowersRelative
public Pagination<Rank> getRanksForMutualFollowersRelative(String leaderboardNameOrId, String profileId, int offset, int count, long leaderboardEpoch) Description copied from interface:RankDaoGiven theLeaderboardname or ID, this will return allRankinstances sorted in order. This allows the the result set to be skipped forward to make the suppliedProfileappear int the result set.Additionally this will filter the results to only include friends of the supplied
Profile.- Specified by:
getRanksForMutualFollowersRelativein interfaceRankDao- Parameters:
leaderboardNameOrId- the value ofLeaderboard.getId()orLeaderboard.getName()profileId- the value ofProfile.getId()offset- the offset in the dataset, may be negativecount- the number of results to return @return aPagination<Rank>containing all ranksleaderboardEpoch- the epoch timestamp
-
getRanksForGlobalTabular
public Tabulation<RankRow> getRanksForGlobalTabular(String leaderboardNameOrId, long leaderboardEpoch) Description copied from interface:RankDaoGets the ranks for a leaderboard as a tabulation.- Specified by:
getRanksForGlobalTabularin interfaceRankDao- Parameters:
leaderboardNameOrId- the value ofLeaderboard.getId()orLeaderboard.getName()leaderboardEpoch- the epoch timestamp- Returns:
- the tabular
-
aggregateScoresForMutualFollowers
public dev.morphia.aggregation.Aggregation<?> aggregateScoresForMutualFollowers(MongoProfile mongoProfile, MongoLeaderboard mongoLeaderboard, long leaderboardEpoch) -
getRanks
public Pagination<Rank> getRanks(String leaderboardNameOrId, int offset, int count, long leaderboardEpoch, Function<dev.morphia.query.Query<MongoScore>, dev.morphia.query.Query<MongoScore>> queryTransformer) -
getRanksRelative
public Pagination<Rank> getRanksRelative(String leaderboardNameOrId, MongoProfile mongoProfile, int offset, int count, long leaderboardEpoch, Function<dev.morphia.query.Query<MongoScore>, dev.morphia.query.Query<MongoScore>> queryTransformer, Function<dev.morphia.query.Query<MongoScore>, dev.morphia.query.Query<MongoScore>> countQueryTransformer) -
getDatastore
public dev.morphia.Datastore getDatastore() -
setDatastore
@Inject public void setDatastore(dev.morphia.Datastore datastore) -
getMongoProfileDao
-
setMongoProfileDao
-
getMongoLeaderboardDao
-
setMongoLeaderboardDao
-
getMongoDBUtils
-
setMongoDBUtils
-
getDozerMapper
-
setDozerMapper
-
getMongoFriendDao
-
setMongoFriendDao
-
getMongoFollowerDao
-
setMongoFollowerDao
-