public class VirtualInstance extends BaseDomainHelper
Server that contains additional
information about the guest.
This class maps to the RHN.RhnVirtualInstance table. The schema for the
RhnVirtualInstance supports guests of guests; however guests of guests is not
being implemented in the RHN 500 release.| Modifier | Constructor and Description |
|---|---|
|
VirtualInstance()
Default constructor
|
protected |
VirtualInstance(java.lang.Long instanceId)
This constructor is for testing only.
|
| Modifier and Type | Method and Description |
|---|---|
GuestAndNonVirtHostView |
asGuestAndNonVirtHostView()
An adapter method that transforms the virtual instance into a view.
|
boolean |
equals(java.lang.Object object)
Two virtual instancess are considered equal when they share the same
UUID.
|
java.lang.Long |
getConfirmed() |
Server |
getGuestSystem()
When the virtual instance is registered, this method returns a Server
corresponding to the guest that this virtual instance represents.
|
Server |
getHostSystem()
Returns a guest's parent or host system.
|
java.lang.Long |
getId()
Return the database identifier, the primary key.
|
java.lang.String |
getName()
Returns the name of the virtual instance.
|
java.lang.Integer |
getNumberOfCPUs()
Returns the number of CPUs allocated to the virtual instance.
|
VirtualInstanceState |
getState()
Returns the state of the virtual instance.
|
java.lang.Long |
getTotalMemory()
Returns the total memory in KB allocated to the virtual instance.
|
VirtualInstanceType |
getType()
Returns the virtualization type for this instance.
|
java.lang.String |
getUuid()
Return the system's UUID.
|
int |
hashCode() |
boolean |
isRegisteredGuest()
Returns
true if this virtual instance represents a
registered guest. |
void |
setConfirmed(java.lang.Long isConfirmed) |
void |
setGuestSystem(Server system)
Sets the Server corresponding to the guest represented by this virtual
instance.
|
void |
setHostSystem(Server system)
Sets the parent/host for this guest.
|
void |
setName(java.lang.String name)
Set the name of the virtual instance.
|
void |
setNumberOfCPUs(java.lang.Integer number)
Sets the number of CPUs allocated to the virtual instance.
|
void |
setState(VirtualInstanceState state)
Sets the state of the virtual instance.
|
void |
setTotalMemory(java.lang.Long memory)
Sets the total memory in KB allocated to the virtual instance.
|
void |
setType(VirtualInstanceType type)
Sets the virtualization type for this instance.
|
void |
setUuid(java.lang.String newUuid) |
java.lang.String |
toString() |
getCreated, getModified, setCreated, setModifiedpublic VirtualInstance()
protected VirtualInstance(java.lang.Long instanceId)
instanceId - The unique id to assign to the guestpublic java.lang.Long getId()
public java.lang.String getUuid()
public void setUuid(java.lang.String newUuid)
newUuid - The new UUIDpublic java.lang.Long getConfirmed()
public void setConfirmed(java.lang.Long isConfirmed)
isConfirmed - longpublic Server getGuestSystem()
null is returnedpublic void setGuestSystem(Server system)
system - the guest systempublic Server getHostSystem()
public void setHostSystem(Server system)
system - The host systempublic boolean isRegisteredGuest()
true if this virtual instance represents a
registered guest.true if this virtual instance represents a
registered guest, false otherwise.public java.lang.String getName()
public void setName(java.lang.String name)
name - The new namepublic java.lang.Long getTotalMemory()
public void setTotalMemory(java.lang.Long memory)
memory - The total memory in KBpublic java.lang.Integer getNumberOfCPUs()
public void setNumberOfCPUs(java.lang.Integer number)
number - The number of CPUspublic VirtualInstanceType getType()
public void setType(VirtualInstanceType type)
type - The new virtualization typepublic VirtualInstanceState getState()
public void setState(VirtualInstanceState state)
state - The new statepublic boolean equals(java.lang.Object object)
equals in class java.lang.Objectobject - The object to test againsttrue if object is a VirtualInstance
and has the same uuid as this VirtualInstance, false
otherwise.public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class BaseDomainHelperpublic GuestAndNonVirtHostView asGuestAndNonVirtHostView()