Methods Summary |
---|
public java.lang.String | addEntry(java.lang.String archiveName, java.lang.String descriptorName)Add an entry and return an id for that entry
entryList.add(new Entry(archiveName, descriptorName));
String entryId = "entry_";
int count = entryList.size();
if (count < 100)
entryId += "0";
if (count < 10)
entryId += "0";
return entryId + count;
|
public java.lang.String | getDeploymentName()
return deploymentName;
|
public org.dom4j.Document | getDocument()
Document document = DocumentHelper.createDocument();
Element root = document.addElement("jboss-deployment-plan");
root.addElement("deployment-name").addText(deploymentName);
root.addComment("Note, deployment-entry elements are not used by the DeploymentManager");
root.addComment("The DeploymentManager relies on the the entry nameing convention");
Iterator it = entryList.iterator();
while (it.hasNext())
{
Entry entry = (Entry)it.next();
Element element = root.addElement("deployment-entry");
element.addElement("archive-name").addText(entry.archiveName);
element.addElement("descriptor-name").addText(entry.descriptorName);
}
return document;
|
public java.util.List | getEntryList()
return new ArrayList(entryList);
|
public boolean | hasEntry(java.lang.String archiveName, java.lang.String descriptorName)
return entryList.contains(new Entry(archiveName, descriptorName));
|
private void | init(org.dom4j.Document document)
Element root = document.getRootElement();
deploymentName = root.elementTextTrim("deployment-name");
Iterator it = root.elementIterator("deployment-entry");
while (it.hasNext())
{
Element element = (Element)it.next();
String archiveName = element.elementTextTrim("archive-name");
String descriptorName = element.elementTextTrim("descriptor-name");
addEntry(archiveName, descriptorName);
}
|
public void | setDeploymentName(java.lang.String deploymentName)
this.deploymentName = deploymentName;
|
public java.lang.String | toXMLString()
try
{
OutputFormat format = OutputFormat.createPrettyPrint();
StringWriter strWriter = new StringWriter(1024);
XMLWriter metaWriter = new XMLWriter(strWriter, format);
metaWriter.write(getDocument());
metaWriter.close();
return strWriter.toString();
}
catch (IOException e)
{
log.error("Cannot get XML string", e);
return null;
}
|