|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.samskivert.depot.DepotRepository
com.threerings.stats.server.persist.StatRepository
public class StatRepository
Responsible for the persistent storage of per-player statistics.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.samskivert.depot.DepotRepository |
|---|
DepotRepository.CacheStrategy |
| Constructor Summary | |
|---|---|
StatRepository(PersistenceContext context)
Constructs a new statistics repository with the specified persistence context. |
|
| Method Summary | ||
|---|---|---|
void |
clearMapping(Stat.Type type,
String value)
This is only used for testing. |
|
void |
deleteStats(int playerId)
Deletes all stats associated with the specified player. |
|
String |
getCodeString(Stat.Type type,
int code)
Maps the specified unique code back to its string value. |
|
int |
getStringCode(Stat.Type type,
String value)
Maps the specified string to a unique integer value. |
|
ArrayList<Stat> |
loadStats(int playerId)
Loads the stats associated with the specified player. |
|
void |
purgePlayers(Collection<Integer> playerIds)
Deletes all data associated with the supplied players. |
|
|
updateStat(int playerId,
StatModifier<T> modifier)
Applies a modification to a single stat. |
|
void |
writeModified(int playerId,
Iterable<Stat> stats)
Writes out any of the stats in the supplied iterable that have been modified since they were first loaded. |
|
void |
writeModified(int playerId,
Stat[] stats)
Writes out any of the stats in the supplied array that have been modified since they were first loaded. |
|
| Methods inherited from class com.samskivert.depot.DepotRepository |
|---|
delete, delete, deleteAll, deleteAll, findAll, findAll, findAll, findAll, findAllKeys, findAllKeys, from, insert, load, load, load, load, loadAll, loadAll, store, update, update, updatePartial, updatePartial, updatePartial, updatePartial, updatePartial |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
@Inject public StatRepository(PersistenceContext context)
| Method Detail |
|---|
public <T extends Stat> T updateStat(int playerId,
StatModifier<T> modifier)
Stat.Type.newStat().
public ArrayList<Stat> loadStats(int playerId)
public void deleteStats(int playerId)
public void writeModified(int playerId,
Stat[] stats)
public void writeModified(int playerId,
Iterable<Stat> stats)
public int getStringCode(Stat.Type type,
String value)
Stat.AuxDataSource
getStringCode in interface Stat.AuxDataSource
public String getCodeString(Stat.Type type,
int code)
Stat.AuxDataSource
getCodeString in interface Stat.AuxDataSource
public void clearMapping(Stat.Type type,
String value)
public void purgePlayers(Collection<Integer> playerIds)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||