public abstract class InstanceProvider extends Object implements Comparable<InstanceProvider>
| Modifier and Type | Field and Description |
|---|---|
protected List<Instance> |
instances |
protected Integer |
poolSize |
protected Integer |
priority |
protected Integer |
ttl |
| Constructor and Description |
|---|
InstanceProvider() |
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
canCreateInstance()
Indicate if the InstanceProvider can create instances checking poolSize
and running instances List.
|
int |
compareTo(InstanceProvider instanceProvider)
Default implementation of compareTo for the InstanceManager.
|
abstract int |
getActiveCount()
Retrieve the number of RUNNING instances.
|
abstract Instance |
getInstance(String instanceId)
Retrieve a single instance by its id, null if the id is not found.
|
abstract List<Instance> |
getInstances()
Retrieve deployed instances.
|
abstract String |
getName()
Friendly name for this provider.
|
Integer |
getPoolSize() |
Integer |
getPriority() |
abstract Status |
getStatus()
Retrieve the status of this InstanceProvider.
|
Integer |
getTtl()
Return the provider-level time-to-live for default instances.
|
abstract void |
refreshInstancesState()
Refresh the status of the instances.
|
abstract Instance |
restart(String instanceId)
Restart an instance.
|
void |
setPoolSize(Integer poolSize) |
void |
setPriority(Integer priority) |
abstract Instance |
start(String imageName,
List<String> options,
List<String> args)
Start a new instance.
|
abstract void |
stop(String instanceId)
Terminate an instance.
|
protected Integer poolSize
protected Integer ttl
protected Integer priority
public abstract List<Instance> getInstances()
public abstract void refreshInstancesState()
public abstract Instance getInstance(String instanceId)
instanceId - instance id to retrievepublic Integer getPoolSize()
public void setPoolSize(Integer poolSize)
public Integer getPriority()
public void setPriority(Integer priority)
public abstract String getName()
public abstract Instance start(String imageName, List<String> options, List<String> args)
imageName - String representing the kind of instance to launchoptions - List representing the option to use when starting the instanceargs - List representing the args to use when starting the instancepublic abstract void stop(String instanceId)
instanceId - instance id to terminatepublic abstract Instance restart(String instanceId)
instanceId - instance Id to restartpublic abstract Status getStatus()
public abstract boolean canCreateInstance()
public abstract int getActiveCount()
public Integer getTtl()
public int compareTo(InstanceProvider instanceProvider)
compareTo in interface Comparable<InstanceProvider>Copyright © 2015. All rights reserved.