|
AdventNet Web NMS 4 API Specification | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This is an API interface for configuring devices through Configuration Server.
These APIs can be accessed either through RMI or directly. This interface can be got from
getDeviceConfigurationAPI(String) method in ConfigAPIFactory
//To get DeviceConfigurationAPI instance
ConfigAPIFactory configAPIFactory = (ConfigAPIFactory)Naming.lookup
("rmi://<Host where NMS is running>:<RMIRegistry Port>/ConfigurationAPI");
DeviceConfigurationAPI deviceConfigurationAPI =
configAPIFactory.getDeviceConfigurationAPI("<User Name>");
//For getting hostName in case of Applet Clients
String hostName = <Applet>.getDocumentBase().getHost();
ConfigAPIFactory| Method Summary | |
void |
createTask(java.lang.String taskXML)
Creates a new configuration task. |
void |
deregisterTaskListener(java.lang.String taskName)
Deregisters all the listeners associated with the task. |
void |
executeTask(java.lang.String taskXML)
Starts Configuration for the specified devices. |
java.lang.String |
executeTask(java.lang.String taskXML,
int timeout)
Starts Configuration for the specified devices. |
java.lang.String |
getDeviceConfiguration(java.lang.String taskXML)
Uploads configuration from the device specified. |
java.util.Vector |
getDevices(java.lang.String taskName)
Returns a Vector devices assigned for this task. |
java.util.Vector |
getPendingDevices(java.lang.String taskName)
Returns a Vector of pending devices associated with that task. |
java.util.Vector |
getPendingTasks()
Returns a Vector of pending task names that needs to be executed over pending devices. |
java.lang.String |
getStatus(java.lang.String taskName)
Returns the status of the task. |
java.lang.String |
getStatus(java.lang.String taskName,
java.lang.String device)
Returns the status of a specific device in a task. |
java.lang.String |
getTask(java.lang.String taskName)
Returns the task stored by ConfigServer. |
void |
registerTaskListener(java.lang.String taskName,
ConfigTaskListener listener)
Registers a listener for this task. |
void |
removeTask(java.lang.String taskName)
Removes the task from ConfigServer. |
void |
retainSession()
Retains the Session for a particular user |
void |
terminateSession()
Terminates the session for the particular user |
| Method Detail |
public void createTask(java.lang.String taskXML)
throws ConfigException,
TaskExistsException,
java.rmi.RemoteException,
UserTransactionException
TaskGenerator class can be used to
generate taskXML. This taskXML contains the configuration data for configuring the devices. It throws
TaskExistsException if task with the same name already exists and
attribute overwrite is false in the task XML.taskXML - task in XML.ConfigException - if task is not successfully created.TaskExistsException - if task already exists.ConcurrentModificationException - if ConfigServer is currently executing this task.java.rmi.RemoteException - if any communication related exceptions occur on executing
this remote method call.UserTransactionException - if any DB error occurs on saving the ConfigTask.TaskGenerator
public void executeTask(java.lang.String taskXML)
throws TaskExistsException,
TaskNotFoundException,
ConfigException,
InvalidTaskException,
java.rmi.RemoteException
TaskGenerator class can be used to
generate taskXML. This taskXML contains information for configuring the devices.taskXML - task in XML.TaskExistsException - if task already exists( isOverwrite attribute is false in taskXML).TaskNotFoundException - if task does not exist( isNewTask attribute is false in taskXML).ConfigException - if it fails to execute the task.InvalidTaskException - if taskXML is an invalid one.java.rmi.RemoteException - if any communication related exceptions occur on executing
this remote method call.TaskGenerator
public java.lang.String executeTask(java.lang.String taskXML,
int timeout)
throws TaskExistsException,
TaskNotFoundException,
ConfigException,
InvalidTaskException,
java.rmi.RemoteException
TaskGenerator class can be used to
generate taskXML. This taskXML contains information for configuring the devices. If the task is
not finished within the specified time, ConfigException is thrown but the task continues its
execution in ConfigServer.taskXML - task in XML.timeout - time in milliseconds, if timeout is -1, it waits till the task is over.TaskExistsException - if task already exists( isOverwrite attribute is false in taskXML).TaskNotFoundException - if task does not exist.( isNewTask attribute is false in taskXML).ConfigException - if it fails to execute the task.InvalidTaskException - if taskXML is an invalid one.java.rmi.RemoteException - if any communication related exceptions occur on executing
this remote method call.TaskGenerator,
ConfigResult
public java.lang.String getDeviceConfiguration(java.lang.String taskXML)
throws ConfigException,
TaskNotFoundException,
java.rmi.RemoteException
taskXML - task in XMLTaskNotFoundException - if the requested task is not found.ConfigException - if Upload fails for the device.java.rmi.RemoteException - if any communication related exceptions occur on executing
this remote method call.TaskGenerator
public java.lang.String getTask(java.lang.String taskName)
throws TaskNotFoundException,
java.rmi.RemoteException,
ConfigException,
UserTransactionException
taskName - name of the task to be retrieved.TaskNotFoundException - if task does not exist.ConfigException - if it fails to retrieve the task.java.rmi.RemoteException - if any communication related exceptions occur on executing this remote method call.UserTransactionException - if any DB error occurs on retrieving the ConfigTask.ConfigTask
public java.lang.String getStatus(java.lang.String taskName)
throws java.rmi.RemoteException
taskName - name of the task which is currently under execution.OVER
when all the devices of the specified task has the status either Finished or Failed
INPROGRESS
If the Status is InProgress for atleast a device
NOTSTARTED
If the status is NotStarted for all the devices.
java.rmi.RemoteException - if any communication related exceptions occur on executing
this remote method call.ConfigConstants.OVER,
ConfigConstants.INPROGRESS,
ConfigConstants.NOTSTARTED
public java.lang.String getStatus(java.lang.String taskName,
java.lang.String device)
throws java.rmi.RemoteException
taskName - name of the task to which this device belongs.device - name of the device assigned to this task for configuration.null if there is no such device assigned for the task or
task is not currently under execution.java.rmi.RemoteException - if any communication related exceptions occur on executing
this remote method call.ConfigConstants.FINISHED,
ConfigConstants.FAILED,
ConfigConstants.INPROGRESS,
ConfigConstants.NOTSTARTED
public java.util.Vector getDevices(java.lang.String taskName)
throws java.rmi.RemoteException
taskName - name of the task.java.rmi.RemoteException - if any communication related exceptions occur on executing
this remote method call.Device
public java.util.Vector getPendingDevices(java.lang.String taskName)
throws java.rmi.RemoteException
taskName - name of the task.java.rmi.RemoteException - if any communication related exceptions occur on executing
this remote method call.Device
public java.util.Vector getPendingTasks()
throws java.rmi.RemoteException
java.rmi.RemoteException - if any communication related exceptions occur on executing
this remote method call.
public void removeTask(java.lang.String taskName)
throws ConfigException,
java.rmi.RemoteException,
UserTransactionException
taskName - Specifies the task to be removed.ConfigException - if removal of task fails.ConcurrentModificationException, - if the task is currently in execution by ConfigServer.java.rmi.RemoteException - if any communication related exceptions occur on executing
this remote method call.UserTransactionException - if any error occurs during transaction.
public void retainSession()
throws java.rmi.RemoteException
java.rmi.RemoteException - if any communication related exceptions occur on executing
this remote method call.
public void terminateSession()
throws java.rmi.RemoteException
java.rmi.RemoteException - if any communication related exceptions occur on executing
this remote method call.
public void registerTaskListener(java.lang.String taskName,
ConfigTaskListener listener)
throws java.rmi.RemoteException
taskName - name of the task for which ConfigServer sends the Configuration results.listener - any class implementing ConfigTaskListenerjava.rmi.RemoteException - if any communication related exceptions occur on executing
this remote method call.
public void deregisterTaskListener(java.lang.String taskName)
throws java.rmi.RemoteException
taskName - name of the task for which the listener has to be deregistered.java.rmi.RemoteException - if any communication related exceptions occur on executing
this remote method call.
|
AdventNet Web NMS 4 API Specification | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||