|
AdventNet Web NMS 4 API Specification | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This API defines the methods for configuring Event Parsers. This has necessary
methods to add EventParsers like setEventParser(Properties p) and
setEventParsers(Properties[] array,boolean deleteOldParsers).
Existing EventParsers can be deleted using methods like
deleteEventParser(String name) and deleteAllEventParsers().
This API has necessary method to enable and disable EventParsers.
enableParsers(String[] parserNames,boolean flag) can be used for this purpose.
This API is accessible either through RMI or directly from the same JVM. When RMI is enabled, i.e. by running RMI registry before starting NMS server, EventParserAPI can be accessed remotely via RMI.
The following code snippet can be used to get EventParserAPI handle in secured and authenticated mode through RMI. In this mode, NMS needs userName and password to provide EventParserAPI handle.
try
{
RMIAccessAPI rmiapi = (RMIAccessAPI)Naming.lookup("//hostName/RMIAccessAPI");
EventParserAPI api = (EventParserAPI)rmiapi.getAPI("userName","password","EventParserAPI");
}
catch(Exception ee)
{
System.out.println("Error while getting EventParserAPI handle");
ee.printStackTrace();
}
The following code snippet can be used to get EventParserAPI handle through RMI, when RMI security mechanism of NMS is disabled.
try
{
EventParserAPI api = (EventParserAPI)Naming.lookup("//hostName/EventParserAPI");
}
catch(Exception ee)
{
System.out.println("Error in getting EventParserAPI handle");
ee.printStackTrace();
}
For the same JVM as that of WebNMS server,
com.adventnet.nms.util.NmsUtil#getAPI(EventParserAPI) can be used to get
EventParserAPI handle.
| Method Summary | |
void |
deleteAllEventParsers()
To delete all the event parsers in the server. |
boolean |
deleteEventParser(java.lang.String name)
To delete an event parser in the server with the given name. |
void |
enableParsers(java.lang.String[] parserNames,
boolean bool)
To enable or disable Event Parsers specified by the parameter 'parserNames'. |
java.util.Properties[] |
getEventParsersFromFile(java.lang.String file)
To get all the event parsers from the file. |
boolean |
saveEventParsersToFile(java.util.Properties[] props,
java.lang.String file)
To save a set of event parsers to a file. |
boolean |
setEventParser(java.util.Properties prop)
To set an Event Parser to the server. |
boolean |
setEventParsers(java.util.Properties[] props,
boolean deleteOldParsers)
To set more than one event parser at a time on the server. |
| Method Detail |
public boolean setEventParser(java.util.Properties prop)
throws java.rmi.RemoteException,
NmsStorageException,
FaultException
prop - the properties to be set to the event parser.java.rmi.RemoteException - if request fails in remote machineNmsStorageException - if any error occurs while storing the EventParserFaultException - wrapper for all other module level errorsEventParser
public boolean setEventParsers(java.util.Properties[] props,
boolean deleteOldParsers)
throws java.rmi.RemoteException,
NmsStorageException,
FaultException
props - The array of Properties objects. Each Properties object
corressponds to one event parser.deleteOldParsers - Whether to delete the existing event parsers or
retain them.java.rmi.RemoteException - if request fails in remote machineNmsStorageException - if any error occurs while storing the EventParsersFaultException - wrapper for all other module level errorsEventParser
public boolean deleteEventParser(java.lang.String name)
throws java.rmi.RemoteException,
NmsStorageException,
FaultException
name - the name of the event parser.java.rmi.RemoteException - if request fails in remote machineNmsStorageException - if any error occurs while storing the changesFaultException - wrapper for all other module level errors
public void deleteAllEventParsers()
throws java.rmi.RemoteException
java.rmi.RemoteException -
public java.util.Properties[] getEventParsersFromFile(java.lang.String file)
throws java.rmi.RemoteException,
FaultException
file - the name of the file.java.rmi.RemoteException - if request fails in remote machineFaultException - wrapper for all other module level errorssaveEventParsersToFile(Properties[],String)
public boolean saveEventParsersToFile(java.util.Properties[] props,
java.lang.String file)
throws java.rmi.RemoteException,
NmsStorageException,
FaultException
props - the Properties objects representing the event parsersfile - the name of the filejava.rmi.RemoteException - if request fails in remote machineNmsStorageException - if any error occurs while storing the EventParsersFaultException - wrapper for all other module level errorsEventParser
public void enableParsers(java.lang.String[] parserNames,
boolean bool)
throws java.rmi.RemoteException,
NmsStorageException,
FaultException
parserNames - - String [] containing Event Parser names.bool - - boolean 'true' sets the Event Parsers enabled and 'false' sets disabled.java.rmi.RemoteException - if request fails in remote machineNmsStorageException - if error occurs while storing the changesFaultException - wrapper for all other module level errors
|
AdventNet Web NMS 4 API Specification | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||