com.ace.moab.api.vm
Class VM

java.lang.Object
  extended by com.ace.moab.api.vm.VM
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<VM>

public class VM
extends java.lang.Object
implements java.lang.Comparable<VM>, java.io.Serializable

This class represents a virtual machine.

Virtual machines need to have an ID will typically report an OS, and have a list of operating systems that it can be converted to.

The rack and slot information for the VM corresponds to the node index and the VM index in that node.

Author:
Brady Kimball
See Also:
Serialized Form

Constructor Summary
VM(java.lang.String id)
          Initializes a new VM with the specified unique ID.
 
Method Summary
 void addFlag(VMFlag flag)
          Adds a flag associated with this VM
 int compareTo(VM o)
           
 int getDisk()
          Returns the amount of configured disk space in MB.
 java.util.Set<VMFlag> getFlags()
          Gets the flags associated with this VM.
 java.lang.String getId()
          Returns the unique identifier for the VM.
 java.lang.String getJobId()
          Gets the id of the job associated with this VM.
 int getMemory()
          Returns the amount of memory configured in MB.
 java.lang.String getNodeId()
          Returns the ID of the physical node that the VM is on.
 int getNodeIndex()
          Returns the index of the node that the VM belongs to.
 java.lang.String getOs()
          Returns the current operating system of the VM.
 java.util.Set<java.lang.String> getOsList()
          Returns the list of potential operating systems that the VM could be turned into.
 int getProcessors()
          Returns the number of virtual processors in the VM.
 int getSlot()
          Returns the slot of the VM inside a given node.
 NodeState getState()
          Returns the state of the VM.
 java.lang.String getSubstate()
          Returns the substate that will give more information about the status of the VM.
 void setDisk(int disk)
          Sets the amount of configured disk space in MB.
 void setFlags(java.util.Set<VMFlag> flags)
          Sets the flags associated with this VM.
 void setId(java.lang.String id)
          Sets the unique identifier for the VM.
 void setJobId(java.lang.String jobId)
          Sets the id of the job associated with this VM.
 void setMemory(int memory)
          Sets the amount of configured memory in MB.
 void setNodeId(java.lang.String nodeId)
          Sets the ID of the physical node that the VM is on.
 void setNodeIndex(int nodeIndex)
          Sets the index of the node that the VM belongs to.
 void setOs(java.lang.String os)
          Sets the current operating system of the VM.
 void setOsList(java.util.Set<java.lang.String> osList)
          Sets the list of potential operating systems that the VM could be turned into.
 void setProcessors(int processors)
          Sets the number of virtual processors in the VM.
 void setSlot(int slot)
          Sets the slot of the VM inside a given node.
 void setState(NodeState state)
          Sets the state of the VM.
 void setSubstate(java.lang.String substate)
          Sets the substate that will give more information about the status of the VM.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VM

public VM(java.lang.String id)
Initializes a new VM with the specified unique ID.

Parameters:
id - the unique ID of the VM.
Method Detail

getDisk

public int getDisk()
Returns the amount of configured disk space in MB.

Returns:
the amount of configured disk space in MB.

getId

public java.lang.String getId()
Returns the unique identifier for the VM.

Returns:
the unique identifier for the VM.

getMemory

public int getMemory()
Returns the amount of memory configured in MB.

Returns:
the amount of memory configured in MB.

getNodeId

public java.lang.String getNodeId()
Returns the ID of the physical node that the VM is on.

Returns:
the ID of the physical node that the VM is on.

getNodeIndex

public int getNodeIndex()
Returns the index of the node that the VM belongs to.

Returns:
the index of the node that the VM belongs to.

getOs

public java.lang.String getOs()
Returns the current operating system of the VM.

Returns:
the current operating system of the VM.

getOsList

public java.util.Set<java.lang.String> getOsList()
Returns the list of potential operating systems that the VM could be turned into.

Returns:
the list of potential operating systems that the VM could be turned into.

getProcessors

public int getProcessors()
Returns the number of virtual processors in the VM.

Returns:
the number of virtual processors in the VM.

getSlot

public int getSlot()
Returns the slot of the VM inside a given node.

Returns:
the slot of the VM inside a given node.

getState

public NodeState getState()
Returns the state of the VM.

Returns:
the state of the VM.

getSubstate

public java.lang.String getSubstate()
Returns the substate that will give more information about the status of the VM.

Returns:
the substate that will give more information about the status of the VM.

setDisk

public void setDisk(int disk)
Sets the amount of configured disk space in MB.

Parameters:
disk - the amount of configured disk space in MB.

setId

public void setId(java.lang.String id)
Sets the unique identifier for the VM.

Parameters:
id - the unique identifier for the VM.

setMemory

public void setMemory(int memory)
Sets the amount of configured memory in MB.

Parameters:
memory - the amount of memory configured in MB.

setNodeId

public void setNodeId(java.lang.String nodeId)
Sets the ID of the physical node that the VM is on.

Parameters:
nodeId - the ID of the physical node that the VM is on.

setNodeIndex

public void setNodeIndex(int nodeIndex)
Sets the index of the node that the VM belongs to.

Parameters:
nodeIndex - the index of the node that the VM belongs to.

setOs

public void setOs(java.lang.String os)
Sets the current operating system of the VM.

Parameters:
os - the current operating system of the VM.

setOsList

public void setOsList(java.util.Set<java.lang.String> osList)
Sets the list of potential operating systems that the VM could be turned into.

Parameters:
osList - the list of potential operating systems that the VM could be turned into.

setProcessors

public void setProcessors(int processors)
Sets the number of virtual processors in the VM.

Parameters:
processors - the number of virtual processors in the VM.

setSlot

public void setSlot(int slot)
Sets the slot of the VM inside a given node.

Parameters:
slot - the slot of the VM inside a given node.

setState

public void setState(NodeState state)
Sets the state of the VM.

Parameters:
state - the state of the VM.

setSubstate

public void setSubstate(java.lang.String substate)
Sets the substate that will give more information about the status of the VM.

Parameters:
substate - the substate that will give more information about the status of the VM.

setJobId

public void setJobId(java.lang.String jobId)
Sets the id of the job associated with this VM.

Parameters:
jobId - the id of the job associated with this VM.

getJobId

public java.lang.String getJobId()
Gets the id of the job associated with this VM.

Returns:
the id of the job associated with this VM.

setFlags

public void setFlags(java.util.Set<VMFlag> flags)
Sets the flags associated with this VM.

Parameters:
flags - the flags associated with this VM

getFlags

public java.util.Set<VMFlag> getFlags()
Gets the flags associated with this VM. Can return null.

Returns:
the flags associated with this VM

addFlag

public void addFlag(VMFlag flag)
Adds a flag associated with this VM

Parameters:
flag - a flag associated with this VM

compareTo

public int compareTo(VM o)
Specified by:
compareTo in interface java.lang.Comparable<VM>

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2001-2009 Cluster Resources, Inc. All Rights Reserved.