| Constructor and Description |
|---|
MachinePool(List<? extends Machine> machines,
org.joda.time.DateTime timestamp)
Constructs a new
MachinePool snapshot. |
| Modifier and Type | Method and Description |
|---|---|
static MachinePool |
emptyPool(org.joda.time.DateTime timestamp)
Factory method for creating an empty machine pool.
|
boolean |
equals(Object obj) |
static MachinePool |
fromJson(String machinePoolAsJson)
Parses a JSON representation of a
MachinePool to its Java
counterpart. |
List<Machine> |
getActiveMachines()
Returns all active
Machines in the pool. |
List<Machine> |
getAllocatedMachines()
Returns all allocated
Machines in the pool. |
List<Machine> |
getMachines()
Returns all
Machines in the pool. |
List<Machine> |
getStartedMachines()
Returns all started
Machines in the pool. |
org.joda.time.DateTime |
getTimestamp()
Returns the time at which the pool observation was made.
|
int |
hashCode() |
com.google.gson.JsonObject |
toJson()
Returns the JSON representation for this
MachinePool. |
String |
toString() |
public MachinePool(List<? extends Machine> machines, org.joda.time.DateTime timestamp)
MachinePool snapshot.machines - The machine instances that were part of the machine pool at
the time of the snapshot.timestamp - The time when this snapshot of the resource pool was taken.public List<Machine> getMachines()
Machines in the pool.
Note: the returned Machines may be in any
MachineState and may include both machines in non-terminal states
(MachineState.REQUESTED, MachineState.PENDING,
MachineState.RUNNING) as well as machines in terminal states (
MachineState.REJECTED, MachineState.TERMINATING,
MachineState.TERMINATED).public List<Machine> getActiveMachines()
Machines in the pool. See
Machine.isActiveMember().public List<Machine> getAllocatedMachines()
Machines in the pool. See
Machine.isAllocated().public List<Machine> getStartedMachines()
Machines in the pool. See
Machine.isStarted().public org.joda.time.DateTime getTimestamp()
public static MachinePool emptyPool(org.joda.time.DateTime timestamp)
timestamp - The timestamp of the machine pool.public static MachinePool fromJson(String machinePoolAsJson) throws IOException
MachinePool to its Java
counterpart. Any failure to parse the JSON representation into a valid
MachinePool instance results in an exception being thrown.machinePoolAsJson - IOExceptionpublic com.google.gson.JsonObject toJson()
MachinePool.JsonObject representation of this MachinePool.Copyright © 2011–2017 Elastisys. All rights reserved.