AdventNet Web NMS 4 API Specification

com.adventnet.nms.eventdb
Interface TrapAPI

All Superinterfaces:
CommonModuleAPI, java.rmi.Remote

public interface TrapAPI
extends CommonModuleAPI, java.rmi.Remote

TrapAPI deals with configuration of Trap filters as well as Trap parsers. It also has necessary methods to enable and disable Trap filters and parsers. It has methods for saving and retriving Trap parsers and filters from flat files. It also deals with registering and deregistering of Trap listeners.

The following code snippet can be used to get TrapAPI handle in secured and authenticated mode through RMI. In this mode, NMS needs userName and password to provide the API handle.

 
 try
 {
    RMIAccessAPI rmiapi = (RMIAccessAPI)Naming.lookup("//hostName/RMIAccessAPI");
    TrapAPI api = (TrapAPI)rmiapi.getAPI("userName","password","TrapAPI");
 }
 catch(Exception ee)
 {
     System.out.println("Error in getting TrapAPI handle");
     ee.printStackTrace();
 }
 
 

The following code snippet can be used to get TrapAPI handle through RMI, without RMI security mechanism of NMS.

 
 try
 {
     TrapAPI api = (TrapAPI)Naming.lookup("//hostName/TrapAPI");
 }
 catch(Exception ee)
 {
    System.out.println("Error in getting TrapAPI handle");
    ee.printStackTrace();
 }
 
 

For the same JVM as that of WebNMS server, com.adventnet.nms.NmsUtil#getAPI(String) can be used to get TrapAPI handle.

See Also:
TrapParser, TrapFilter, TrapFilterHolder, SocketListener, RMIAccessAPI

Field Summary
static int VERSION_1
          Constant for Snmp v1 traps.
static int VERSION_2C
          Constant for Snmpv2c traps.
 
Method Summary
 boolean deleteAllTrapFilters()
          To delete all the Trap Filters configured in the server.
 boolean deleteAllTrapParsers()
          To delete all the Trap Parsers configured in the server.
 boolean deleteTrapParsers(java.lang.String[] names)
          To delete a set of Trap parsers, whose names are given in String[].
 void deRegister(SocketListener trapListener)
          To deregister the given TrapListener from Trap notification for all registered ports.
 void deRegisterForTrap(int port, SocketListener trapListener)
          To deregister TrapListener from notification for Traps on particular port.
 void deRegisterForTraps(int[] portArray)
          To deregister from getting notified by NMS for Traps on multiple ports to which the NMS is registered.
 void deRegisterForTraps(int[] portArray, SocketListener trapListener)
          To deregister from getting notified by NMS for Traps on multiple ports.
 boolean disableTrapsForGroups(java.lang.String[] groups, boolean deleteOldGroups)
          To disable traps for a set of groups i.e.
 boolean disableTrapsForNodes(java.lang.String[] nodes, boolean deleteOldNodes)
          To disable traps for a set of nodes i.e.
 void enableFilters(java.lang.String[] filterNames, boolean bool)
          To enable or disable Trap Filters specified by their names.
 void enableParsers(java.lang.String[] parserNames, boolean bool)
          To enable or disable Trap Parsers specified by the parameter 'parserNames'.
 boolean enableTrapsForGroups(java.lang.String[] groups)
          To enable traps for groups which were disabled previously.
 boolean enableTrapsForNodes(java.lang.String[] nodes)
          To enable traps for nodes which have been disabled previously.
 TrapFilterHolder[] getAllTrapFilters()
          To get all the Trap Filters configured in the server.
 TrapParser[] getAllTrapParsers()
          Gets all the Trap Parsers that are configured in the server.
 java.lang.String[] getGroupsDisabledForTraps()
          To get the names of the groups for which traps have been disabled.
 java.lang.String[] getNodesDisabledForTraps()
          To get the names of the nodes for which traps have been disabled.
 TrapFilterHolder[] getTrapFiltersFromFile(java.lang.String file)
          Gets the Trap Filters from a file.
 TrapParser[] getTrapParsers(java.lang.String[] names)
          To get Trap Parsers, with given names.
 TrapParser[] getTrapParsersFromFile(java.lang.String file)
          Gets the Trap Parsers from a file.
 TrapParser[] getTrapParsersFromMib(java.lang.String mib)
          Gets the trap parsers from a mib.
 void registerForTrap(int port, SocketListener trapListener)
          To register for Trap notification for some specific 'port'.
 void registerForTraps(int[] portArray)
          To register for notification for Traps on multiple ports.
 void registerForTraps(int[] portArray, SocketListener trapListener)
          To register for notification for Traps on multiple ports.
 boolean saveTrapFiltersToFile(TrapFilterHolder[] tf, java.lang.String file)
          To save a set of Trap Filters in a file.
 boolean saveTrapParsersToFile(TrapParser[] tp, java.lang.String file)
          To save a set of Trap Parsers in a file.
 void setEnableReceiveTraps(boolean flag)
          To enable NMS to receive Traps, set the flag to true and to stop receiving traps set the flag to false.
 boolean setTrapFilter(TrapFilterHolder tf, boolean saveToFile)
          To set a Trap Filter in the server.
 boolean setTrapFilters(TrapFilterHolder[] tf, boolean deleteOldFilters, boolean saveToFile)
          To set an array of Trap Filters in the server.
 boolean setTrapParser(TrapParser tp)
          To add/replace a Trap parser in the server.
 boolean setTrapParsers(TrapParser[] tp, boolean deleteOldParsers)
          To set an array of trap parsers in the server.
 

Field Detail

VERSION_1

public static final int VERSION_1
Constant for Snmp v1 traps. Users can identity the version of the trap using this constant.

VERSION_2C

public static final int VERSION_2C
Constant for Snmpv2c traps. User can identify the version of trap using this constant.
Method Detail

setTrapParser

public boolean setTrapParser(TrapParser tp)
                      throws java.rmi.RemoteException,
                             NmsStorageException,
                             FaultException
To add/replace a Trap parser in the server. The 'name' field in Trap Parser object is the key field of Trap Parsers. If any Trap Parser is already there in WebNMS server with the same name, then that Trap Parser will be replaced by the latest Trap Parser. If no Trap Parsers are there in WebNMS server with the same name, then an new Trap Parser will be added. After instantiating, use TrapParser.setProperties(Properties) to set the properties of Trap Parser. This method automatically saves the Trap Parser in the default configuration file trap.parsers which presents under WebNMS/conf directory.
Parameters:
tp - Trap parser object which has to be added/replaced in the server.
Returns:
true when Trap Parser is applied suuccessfully, false when any exception occurs while adding/replacing Trap Parser or while adding/updating Trap Parser in database.
Throws:
java.rmi.RemoteException - if request fails in remote machine
NmsStorageException - if any error occurs while storing TrapParsers
FaultException - wrapper for all other module level errors
See Also:
TrapParser, getAllTrapParsers(), getTrapParsers(String[])

setTrapParsers

public boolean setTrapParsers(TrapParser[] tp,
                              boolean deleteOldParsers)
                       throws java.rmi.RemoteException,
                              NmsStorageException,
                              FaultException
To set an array of trap parsers in the server. Functionalwise, this method is similar to that of previous method, except the argument, which is TrapParser[] here. If the given boolean value is true, it deletes the existing Trap Parsers and adds new TrapParsers. If the given boolean value is false, for each and every Trap Parser it checks the name, and it any Trap Parser is exists with the same name, then that old Trap Parser will be replaced by the latest one. Like previous method, it automatically saves the Trap Parsers in trap.parsers file.
Parameters:
tp - Array of Trap Parser objects.
deleteOldParsers - Whether to discard the already existing parsers or not. If it is true,then existing Trap Parsers will be deleted. It it is false, existing Trap Parsers will not be deleted.
Returns:
true when all Trap Parsers are applied successfully, false when any exception occurs while adding/replacing Trap Parsers or while adding/updating Trap Parsers in data base.
Throws:
java.rmi.RemoteException - if request fails in remote machine
NmsStorageException - if any error occurs while storing TrapParsers
FaultException - wrapper for all other module level errors
See Also:
TrapParser, getAllTrapParsers(), getTrapParsers(String[])

getTrapParsers

public TrapParser[] getTrapParsers(java.lang.String[] names)
                            throws java.rmi.RemoteException,
                                   FaultException
To get Trap Parsers, with given names. This method returns Trap Parsers in the form of Trap Parser array, with names specified in names array. Users should note there is a chance of getting difference in the length of two array. For example name array contains 5 elements, in which 3 are valid Trap Parser names(i.e WebNMS is having Trap Parsers with those names) and 2 are invalid Trap Parser names. Then this method will return a Trap Parser array with length 3. This method simply returns Trap Parsers with the specified names i.e it won't see whether that Trap Parser is enabled or disabled. User has to explicitely check using TrapParser.getEnable() method.
Parameters:
names - An array of names of trap parsers.
Returns:
An array of TrapParser objects whose names are matches with the given names. It returns null, if null is the argument. If all the names specified in the argument array are invalid, then this method returns an Trap Parser[] of length zero.
Throws:
java.rmi.RemoteException - if request fails in remote machine
FaultException - wrapper for all other module level errors
See Also:
TrapParser, setTrapParser(TrapParser), getAllTrapParsers()

getAllTrapParsers

public TrapParser[] getAllTrapParsers()
                               throws java.rmi.RemoteException
Gets all the Trap Parsers that are configured in the server. This method simply returns all Trap Parsers. i.e it won't see whether Trap Parsers are enabled or disabled. User has to explicitely check using TrapParser.getEnable() method.
Returns:
An array of TrapParser objects.
Throws:
java.rmi.RemoteException - if request fails in remote machine
See Also:
TrapParser, getTrapParsers(String[]), setTrapParser(TrapParser)

getTrapParsersFromFile

public TrapParser[] getTrapParsersFromFile(java.lang.String file)
                                    throws java.rmi.RemoteException,
                                           FaultException
Gets the Trap Parsers from a file. This method will return TrapParser[] only when fully qualified file name(i.e absolute name of the file) is given. Like above methods, this method simply returns all Trap Parsers from the specified file. i.e it won't see whether Trap Parser is enabled or not. User has to explicitely check using TrapParser.getEnable() method.
Parameters:
file - The fully qualified name( i.e absolute name) of the file.
Returns:
An array of TrapParser objects. This method returns 'null' if any error occurs in opening or parsing the given file.
Throws:
java.rmi.RemoteException - if request fails in remote machine
FaultException - wrapper for all other module level errors
See Also:
TrapParser, setTrapParser(TrapParser), saveTrapParsersToFile(TrapParser[],String)

getTrapParsersFromMib

public TrapParser[] getTrapParsersFromMib(java.lang.String mib)
                                   throws java.rmi.RemoteException,
                                          FaultException
Gets the trap parsers from a mib. This method return TrapParser[] only when fully qualified path of mib file is given. If any trap is specified in the given mib, then from that trap's properties TrapParser object is constructed. User should note, by default TrapParser will be in enabled condition. This method returns 'null' when no trap is specified in the given mib.
Parameters:
mib - The fully qualified name of the mib file.
Returns:
An array of TrapParser objects. This method returns 'null' if any error occurs in opening or parsing the given mid also it returns 'null' while no trap is specified in given mib.
Throws:
java.rmi.RemoteException - if request fails in remote machine
FaultException - wrapper for all module level errors
See Also:
TrapParser, getTrapParsersFromFile(String), setTrapParser(TrapParser)

saveTrapParsersToFile

public boolean saveTrapParsersToFile(TrapParser[] tp,
                                     java.lang.String file)
                              throws java.rmi.RemoteException,
                                     NmsStorageException,
                                     FaultException
To save a set of Trap Parsers in a file. If complete path is not given, then the given Trap Parsers are stored in a file by name as given and the corresponding file will be placed under WebNMSHome directory.
Parameters:
tp - An array of TrapParser objects to be saved.
file - The full path name or simple name of the file.
Returns:
true if all parsers are successfully stored in the given file, false if error occurs while opening or writing in that file.
Throws:
java.rmi.RemoteException - if request fails in remote machine
NmsStorageException - if any error occurs while storing TrapParsers
FaultException - wrapper for all other module level errors
See Also:
getTrapParsersFromFile(String)

deleteTrapParsers

public boolean deleteTrapParsers(java.lang.String[] names)
                          throws java.rmi.RemoteException,
                                 NmsStorageException,
                                 FaultException
To delete a set of Trap parsers, whose names are given in String[]. It simply deletes the TrapParsers with the given names irrespective of its condition i.e whether it's enabled or disabled. Alos it automatically updates the configuration file.
Parameters:
names - An array of names of Trap Parsers.
Returns:
true if Trap Parsers are successfully deleted
Throws:
java.rmi.RemoteException - if request fails in remote machine
NmsStorageException - if any error occurs while updating all storage sources
FaultException - wrapper for all other module level errors
See Also:
deleteAllTrapParsers()

deleteAllTrapParsers

public boolean deleteAllTrapParsers()
                             throws java.rmi.RemoteException
To delete all the Trap Parsers configured in the server. This method deletes all enabled and disabled Trap Parsers. Also it automatically updates the conf file.
Returns:
true if all Trap Parsers are successfully deleted
Throws:
java.rmi.RemoteException - if request fails in remote machine
See Also:
deleteTrapParsers(String[])

setTrapFilter

public boolean setTrapFilter(TrapFilterHolder tf,
                             boolean saveToFile)
                      throws java.rmi.RemoteException,
                             NmsStorageException,
                             FaultException
To set a Trap Filter in the server. If the argument saveToFile is 'true', the Trap Filter details will be stored in the default configuration file trap.filters which presents under WebNMSHome/conf directory. If the file trap.filters, does not exist, a new file by name trap.filters will be created under WebNMSHome/conf directory and the trap filter details will be stored in that file. If the argument saveToFile is false, Trap Filters will not be saved in configuration file hence the newly added TrapFilter won't be available for next session. This is because while starting WebNMS server (with or with out reinitialization), it loads Trap Filters from conf file and stores it in database.

If any TrapFilter is already there in WebNMS with the same name, then that old TrapParser will be replaced by the latest one. If no Trap Filter is there in WebNMS with the same name, then new Trap Filter will be added.

Parameters:
tf - The TrapFilterHolder object.
saveToFile - parameter decides whether Trap Filter details should be saved into WebNms/conf/trap.filters file (Default configuratrion file for Trap Filters) or not.
Returns:
true if the Trap Parser is successfully added/replaced, false if any exception occurs in saving Trap Filters in file or database.
Throws:
java.rmi.RemoteException - if request fails in remote machine
NmsStorageException - if any error occurs while storing TrapFilters
FaultException - wrapper for all other module level errors
See Also:
TrapFilterHolder, setTrapFilters(TrapFilterHolder[],boolean,boolean), getAllTrapFilters()

setTrapFilters

public boolean setTrapFilters(TrapFilterHolder[] tf,
                              boolean deleteOldFilters,
                              boolean saveToFile)
                       throws java.rmi.RemoteException,
                              NmsStorageException,
                              FaultException
To set an array of Trap Filters in the server. If the argument saveToFile is 'true', the Trap Filter details will be stored in the default configuration file trap.filters which presents under WebNMSHome/conf directory. If the file, trap.filters, does not exist, a new file by name trap.filters will be created under WebNMSHome/conf directory and the trap filter details will be stored in that file. Functional wise, this method is same as that of above method, except the argument TrapFilterHolder[]. If the argument deleteOldFilters is true, then already existing Trap Filters will be deleted.
Parameters:
tf - Array of trap filters objects.
deleteOldFilters - Whether to discard the already existing filters.
saveToFile - parameter decides whether to save the Trap Filter details or not into WebNms/conf/trap.filters file (the default Trap filter file).
Returns:
true if the TrapParsers are successfully added/replaced, false if any error occurs in saving the Trap Filters in file or saving Trap Filters in database
Throws:
java.rmi.RemoteException - if request fails in remote machine
NmsStorageException - if any error occurs while storing TrapFilters
FaultException - wrapper for all other module level errors
See Also:
TrapFilterHolder, setTrapFilter(TrapFilterHolder,boolean), getAllTrapFilters()

deleteAllTrapFilters

public boolean deleteAllTrapFilters()
                             throws java.rmi.RemoteException
To delete all the Trap Filters configured in the server. It simply deletes all enabled and disabled Trap Filters. It also automatically updates configuration file.
Returns:
true if all filters are successfully deleted.
Throws:
java.rmi.RemoteException - if request fails in remote machine
See Also:
setTrapFilter(TrapFilterHolder,boolean), getAllTrapFilters()

getAllTrapFilters

public TrapFilterHolder[] getAllTrapFilters()
                                     throws java.rmi.RemoteException
To get all the Trap Filters configured in the server. Users can use TrapFilterHolder.getEnableType() to see, whether the corresponding Trap Filter is enabled or disabled.
Returns:
An array of TrapFilterHolder objects
Throws:
java.rmi.RemoteException - if request fails in remote machine
See Also:
setTrapFilter(TrapFilterHolder,boolean), getTrapFiltersFromFile(String)

getTrapFiltersFromFile

public TrapFilterHolder[] getTrapFiltersFromFile(java.lang.String file)
                                          throws java.rmi.RemoteException,
                                                 FaultException
Gets the Trap Filters from a file. This returns TrapFilterHolder[] only when fully qualified name (i.e absolute name) of the file is given. User can use TrapFilterHolder.getEnableType() to see, whether the corresponding Trap Filter is enabled or disabled.
Parameters:
file - The fully qualified name of the file.
Returns:
An array of TrapFilterHolder objects. This method returns 'null' if error occurs in reading or parsing or if the file contains no Trap Filters.
Throws:
java.rmi.RemoteException - if request fails in remote machine
FaultException - wrapper for all module level errors
See Also:
TrapFilterHolder, getAllTrapFilters(), saveTrapFiltersToFile(TrapFilterHolder[],String)

saveTrapFiltersToFile

public boolean saveTrapFiltersToFile(TrapFilterHolder[] tf,
                                     java.lang.String file)
                              throws java.rmi.RemoteException,
                                     NmsStorageException,
                                     FaultException
To save a set of Trap Filters in a file. If complete path is not given, then the given Trap Parsers are stored in a file by name as given and the corresponding file will be placed under WebNMSHome directory.
Parameters:
tf - An array of TrapFilterHolder objects to be saved.
file - The fully qualified name or simple name of the file.
Returns:
true if all filters are successfully stored in the given file, false if any error occurs in opening or writing in the specified file.
Throws:
java.rmi.RemoteException - if request fails in remote machine
NmsStorageException - if any error occurs while storing TrapFilters
FaultException - wrapper for all other module level errors
See Also:
getTrapFiltersFromFile(String), getAllTrapFilters()

disableTrapsForNodes

public boolean disableTrapsForNodes(java.lang.String[] nodes,
                                    boolean deleteOldNodes)
                             throws java.rmi.RemoteException,
                                    NmsStorageException,
                                    FaultException
To disable traps for a set of nodes i.e. the traps that are received from this set of nodes will be discarded by WebNMS. If the argument deleteOldNodes is true old set of nodes will be deleted. If the specified node is not yet discovered, then traps will be processed based on the value of DROP_TRAPS_WHILE_UNMANAGED parameter against EventMgr process in NmsProcessBE.conf.
Parameters:
nodes - The string array specifying the node names.
deleteOldNodes - Whether to delete the old set of nodes.
Returns:
true if the specified nodes are successfully added in the list of nodes whose traps would be disabled.
Throws:
java.rmi.RemoteException - if request fails in remote machine
NmsStorageException - if any error occurs while storing the changes
FaultException - wrapper for all other module level errors
See Also:
enableTrapsForNodes(String[]), disableTrapsForGroups(String[],boolean)

enableTrapsForNodes

public boolean enableTrapsForNodes(java.lang.String[] nodes)
                            throws java.rmi.RemoteException,
                                   NmsStorageException,
                                   FaultException
To enable traps for nodes which have been disabled previously. If the specified node is not a disabled one, then this method will do nothing.
Parameters:
nodes - The array specifying the node names.
Returns:
true, if the disabled nodes are successfully enabled.
Throws:
java.rmi.RemoteException - if request fails in remote machine
NmsStorageException - if any error occurs while storing the changes
FaultException - wrapper for all other module level errors
See Also:
disableTrapsForNodes(String[],boolean), enableTrapsForGroups(String[])

getNodesDisabledForTraps

public java.lang.String[] getNodesDisabledForTraps()
                                            throws java.rmi.RemoteException
To get the names of the nodes for which traps have been disabled.
Returns:
An array containing the names of the nodes.
Throws:
java.rmi.RemoteException - if request fails in remote machine
See Also:
enableTrapsForNodes(String[]), disableTrapsForNodes(String[],boolean)

disableTrapsForGroups

public boolean disableTrapsForGroups(java.lang.String[] groups,
                                     boolean deleteOldGroups)
                              throws java.rmi.RemoteException,
                                     NmsStorageException,
                                     FaultException
To disable traps for a set of groups i.e. the traps that are received from the members of these groups will be discarded. If the argument deleteOldGroups is true, then old groups will be removed.
Parameters:
groups - The string array specifying the group names.
deleteOldGroups - Whether to delete the old set of groups.
Returns:
true, if specified groups are added successfully in the list of groups for which traps would be disabled.
Throws:
java.rmi.RemoteException - if request fails in remote machine
NmsStorageException - if any error occurs while storing the changes
FaultException - wrapper for all other module level errors
See Also:
enableTrapsForGroups(String[])

enableTrapsForGroups

public boolean enableTrapsForGroups(java.lang.String[] groups)
                             throws java.rmi.RemoteException,
                                    NmsStorageException,
                                    FaultException
To enable traps for groups which were disabled previously. If traps are not disabled for the specified group name, then this method will do nothing.
Parameters:
groups - The array specifying the group names.
Returns:
true, if traps for disabled groups are enabled successfully.
Throws:
java.rmi.RemoteException - if request fails in remote machine
NmsStorageException - if any error occurs while storing the changes
FaultException - wrapper for all other module level errors
See Also:
disableTrapsForGroups(String[],boolean)

getGroupsDisabledForTraps

public java.lang.String[] getGroupsDisabledForTraps()
                                             throws java.rmi.RemoteException
To get the names of the groups for which traps have been disabled.
Returns:
An array containing the names of the groups.
Throws:
java.rmi.RemoteException - if request fails in remote machine
See Also:
enableTrapsForGroups(String[]), disableTrapsForGroups(String[],boolean)

registerForTrap

public void registerForTrap(int port,
                            SocketListener trapListener)
                     throws java.rmi.RemoteException,
                            NmsStorageException
To register for Trap notification for some specific 'port'. Trap Listeners can be a separate application which listens for Traps at some specific port. This port may or may not be the same as the Port where WebNMS is listening for traps. If it is same, both WebNMS and registered TrapListener will be notified about the received Traps. For example consider WebNMS listenes trap at port 5000 and TrapListener is registered at port 6000. If any trap comes for port 5000, WebNMS will be notified and Trap Listener won't be notified. Like that if any trap comes to port 6000, Trap Listener alone will be notified. TrapListener and WebNMS can register for same trap port. Then it that case received trap will be notified to WebNMS and Trap Listener.
Parameters:
port - - Port for which the SocketListener is registering for notification.
trapListener - - Implementation of SocketListener interface for which notifications need to be sent.
Throws:
java.rmi.RemoteException - if request fails in remote machine
NmsStorageException - When problems opening socket
See Also:
registerForTraps(int[],SocketListener), deRegisterForTrap(int,SocketListener), deRegisterForTraps(int[],SocketListener)

registerForTraps

public void registerForTraps(int[] portArray,
                             SocketListener trapListener)
                      throws java.rmi.RemoteException,
                             NmsStorageException
To register for notification for Traps on multiple ports. A single Trap Listener can listen for multiple ports which may or may not be same as that of port where WebNMS is listening for traps.
Parameters:
portArray - - Trap Port values for which the SocketListener is registering for notification.
trapListener - - Implementation of SocketListener interface to which notifications need to be sent.
Throws:
java.rmi.RemoteException - if request fails in remote machine
NmsStorageException - When problems in opening socket
See Also:
registerForTrap(int,SocketListener), deRegisterForTrap(int,SocketListener), deRegisterForTraps(int[],SocketListener)

registerForTraps

public void registerForTraps(int[] portArray)
                      throws java.rmi.RemoteException,
                             NmsStorageException
To register for notification for Traps on multiple ports. WebNMS will listen for traps in the specified port. If WebNMS is already listening for traps in the specified port then this method does nothing. If WebNMS is not listening for traps in the specified port, then WebNMS starts listening for traps in the specified port.
Parameters:
portArray - - Trap Port values for which the NMS is registering for notification.
Throws:
java.rmi.RemoteException - if request fails in remote machine
NmsStorageException - When problem in opening socket
See Also:
deRegisterForTraps(int[])

deRegisterForTrap

public void deRegisterForTrap(int port,
                              SocketListener trapListener)
                       throws java.rmi.RemoteException,
                              NmsStorageException
To deregister TrapListener from notification for Traps on particular port. This method does nothing if the TrapListener is not already registered for the specified port.
Parameters:
port - - Port for which notifications need to be deregistered.
trapListener - - Implementation of SocketListener interface which has to be deregistered from notifications.
Throws:
java.rmi.RemoteException - if request fails in remote machine
NmsStorageException - When problem in closing socket
See Also:
deRegisterForTraps(int[],SocketListener), registerForTrap(int,SocketListener), registerForTraps(int[],SocketListener)

deRegisterForTraps

public void deRegisterForTraps(int[] portArray,
                               SocketListener trapListener)
                        throws java.rmi.RemoteException,
                               NmsStorageException
To deregister from getting notified by NMS for Traps on multiple ports. This method does nothing if the TrapListener is not already registered for the specified port.
Parameters:
portArray - - Trap Port values for which notifications need to be deregistered.
trapListener - - Implementation of SocketListener interface which has to be deregistered from notification.
Throws:
NmsStorageException - When problem in closing socket
java.rmi.RemoteException - if request fails in remote machine

deRegisterForTraps

public void deRegisterForTraps(int[] portArray)
                        throws java.rmi.RemoteException,
                               NmsStorageException
To deregister from getting notified by NMS for Traps on multiple ports to which the NMS is registered. If NMS is not already registered in that port, then this method does nothing.
Parameters:
portArray - - Trap Port values for which notifications need to be deregistered.
Throws:
NmsStorageException - When problem in closing socket
java.rmi.RemoteException - if request fails in remote machine
See Also:
deRegisterForTrap(int,SocketListener), registerForTrap(int,SocketListener), registerForTraps(int[],SocketListener)

deRegister

public void deRegister(SocketListener trapListener)
                throws java.rmi.RemoteException,
                       NmsStorageException
To deregister the given TrapListener from Trap notification for all registered ports. Nothing will happen it the specified TrapListener is not already registered.
Parameters:
trapListener - - Implementation of SocketListener interface which has to be deregistered from all registered ports.
Throws:
NmsStorageException - When problem in closing socket
java.rmi.RemoteException - if request fails in remote machine
See Also:
registerForTrap(int,SocketListener), registerForTraps(int[],SocketListener), deRegisterForTraps(int[],SocketListener)

setEnableReceiveTraps

public void setEnableReceiveTraps(boolean flag)
                           throws java.rmi.RemoteException
To enable NMS to receive Traps, set the flag to true and to stop receiving traps set the flag to false. By default NMS receives trap at port 162.
Parameters:
flag - false to disable trap receiving, true to enable receiving trap.
Throws:
java.rmi.RemoteException - if request fails in remote machine

enableParsers

public void enableParsers(java.lang.String[] parserNames,
                          boolean bool)
                   throws java.rmi.RemoteException,
                          NmsStorageException,
                          FaultException
To enable or disable Trap Parsers specified by the parameter 'parserNames'. If the parameter bool is false, and if there is any Trap Parser with the specified name, that Trap Parser will be disabled (i.e Traps will not be passed through that Trap Parser even it matches the specified matching critieria). If the Trap Parser is already disabled, it will remain at that state. If the parameter bool is true, and if there is any Trap Parser with the specified name, then that Trap Parser will be enabled. If the Trap Parser is already enabled it will remain at that state.
Parameters:
parserNames - - String array containsTrap Parser names.
bool - - boolean 'true' sets the Trap Parses enabled and 'false' sets disabled.
Throws:
NmsStorageException - if error occurs while storing the changes
java.rmi.RemoteException - if request fails in remote machine
FaultException - wrapper for all other module level errors
See Also:
enableFilters(String[],boolean)

enableFilters

public void enableFilters(java.lang.String[] filterNames,
                          boolean bool)
                   throws java.rmi.RemoteException,
                          NmsStorageException,
                          FaultException
To enable or disable Trap Filters specified by their names. If the parameter bool is false, and if there is any Trap Filter with the specified name, then that Trap Filter will be disabled (i.e Traps will not be passed through that Trap Filter even it matches the specified matching critieria for that Trap Filter). If the Trap Filter is already disabled, it will remain at the same state. If the parameter bool is true, and if there is any Trap Parser with the specified name, then that Trap Filter will be enabled. If the Trap Filter is already enabled it will remain at that same state.
Parameters:
filterNames - - String array contains TrapFilter names.
bool - - boolean 'true' sets the TrapFilters enabled and 'false' sets disabled.
Throws:
FaultException - wrapper for all other module level errors
java.rmi.RemoteException - if request fails in remote machine
NmsStorageException - if error occurs while storing the changes
See Also:
enableParsers(String[],boolean)

AdventNet Web NMS 4 API Specification