public class RatingRepository extends DepotRepository
DepotRepository.CacheStrategy| Constructor and Description |
|---|
RatingRepository(PersistenceContext ctx)
Initialize the
RatingRepository. |
| Modifier and Type | Method and Description |
|---|---|
void |
deletePercentile(int gameId,
int gameMode)
Deletes the percentile record for the specified game and game mode.
|
void |
deleteRating(int gameId,
int playerId)
Deletes the specified rating record.
|
Collection<RatingRecord> |
getMostRecentRatings(Collection<Integer> playerIds,
Collection<Integer> gameIds,
int gameIdSign)
Load the most recently entered rating for each of a collection of players.
|
Collection<RatingRecord> |
getMostRecentRatings(Collection<Integer> playerIds,
int gameIdSign)
Load the most recently entered rating for each of a collection of players.
|
RatingRecord |
getRating(int gameId,
int playerId)
Loads the rating for the given player for the given game and returns it as a
RatingRecord object, or null if the player has no previous rating for the game. |
List<RatingRecord> |
getRatings(int gameId,
Integer... players)
Fetch the ratings registered for any of the given players for the given game and return
them as a list of
RatingRecord objects. |
List<RatingRecord> |
getRatings(int playerId,
long since,
int count)
Fetch and return all the registered
RatingRecord rows for the given player. |
List<RatingRecord> |
getTopRatings(int gameId,
int limit,
long since,
Set<Integer> playerIds)
Returns the top-ratings for the specified game.
|
Percentiler |
loadPercentile(int gameId,
int gameMode)
Loads the percentile distribution associated with the specified game and mode.
|
Map<Integer,Percentiler> |
loadPercentiles(int gameId)
Loads all the percentile distributions associated with the specified game.
|
void |
purgeGame(int gameId)
Deletes all rating and percentile records for the specified game.
|
void |
purgePlayers(Collection<Integer> playerIds)
Deletes all rating records for the specified players.
|
void |
setRating(int gameId,
int playerId,
int rating,
int experience)
Set the rating and experience for a given player and game.
|
void |
updatePercentile(int gameId,
int gameMode,
Percentiler tiler)
Writes the supplied percentiler's data out to the database.
|
ctx, delete, delete, deleteAll, deleteAll, deleteAll, deleteAll, findAll, findAll, findAll, findAll, findAllKeys, findAllKeys, from, insert, load, load, load, load, loadAll, loadAll, registerMigration, store, update, update, update, updatePartial, updatePartial, updatePartial, updatePartial, updatePartial@Inject public RatingRepository(PersistenceContext ctx)
RatingRepository.public RatingRecord getRating(int gameId, int playerId)
RatingRecord object, or null if the player has no previous rating for the game.public List<RatingRecord> getRatings(int gameId, Integer... players)
RatingRecord objects. The size of this list is no less than zero
and no greater than the number of given players.public List<RatingRecord> getRatings(int playerId, long since, int count)
RatingRecord rows for the given player. Ratings
will be returned in order of most recently to least recently updated.since - ratings last updated more than this number of milliseconds in the past will be
ommitted from the result list. Supplying -1 will return all ratings regardless of age.count - the maximum number of ratings to return or -1 for all ratings.public List<RatingRecord> getTopRatings(int gameId, int limit, long since, Set<Integer> playerIds)
since - an absolute number of milliseconds (ie. 10*24*60*60*1000L). Players that have
not updated their rating within this many milliseconds in the past will be omitted from the
results. Supply zero to omit this filter.playerIds - an optional list of player ids to which to limit the top-rankings search.public void setRating(int gameId,
int playerId,
int rating,
int experience)
public void deleteRating(int gameId,
int playerId)
public Percentiler loadPercentile(int gameId, int gameMode)
public Map<Integer,Percentiler> loadPercentiles(int gameId)
public void updatePercentile(int gameId,
int gameMode,
Percentiler tiler)
public void deletePercentile(int gameId,
int gameMode)
public void purgeGame(int gameId)
public void purgePlayers(Collection<Integer> playerIds)
public Collection<RatingRecord> getMostRecentRatings(Collection<Integer> playerIds, int gameIdSign)
gameIdSign - if non-zero, limits the search to game ids of matching signpublic Collection<RatingRecord> getMostRecentRatings(Collection<Integer> playerIds, Collection<Integer> gameIds, int gameIdSign)
gameIds - if not null, limits the search to the specific game idsgameIdSign - if non-zero, limits the search to game ids of matching signCopyright © 2015. All rights reserved.