public class VMDefinitionsContainer
extends java.lang.Object
An instance of this class may be obtained from an XML document by calling
parseXMLIntoContainer.
An instance of this class may be translated into an XML document by calling
getAsXML.
Clients may instantiate this class; it is not intended to be subclassed.
| Constructor and Description |
|---|
VMDefinitionsContainer()
Constructs an empty VM container
|
| Modifier and Type | Method and Description |
|---|---|
void |
addVM(IVMInstall vm)
Add the specified VM to the VM definitions managed by this container.
|
void |
addVMList(java.util.List<IVMInstall> vmList)
Add all VM's in the specified list to the VM definitions managed by this container.
|
java.lang.String |
getAsXML()
Return the VM definitions contained in this object as a String of XML.
|
java.lang.String |
getDefaultVMInstallCompositeID()
Returns the composite ID for the default VM.
|
java.lang.String |
getDefaultVMInstallConnectorTypeID()
Return the default VM's connector type ID.
|
IStatus |
getStatus()
Returns status from parsing VM installs or
null if none. |
java.util.List<IVMInstall> |
getValidVMList()
Return a list of all valid VMs in this container.
|
java.util.List<IVMInstall> |
getVMList()
Return a list of all VMs in this container, including any invalid VMs.
|
java.util.Map<IVMInstallType,java.util.List<IVMInstall>> |
getVMTypeToVMMap()
Return a mapping of VM install types to lists of VMs.
|
static VMDefinitionsContainer |
parseXMLIntoContainer(java.io.InputStream inputStream) |
static void |
parseXMLIntoContainer(java.io.InputStream inputStream,
VMDefinitionsContainer container)
Parse the VM definitions contained in the specified InputStream into the
specified container.
|
void |
removeVM(IVMInstall vm)
Removes the VM from this container.
|
void |
setDefaultVMInstallCompositeID(java.lang.String id)
Sets the composite ID for the default VM.
|
void |
setDefaultVMInstallConnectorTypeID(java.lang.String id)
Set the default VM's connector type ID.
|
public VMDefinitionsContainer()
public void addVM(IVMInstall vm)
If distinguishing valid from invalid VMs is important, the specified VM must have already had its install location set. An invalid VM is one whose install location doesn't exist.
vm - the VM to be added to this containerpublic void addVMList(java.util.List<IVMInstall> vmList)
If distinguishing valid from invalid VMs is important, the specified VMs must have already had their install locations set. An invalid VM is one whose install location doesn't exist.
vmList - a list of VMs to be added to this containerpublic java.util.Map<IVMInstallType,java.util.List<IVMInstall>> getVMTypeToVMMap()
IVMInstallType. The values are instances of java.util.List
which contain instances of IVMInstall.public java.util.List<IVMInstall> getVMList()
public java.util.List<IVMInstall> getValidVMList()
public java.lang.String getDefaultVMInstallCompositeID()
public void setDefaultVMInstallCompositeID(java.lang.String id)
id - identifies the new default VM using a composite IDpublic java.lang.String getDefaultVMInstallConnectorTypeID()
public void setDefaultVMInstallConnectorTypeID(java.lang.String id)
id - the new value of the default VM's connector type IDpublic java.lang.String getAsXML()
throws CoreException
The resulting XML is compatible with the static method parseXMLIntoContainer.
CoreException - if serialization of the XML document failedpublic static VMDefinitionsContainer parseXMLIntoContainer(java.io.InputStream inputStream) throws java.io.IOException
java.io.IOExceptionpublic static void parseXMLIntoContainer(java.io.InputStream inputStream,
VMDefinitionsContainer container)
throws java.io.IOException
The VMs in the returned container are instances of VMStandin.
This method has no side-effects. That is, no notifications are sent for VM adds, changes, deletes, and the workbench preferences are not affected.
If the getAsXML method is called on the returned container object,
the resulting XML will be semantically equivalent (though not necessarily syntactically equivalent) as
the XML contained in inputStream.
inputStream - the InputStream containing XML that declares a set of VMs and a default VMcontainer - the container to add the VM definitions tojava.io.IOException - if this method fails. Reasons include:inputStream was badly formattedpublic void removeVM(IVMInstall vm)
vm - VM installpublic IStatus getStatus()
null if none.null