public interface ModulesService
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCurrentInstanceId()
Get the id of the current instance.
|
java.lang.String |
getCurrentModule()
Get the name of the current module.
|
java.lang.String |
getCurrentVersion()
Get the name of the current version.
|
java.lang.String |
getDefaultVersion(java.lang.String module)
Returns the name of the default version for the module.
|
java.lang.String |
getInstanceHostname(java.lang.String module,
java.lang.String version,
java.lang.String instance)
Returns a host name to use for the given module, version and instance.
|
java.util.Set<java.lang.String> |
getModules()
Get the set of modules that are available to the application.
|
int |
getNumInstances(java.lang.String module,
java.lang.String version)
Returns the number of instances that are available to the given
manual scaling module version.
|
java.lang.String |
getVersionHostname(java.lang.String module,
java.lang.String version)
Returns a host name to use for the given module and version.
|
java.util.Set<java.lang.String> |
getVersions(java.lang.String module)
Returns the set of versions that are available to the given module.
|
void |
setNumInstances(java.lang.String module,
java.lang.String version,
long instances)
Set the number of instances that are available to the given manual
scaling module version.
|
java.util.concurrent.Future<java.lang.Void> |
setNumInstancesAsync(java.lang.String module,
java.lang.String version,
long instances)
Starts an asynchronous call to
setNumInstances(java.lang.String, java.lang.String, long) and returns a Future to obtain
its eventual result. |
void |
startVersion(java.lang.String module,
java.lang.String version)
Starts the given manual scaling or basic scaling module version.
|
java.util.concurrent.Future<java.lang.Void> |
startVersionAsync(java.lang.String module,
java.lang.String version)
Starts an asynchronous call to
startVersion(java.lang.String, java.lang.String) and returns a Future to obtain its
eventual result. |
void |
stopVersion(java.lang.String module,
java.lang.String version)
Stops the given manual scaling or basic scaling module version.
|
java.util.concurrent.Future<java.lang.Void> |
stopVersionAsync(java.lang.String module,
java.lang.String version)
Starts an asynchronous call to
stopVersion(java.lang.String, java.lang.String) and returns a Future to obtain its
eventual result. |
java.lang.String getCurrentModule()
java.lang.String getCurrentVersion()
java.lang.String getCurrentInstanceId()
java.util.Set<java.lang.String> getModules()
ModulesException
- when ModulesService
fails to perform the requested operation.java.util.Set<java.lang.String> getVersions(java.lang.String module)
module
- the name of the module or null for the current moduleModulesException
- when ModulesService
fails to perform the requested operation.java.lang.String getDefaultVersion(java.lang.String module)
module
- the name of the module or null for the current moduleModulesException
- when ModulesService
fails to perform the requested operation.int getNumInstances(java.lang.String module, java.lang.String version)
module
- the name of the module or null for the current moduleversion
- the name of the version or null for the current versionModulesException
- when ModulesService
fails to perform the requested operation.void setNumInstances(java.lang.String module, java.lang.String version, long instances)
module
- the name of the module or null for the current moduleversion
- the name of the version or null for the current versioninstances
- the number of instances to setModulesException
- when the requested number of instances
is not supported or ModulesService
fails to perform the requested
operation for some other reason.java.util.concurrent.Future<java.lang.Void> setNumInstancesAsync(java.lang.String module, java.lang.String version, long instances)
setNumInstances(java.lang.String, java.lang.String, long)
and returns a Future
to obtain
its eventual result. When the returned Future
yields a successful result
ModulesService
will have successfully initiated the process of setting the number of
instances. There may be some delay before added instances start serving or removed instances
stop serving.void startVersion(java.lang.String module, java.lang.String version)
module
- the name of the moduleversion
- the name of the versionModulesException
- when ModulesService
fails to perform the requested operation.java.util.concurrent.Future<java.lang.Void> startVersionAsync(java.lang.String module, java.lang.String version)
startVersion(java.lang.String, java.lang.String)
and returns a Future
to obtain its
eventual result. When the returned Future
yields a successful result
ModulesService
will have successfully initiated the process of starting the requested
version. There may be some delay before the version starts serving.void stopVersion(java.lang.String module, java.lang.String version)
module
- the name of the module or null for the current moduleversion
- the name of the version or null for the current versionModulesException
- when ModulesService
fails to perform the requested operation.java.util.concurrent.Future<java.lang.Void> stopVersionAsync(java.lang.String module, java.lang.String version)
stopVersion(java.lang.String, java.lang.String)
and returns a Future
to obtain its
eventual result. When the returned Future
yields a successful result
ModulesService
will have successfully initiated the process of stopping the requested
version. There may be some delay before the version stops serving.java.lang.String getVersionHostname(java.lang.String module, java.lang.String version)
module
- the name of the module or null to indicate the current moduleversion
- the name of the version or null to indicate the current versionModulesException
- when ModulesService
fails to perform the requested operation.java.lang.String getInstanceHostname(java.lang.String module, java.lang.String version, java.lang.String instance)
module
- the name of the module or null to indicate the current moduleversion
- the name of the version or null to indicate the current versioninstance
- the id of a particular instance to addressModulesException
- when ModulesService
fails to perform the requested operation.