|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This specifies the interface for saving and restoring games.
Method Summary | |
void |
cleanup()
Perform any necessary clean up before normal shutdown of the server. |
void |
delete(PersistedGame game)
Delete a game in permanent storage. |
void |
deleteTemporaryState(PersistedGame game)
Delete a game in temporary storage. |
PersistedGame |
getSavedPersistedGame(String name)
|
PersistedGame |
getTemporaryPersistedGame(String name)
|
PersistedGame[] |
listPermanentGames()
Return an array of all games in permanent storage. |
PersistedGame[] |
listTemporaryGames()
Return an array of all games in temporary storage. |
boolean |
permanentStateExists(GameId id)
|
boolean |
permanentStateExists(PersistedGame game)
Return true if the permanent state exists. |
Controller |
restore(GameId id)
Restore a game from permanent storage. |
Controller |
restoreMostRecentTemporaryState(Color color)
Restore the most recent game in temporary storage to the latest saved state. |
Controller |
restoreTemporaryState(GameId id)
Restore a game from temporary storage to the latest saved state. |
Controller |
restoreTemporaryState(GameId id,
int number)
Restore a game from temporary storage to the given move number. |
void |
save(PersistedGame game)
Save the game to permanent storage. |
void |
saveTemporaryGame(GameId black,
GameId white)
|
void |
saveTemporaryState(GameId id,
Controller c,
int move)
Save the game to temporary storage. |
boolean |
temporaryStateExists(GameId id)
|
boolean |
temporaryStateExists(GameId id,
int move)
Return true if the temporary state exists for a given move. |
boolean |
temporaryStateExists(PersistedGame game)
Return true if the temporary state exists. |
void |
writeLastGameInformation(GameId black,
GameId white)
|
Method Detail |
public void delete(PersistedGame game) throws PermissionsException, NoSuchDataException, InternalErrorException
game
- The game to delete.
PermissionsException
- Thrown if the game cannot be deleted.
NoSuchDataException
- Thrown if the game does not exist.
InternalErrorException
- Thrown if the operation fails for any reason.public void deleteTemporaryState(PersistedGame game) throws PermissionsException, NoSuchDataException, InternalErrorException
game
- The game to delete.
PermissionsException
- Thrown if the game cannot be deleted.
NoSuchDataException
- Thrown if the game does not exist.
InternalErrorException
- Thrown if the operation fails for any reason.public Controller restore(GameId id) throws NoSuchDataException, InternalErrorException
id
- The id of the game.
NoSuchDataException
- Thrown if the game does not exist.
InternalErrorException
- Thrown if the operation fails for any reason.public Controller restoreTemporaryState(GameId id, int number) throws NoSuchDataException, InternalErrorException
id
- The id of the game.number
- The move number to restore to.
NoSuchDataException
- Thrown if the game does not exist.
InternalErrorException
- Thrown if the operation fails for any reason.public Controller restoreTemporaryState(GameId id) throws NoSuchDataException, InternalErrorException
id
- The id of the game.
NoSuchDataException
- Thrown if the game does not exist.
InternalErrorException
- Thrown if the operation fails for any reason.public Controller restoreMostRecentTemporaryState(Color color) throws NoSuchDataException, InternalErrorException
color
- The color of the player to restore.
NoSuchDataException
- Thrown if the game does not exist.
InternalErrorException
- Thrown if the operation fails for any reason.public void save(PersistedGame game) throws DataAlreadyExistsException, InternalErrorException
game
- The game to be saved.
DataAlreadyExistsException
- Thrown if the new id already exists.
InternalErrorException
- Thrown if the operation fails for any reason.public void saveTemporaryState(GameId id, Controller c, int move) throws InternalErrorException
id
- The game id.c
- The controller.
NoSuchDataException
- Thrown if the game does not exist.
InternalErrorException
- Thrown if the operation fails for any reason.public void saveTemporaryGame(GameId black, GameId white) throws InternalErrorException
InternalErrorException
public boolean temporaryStateExists(PersistedGame game) throws InternalErrorException
game
- The game being checked.
InternalErrorException
- Thrown if the operation fails for any reason.public boolean temporaryStateExists(GameId id) throws InternalErrorException
InternalErrorException
public boolean permanentStateExists(PersistedGame game) throws InternalErrorException
game
- The game being checked.
InternalErrorException
- Thrown if the operation fails for any reason.public boolean permanentStateExists(GameId id) throws InternalErrorException
InternalErrorException
public boolean temporaryStateExists(GameId id, int move) throws InternalErrorException
id
- The game being checked.move
- The move of the game being checked.
InternalErrorException
- Thrown if the operation fails for any reason.public PersistedGame[] listTemporaryGames() throws InternalErrorException
InternalErrorException
- Thrown if the operation fails for any reason.public PersistedGame[] listPermanentGames() throws InternalErrorException
InternalErrorException
- Thrown if the operation fails for any reason.public PersistedGame getTemporaryPersistedGame(String name) throws NoSuchDataException, InternalErrorException
NoSuchDataException
InternalErrorException
public PersistedGame getSavedPersistedGame(String name) throws NoSuchDataException, InternalErrorException
NoSuchDataException
InternalErrorException
public void writeLastGameInformation(GameId black, GameId white)
public void cleanup() throws InternalErrorException
InternalErrorException
- Thrown if the operation fails for any reason.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |