java.lang.Object
com.adventure.services.BucketStorageService
- All Implemented Interfaces:
StorageService
Class that implements storage service based on AWS S3 bucket.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
config
Application properties. -
logger
protected static final org.apache.logging.log4j.Logger loggerLogger.
-
-
Constructor Details
-
BucketStorageService
Constructor- Parameters:
config
- Application config.
-
-
Method Details
-
listGames
Description copied from interface:StorageService
Lists available games.- Returns:
- A list of unique string identifiers of available games.
- Throws:
GameStorageException
- If error occur while listing the games.
-
saveGame
Description copied from interface:StorageService
Saves a game.- Parameters:
game
- Game to save.- Throws:
GameStorageException
- If an error occurs while saving the game.
-
loadGame
Description copied from interface:StorageService
Loads a game.- Parameters:
gameId
- Unique identifier of the game to load.- Returns:
- An instance of the loaded game.
- Throws:
GameStorageException
- If an error occurs while loading the provided game.
-
deleteGame
Description copied from interface:StorageService
Deletes a game.- Parameters:
gameId
- Unique identifier of the game to delete.- Throws:
GameStorageException
- If some error occur while deleting the specified game.
-
newGame
Description copied from interface:StorageService
Creates a new game.- Specified by:
newGame
in interfaceStorageService
- Parameters:
playerName
- The name of the player for the new game.- Returns:
- An instance of the new game.
-