|
"WEBNMS_5 API Docs" | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.adventnet.management.config.xml.BaseElement
com.adventnet.management.config.xml.ConfigTask
public class ConfigTask
This class holds configuration data that has to be applied over a set of Network Elements. Configuration data are represented in the form of Attributes. Once a task is created , it can be reused for configuring different set of devices latter. Tasks of same or different protocols can also be combined and can be executed over a set of devices at a strech.This class holds configuration data in XML and its corresponding DTD is present in <Web NMS Home>/configtasks/Task.dtd. Task XML can be generated using TaskGenerator class. ConfigServer also supports template based tasks. These tasks contain placeholders ( instead of having static data ) which will be replaced at the time of executing the task.DataSources need to be associated for executing template tasks.DataSources define the rules for getting the data for template tasks.
Task XML
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Example SNMP ConfigTask for configuring snmp attributes of a remote host. -->
<ConfigTask taskName="SystemGroupConfiguration"
description="This task is used for configuring the snmp attributes of a
remote host."
isNewTask="true"
isOverwrite="true"
sSequential="false" >
<!-- Protocol used for configuration ie.,
SNMP protocol is specified here. -->
<ProtocolMap name="snmp" />
<!-- SNMP attribute sysContact of the remote
host is set to test1. -->
<Attribute identifier="1.4.0" type="4"
label="sysContact" value="sysAdmin"/>
<!-- SNMP attribute sysLocation of the remote
host is set to test2. -->
<Attribute identifier="1.6.0" type="4"
label="sysLocation" value="AdventNet"/>
</ConfigTask>
Task XML - Combined Task
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Example Task that Combines two SubTasks.
-->
<ConfigTask taskName="combinedTask"
version="1.0"
combinedTask="true"
isOverwrite="true"
isSequential="false"
rollbackNeeded="false"
isNewTask="true">
<!-- SubTasks and its DeviceList Mapping -->
<DeviceTaskMap
taskName="FileTransfer">
</DeviceTaskMap>
<DeviceTaskMap
taskName="SystemGroupConfiguration">
</DeviceTaskMap>
</ConfigTask>
TaskGenerator,
SnmpTaskGenerator,
Serialized Form| Field Summary |
|---|
| Fields inherited from class com.adventnet.management.config.xml.BaseElement |
|---|
element, isServer |
| Constructor Summary | |
|---|---|
ConfigTask()
Creates a ConfigTask by initializing an empty Element of name "ConfigTask". |
|
ConfigTask(org.w3c.dom.Element element)
Creates a ConfigTask from this element. |
|
ConfigTask(java.lang.String xmlString)
Creates a ConfigTask from the XML String. |
|
| Method Summary | |
|---|---|
Attribute[] |
getConfigAttributes()
Returns the attributes defined for this task.If the task is a combinedtask, then it returns null. |
java.lang.String |
getDescription()
Returns the detailed description about the task. |
DeviceList[] |
getDeviceList()
Returns the DeviceList array defined for this ConfigTask. |
Device[] |
getDevices()
Returns the devices associated for this task. |
java.lang.String |
getProtocol()
Returns the name of the protocol for this task.If the task is a combined task , it returns null. |
java.lang.String |
getRollbackDocument()
Returns the name of the rollback document. |
int |
getRollbackType()
Returns the type of rollback for the task ,which can be either CurrentConfiguration or RollbackDocument. |
java.util.Vector |
getSubDeviceList()
Returns the Vector of DeviceList array for CombinedTasks. |
java.util.Vector |
getSubDevices()
Returns the Vector of Device array for CombinedTasks. |
java.lang.String[] |
getSubTaskNames()
Returns an array of subtasks present in a CombinedTask. |
java.lang.String |
getTaskName()
Returns the name of the ConfigTask. |
java.lang.String |
getVersion()
Returns the version of the task. |
boolean |
isCombinedTask()
Returns whether the task is a CombinedTask or Single Task. |
boolean |
isPersistence()
Returns whether the task is a persistence one or not. |
boolean |
isRollbackNeeded()
Returns whether rollback is required or not for the task. |
boolean |
isTemplate()
Returns true for template based tasks. |
java.lang.String |
toString()
Returns the ConfigTask in XML format by transforming the ConfigTask Element. |
| Methods inherited from class com.adventnet.management.config.xml.BaseElement |
|---|
addSubTag, getAttribute, getElement, getProperties, getSubTagsByName, hasAttribute, removeSubTagsByName, setAttribute, setProperties |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ConfigTask(org.w3c.dom.Element element)
throws InvalidTemplateException
element - element containing ConfigTask as the root element.
InvalidTemplateException - if the element is null or element's tag name is not equal to ConfigTask.
public ConfigTask()
throws InvalidTemplateException
InvalidTemplateException - if any exception araises in creating the Element.
public ConfigTask(java.lang.String xmlString)
throws InvalidTemplateException
xmlString - a String represents the task XML.
InvalidTemplateException - if string is an invalid XML.| Method Detail |
|---|
public boolean isCombinedTask()
public java.lang.String getRollbackDocument()
public boolean isRollbackNeeded()
public int getRollbackType()
public java.lang.String getTaskName()
public Attribute[] getConfigAttributes()
Attribute[] value.public java.lang.String getProtocol()
public java.lang.String getVersion()
public Device[] getDevices()
Device[] valuepublic DeviceList[] getDeviceList()
DeviceList[] valuepublic java.util.Vector getSubDeviceList()
public java.lang.String[] getSubTaskNames()
public java.util.Vector getSubDevices()
public boolean isTemplate()
public java.lang.String getDescription()
public boolean isPersistence()
public java.lang.String toString()
toString in class BaseElement
|
"WEBNMS_5 API Docs" | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||