Class MongoRankDao

java.lang.Object
dev.getelements.elements.dao.mongo.MongoRankDao
All Implemented Interfaces:
RankDao

public class MongoRankDao extends Object implements RankDao
  • Constructor Details

    • MongoRankDao

      public MongoRankDao()
  • Method Details

    • getRanksForGlobal

      public Pagination<Rank> getRanksForGlobal(String leaderboardNameOrId, int offset, int count, long leaderboardEpoch)
      Description copied from interface: RankDao
      Given the Leaderboard name or ID, this will return all Rank instances sorted in order.
      Specified by:
      getRanksForGlobal in interface RankDao
      Parameters:
      leaderboardNameOrId - the value of Leaderboard.getId() or Leaderboard.getName()
      offset - the offset in the dataset
      count - the number of results to return
      leaderboardEpoch - 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: RankDao
      Given the Leaderboard name or ID, this will return all Rank instances sorted in order. This allows the the result set to be skipped forward to make the supplied Profile appear in= the result set.
      Specified by:
      getRanksForGlobalRelative in interface RankDao
      Parameters:
      leaderboardNameOrId - the value of Leaderboard.getId() or Leaderboard.getName()
      profileId - the value of Profile.getId()
      count - the number of results to return
      leaderboardEpoch - 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: RankDao
      Given the Leaderboard name or ID, this will return all Rank instances sorted in order. This allows the the result set to be skipped forward to make the supplied Profile appear int the result set.
      Specified by:
      getRanksForFriends in interface RankDao
      Parameters:
      leaderboardNameOrId - the value of Leaderboard.getId() or Leaderboard.getName()
      profileId - the value of Profile.getId()
      offset - the offset in the dataset, may be negative
      count - the number of results to return
      leaderboardEpoch - 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: RankDao
      Given the Leaderboard name or ID, this will return all Rank instances sorted in order. This allows the the result set to be skipped forward to make the supplied Profile appear int the result set.

      Additionally this will filter the results to only include friends of the supplied Profile.

      Specified by:
      getRanksForFriendsRelative in interface RankDao
      Parameters:
      leaderboardNameOrId - the value of Leaderboard.getId() or Leaderboard.getName()
      profileId - the value of Profile.getId()
      offset - the offset in the dataset, may be negative
      count - the number of results to return @return a Pagination<Rank> containing all ranks
      leaderboardEpoch - the epoch timestamp
    • getRanksForMutualFollowers

      public Pagination<Rank> getRanksForMutualFollowers(String leaderboardNameOrId, String profileId, int offset, int count, long leaderboardEpoch)
      Description copied from interface: RankDao
      Given the Leaderboard name or ID, this will return all Rank instances sorted in order. This allows the the result set to be skipped forward to make the supplied Profile appear int the result set.
      Specified by:
      getRanksForMutualFollowers in interface RankDao
      Parameters:
      leaderboardNameOrId - the value of Leaderboard.getId() or Leaderboard.getName()
      profileId - the value of Profile.getId()
      offset - the offset in the dataset, may be negative
      count - the number of results to return
      leaderboardEpoch - 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: RankDao
      Given the Leaderboard name or ID, this will return all Rank instances sorted in order. This allows the the result set to be skipped forward to make the supplied Profile appear int the result set.

      Additionally this will filter the results to only include friends of the supplied Profile.

      Specified by:
      getRanksForMutualFollowersRelative in interface RankDao
      Parameters:
      leaderboardNameOrId - the value of Leaderboard.getId() or Leaderboard.getName()
      profileId - the value of Profile.getId()
      offset - the offset in the dataset, may be negative
      count - the number of results to return @return a Pagination<Rank> containing all ranks
      leaderboardEpoch - the epoch timestamp
    • getRanksForGlobalTabular

      public Tabulation<RankRow> getRanksForGlobalTabular(String leaderboardNameOrId, long leaderboardEpoch)
      Description copied from interface: RankDao
      Gets the ranks for a leaderboard as a tabulation.
      Specified by:
      getRanksForGlobalTabular in interface RankDao
      Parameters:
      leaderboardNameOrId - the value of Leaderboard.getId() or Leaderboard.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

      public MongoProfileDao getMongoProfileDao()
    • setMongoProfileDao

      @Inject public void setMongoProfileDao(MongoProfileDao mongoProfileDao)
    • getMongoLeaderboardDao

      public MongoLeaderboardDao getMongoLeaderboardDao()
    • setMongoLeaderboardDao

      @Inject public void setMongoLeaderboardDao(MongoLeaderboardDao mongoLeaderboardDao)
    • getMongoDBUtils

      public MongoDBUtils getMongoDBUtils()
    • setMongoDBUtils

      @Inject public void setMongoDBUtils(MongoDBUtils mongoDBUtils)
    • getDozerMapper

      public MapperRegistry getDozerMapper()
    • setDozerMapper

      @Inject public void setDozerMapper(MapperRegistry dozerMapperRegistry)
    • getMongoFriendDao

      public MongoFriendDao getMongoFriendDao()
    • setMongoFriendDao

      @Inject public void setMongoFriendDao(MongoFriendDao mongoFriendDao)
    • getMongoFollowerDao

      public MongoFollowerDao getMongoFollowerDao()
    • setMongoFollowerDao

      @Inject public void setMongoFollowerDao(MongoFollowerDao mongoFollowerDao)