| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_CONFIG_FILE_NAME
Default file name (within the storage directory) in which
CloudPool configuration is stored. |
| Constructor and Description |
|---|
ConfigHandler(CloudPool cloudPool,
String storageDir)
Creates a
ConfigHandler that will store set CloudPool
configurations under a given storage directory with the
DEFAULT_CONFIG_FILE_NAME. |
ConfigHandler(CloudPool cloudPool,
String storageDir,
String configFileName)
Creates a
ConfigHandler that will store set CloudPool
configurations under a given storage directory with a given file name. |
| Modifier and Type | Method and Description |
|---|---|
Path |
getCloudPoolConfigPath()
Returns the file system path where the
ConfigHandler stores
received CloudPool configurations. |
javax.ws.rs.core.Response |
getConfig()
Retrieves the configuration currently set for the
CloudPool. |
javax.ws.rs.core.Response |
setAndStoreConfig(com.google.gson.JsonObject configuration)
Sets the configuration for the
CloudPool. |
void |
storeConfig(com.google.gson.JsonObject configuration)
Stores a configuration in the
storageDir, to allow it to be
restored when the CloudPool is restarted. |
public static final String DEFAULT_CONFIG_FILE_NAME
CloudPool configuration is stored.public ConfigHandler(CloudPool cloudPool, String storageDir)
ConfigHandler that will store set CloudPool
configurations under a given storage directory with the
DEFAULT_CONFIG_FILE_NAME.cloudPool - The back-end CloudPool that is being managed.storageDir - The directory path where runtime state for the
CloudPool is stored. The ConfigHandler will
use this directory to store every set configuration so that it
can be restored on restart. The directory will be created if
it does not exist.public ConfigHandler(CloudPool cloudPool, String storageDir, String configFileName)
ConfigHandler that will store set CloudPool
configurations under a given storage directory with a given file name.cloudPool - The back-end CloudPool that is being managed.storageDir - The directory path where runtime state for the
CloudPool is stored. The ConfigHandler will
use this directory to store every set configuration so that it
can be restored on restart. The directory will be created if
it does not exist.configFileName - The file name, within the storageDir, in which
CloudPool configuration is stored.@GET public javax.ws.rs.core.Response getConfig()
CloudPool.ErrorType message.@POST public javax.ws.rs.core.Response setAndStoreConfig(com.google.gson.JsonObject configuration)
CloudPool.configuration - The (JSON) configuration document to set.ErrorType messageErrorType
messagepublic void storeConfig(com.google.gson.JsonObject configuration)
throws IOException
storageDir, to allow it to be
restored when the CloudPool is restarted.configuration - IOException - If the configuration could not be stored.public Path getCloudPoolConfigPath()
ConfigHandler stores
received CloudPool configurations.storageDir - Copyright © 2011–2016 elastisys. All rights reserved.