|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.virtualbox_6_1.IUnknown
org.virtualbox_6_1.ISnapshot
public class ISnapshot
The ISnapshot interface represents a snapshot of the virtual
machine.
Together with the differencing media that are created
when a snapshot is taken, a machine can be brought back to
the exact state it was in when the snapshot was taken.
The ISnapshot interface has no methods, only attributes; snapshots
are controlled through methods of theIMachine
interface
which also manage the media associated with the snapshot.
The following operations exist:
IMachine.takeSnapshot(String,String,Boolean,Holder)
creates a new snapshot
by creating new, empty differencing images for the machine's
media and saving the VM settings and (if the VM is running)
the current VM state in the snapshot.
The differencing images will then receive all data written to
the machine's media, while their parent (base) images
remain unmodified after the snapshot has been taken (seeIMedium
for details about differencing images).
This simplifies restoring a machine to the state of a snapshot:
only the differencing images need to be deleted.
The current machine state is not changed by taking a snapshot
except thatIMachine.getCurrentSnapshot()
is set to
the newly created snapshot, which is also added to the machine's
snapshots tree.IMachine.restoreSnapshot(org.virtualbox_6_1.ISnapshot)
resets a machine to
the state of a previous snapshot by deleting the differencing
image of each of the machine's media and setting the machine's
settings and state to the state that was saved in the snapshot (if any).
This destroys the machine's current state. After calling this,IMachine.getCurrentSnapshot()
points to the snapshot
that was restored.IMachine.deleteSnapshot(String)
deletes a snapshot
without affecting the current machine state.
This does not change the current machine state, but instead frees the
resources allocated when the snapshot was taken: the settings and machine
state file are deleted (if any), and the snapshot's differencing image for
each of the machine's media gets merged with its parent image.
Neither the current machine state nor other snapshots are affected
by this operation, except that parent media will be modified
to contain the disk data associated with the snapshot being deleted.
When deleting the current snapshot, theIMachine.getCurrentSnapshot()
attribute is set to the current snapshot's parent or null if it
has no parent. Otherwise the attribute is unchanged.IMachine
which is available from the snapshot'sgetMachine()
attribute. When restoring the snapshot, these
settings are copied back to the original machine.
In addition, if the machine was running when the
snapshot was taken (IMachine.getState()
isMachineState.Running
),
the current VM state is saved in the snapshot (similarly to what happens
when a VM's state is saved). The snapshot is then said to beonlinebecause when restoring it, the VM will be running.
If the machine was inMachineState.Saved
saved,
the snapshot receives a copy of the execution state file
(IMachine.getStateFilePath()
).
Otherwise, if the machine was not running (MachineState.PoweredOff
orMachineState.Aborted
), the snapshot isoffline;
it then contains a so-called "zero execution state", representing a
machine that is powered off.
Interface ID: {6CC49055-DAD4-4496-85CF-3F76BCB3B5FA}
Field Summary |
---|
Fields inherited from class org.virtualbox_6_1.IUnknown |
---|
obj, objMgr, port |
Constructor Summary | |
---|---|
ISnapshot(java.lang.String wrapped,
org.virtualbox_6_1.ObjectRefManager objMgr,
org.virtualbox_6_1.jaxws.VboxPortType port)
|
Method Summary | |
---|---|
java.util.List<ISnapshot> |
getChildren()
Child snapshots (all snapshots having this one as a parent). |
java.lang.Long |
getChildrenCount()
Returns the number of direct children of this snapshot. |
java.lang.String |
getDescription()
Optional description of the snapshot. |
java.lang.String |
getId()
UUID of the snapshot. |
IMachine |
getMachine()
Virtual machine this snapshot is taken on. |
java.lang.String |
getName()
Short name of the snapshot. |
java.lang.Boolean |
getOnline()
true if this snapshot is an online snapshot and false otherwise. |
ISnapshot |
getParent()
Parent snapshot (a snapshot this one is based on), or null if the snapshot has no parent (i.e. |
java.lang.Long |
getTimeStamp()
Timestamp of the snapshot, in milliseconds since 1970-01-01 UTC. |
static ISnapshot |
queryInterface(IUnknown obj)
|
void |
setDescription(java.lang.String value)
Optional description of the snapshot. |
void |
setName(java.lang.String value)
Short name of the snapshot. |
Methods inherited from class org.virtualbox_6_1.IUnknown |
---|
getObjMgr, getRemoteWSPort, getWrapped, releaseRemote |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ISnapshot(java.lang.String wrapped, org.virtualbox_6_1.ObjectRefManager objMgr, org.virtualbox_6_1.jaxws.VboxPortType port)
Method Detail |
---|
public java.lang.String getId()
public java.lang.String getName()
IMachine.saveSettings()
to
be called implicitly.
public void setName(java.lang.String value)
IMachine.saveSettings()
to
be called implicitly.
value
- Stringpublic java.lang.String getDescription()
IMachine.saveSettings()
to
be called implicitly.
public void setDescription(java.lang.String value)
IMachine.saveSettings()
to
be called implicitly.
value
- Stringpublic java.lang.Long getTimeStamp()
public java.lang.Boolean getOnline()
IMachine.getStateFilePath()
attribute of thegetMachine()
object associated with this snapshot
will point to the saved state file. Otherwise, it will be
an empty string.
public IMachine getMachine()
public ISnapshot getParent()
public java.util.List<ISnapshot> getChildren()
IMachine.findSnapshot(String)
with a null UUID), a machine's snapshots tree can be iterated over.
public java.lang.Long getChildrenCount()
public static ISnapshot queryInterface(IUnknown obj)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |