"WEBNMS_5 API Docs"

com.adventnet.nms.mapdb
Interface MapAPI

All Superinterfaces:
CommonAPI, CommonModuleAPI, java.rmi.Remote

public interface MapAPI
extends CommonAPI

MapAPI interface defines the methods that allows for accessing and manipulating map views and map objects in the Map database. MapAPI provides database neutral access for the applications to manipulate map objects across the database via map server. MapAPI provides methods for adding, deleting, updating and retrieving map objects These methods operate over a database interface layer, which translates the java objects to fit into RDBMS tables. The database layer can work with any JDBC compliant RDBMS.

Accessing MapAPI

MapAPI extends the CommonAPI interface, which allows it to be accessible even from remote hosts through RMI. It also inherits some of the database search functionalities from the CommonAPI.

This API can be accessed either through RMI or directly from the same JVM. It is published with the RMI handle MapAPI in the NMS server. Application code running within the same JVM as that of the NMS server can use the NmsUtil.getAPI(String) method to get the MapAPI handle.

For secure and authentic acquisition of MapAPI handle, the remote applications can use the RMIAccessAPI provided by the AdventNet Web NMS Security module. With this, the applications have to first get the handle of the RMIAccessAPI (which is published with the handle RMIAccessAPI in the NMS Server) and then use its getAPI method to get the handle of MapAPI by specifying valid username, password and "MapAPI" String as third argument.

The examples below show how MapAPI can be accessed by the above mentioned means, from the same JVM or through RMI.

 
 // Accessing MapAPI from the same JVM
 MapAPI mapApi = (MapAPI) NmsUtil.getAPI("MapAPI");
 

// Accessing MapAPI via RMI try { MapAPI mapApi = (MapAPI) Naming.lookup("//[NMSServerHost]/MapAPI"); } catch (Exception remoteException) { System.out.println("Error in getting the handle for MapAPI"); }

// Accessing MapAPI via RMIAccessAPI in the NMS RMI secure mode try { RMIAccessAPI rmiApi = (RMIAccessAPI) Naming.lookup("//[NMSServerHost]/RMIAccessAPI"); MapAPI mapApi = (MapAPI) rmiApi.getAPI("username", "password", "MapAPI"); } catch (Exception remoteException) { System.out.println("Error in getting the handle for MapAPI"); }


Method Summary
 boolean addContainer(java.lang.String mapkey, java.util.Properties p)
          Adds a Container to the specified map.
 boolean addCustomMap(java.lang.String mapname, java.util.Properties mapprop, java.util.Properties customProps)
          Adds a custom map into the map server.
 boolean addCustomMap(java.lang.String mapname, java.util.Properties mapprop, java.util.Properties customProps, int index)
          Use this method to insert the new custom map being added at the specified index.
 boolean addCustomMapWithTabs(java.lang.String mapname, java.util.Properties mapprop, java.util.Properties customProps, int index, java.util.Properties tabProp)
          Adds a custom map with tabpanels at the specified index of the tree into the map server.
 boolean addCustomMapWithTabs(java.lang.String mapname, java.util.Properties mapprop, java.util.Properties customProps, java.util.Properties tabprop)
          Adds a custom map with tabpanels into the map server.
 boolean addGroup(java.lang.String mapkey, java.util.Properties p)
          Adds a group to a map specified.
 boolean addLink(java.lang.String mapkey, java.util.Properties p)
          Adds a link to the map specified.
 boolean addMap(java.lang.String mapname, java.util.Properties p)
          Adds a default map into the map server.
 boolean addMap(java.lang.String mapname, java.util.Properties p, int index)
          Use this method to insert the new map being added at the specified index.
 boolean addMapWithTabs(java.lang.String mapname, java.util.Properties p, int index, java.util.Properties tabProp)
          Use this method to insert the new map with tab panels being added at the specified index.
 boolean addMapWithTabs(java.lang.String mapname, java.util.Properties p, java.util.Properties tabProp)
          Use this method to insert the new map with tab panels being added.
 void addObjects(java.lang.String className, java.util.Vector mapObjects)
           Adds a vector of map objects into the Database.
 boolean addSymbol(java.lang.String mapkey, java.util.Properties p)
          Adds a symbol to the specified map.
 boolean deleteContainer(java.lang.String mapkey, java.lang.String name)
          Deletes the specified container of the map from the database.
 boolean deleteGroup(java.lang.String mapkey, java.lang.String name)
          Deletes the specified group of the map from the database.
 boolean deleteLink(java.lang.String mapkey, java.lang.String name)
          Deletes the specified link of the map from the database.
 boolean deleteMap(java.lang.String mapkey)
          Deletes the map specified by the key from the database.
 boolean deleteSymbol(java.lang.String mapkey, java.lang.String name)
          Deletes the specified symbol of the map from the database.
 boolean doesTheMapExist(java.lang.String mapkey)
          Ensures the existence of a map with the specified key.
 java.util.Vector getAllSymbolProperties(java.lang.String mapName)
          This method can be used to get all the objects along with the properties present in the specified map.
 java.util.Vector getCompleteList()
          Returns a vector of all the object names that are there in the database.
 java.util.Vector getCustomMapNames()
          Fetches the list of all custom map keys present in the database.
 java.util.Vector getDefaultMapNames()
          Fetches the list of all default map keys present in the database.
 java.util.Properties getLinkProperties(java.lang.String mapkey, java.lang.String name)
          Fetches the properties of a MapLink object.
 MapDB getMap(java.lang.String mapkey)
          Fetches the MapDB object for a specific map identified by the key passed.
 java.util.Vector getMapNames()
          Fetches the list of all the maps in the database.
 java.lang.Object getObject(java.lang.String key)
          To get the MapSymbol ,MapLink, MapGroup, MapContainer or MapDB Object from the provided key of the object.
 java.util.Vector getObjectNamesWithProps(java.util.Properties prop)
          Finds the objects matching all the specified properties and returns a vector of their names.
 java.util.Vector getObjects(java.lang.String classname, java.util.Properties match)
          Gets the Vector of objects matching the given properties.
 java.util.Properties getPropertiesOfObject(java.lang.String objectkey)
          Searches for the object matching the specified key and returns the properties of the object.
 java.util.Vector getSymbolNames(java.lang.String mapname)
          Returns all the mapsymbols, maplinks , map groups and map containers (keys only) belonging to this map.
 java.util.Vector getSymbolNamesAssociatedWithObject(java.lang.String type, java.lang.String objName)
          To get all the Map Symbols representing a particular ManagedObject .
 java.util.Properties getSymbolProperties(java.lang.String mapkey, java.lang.String name)
          Fetches the properties of the specified map object.
 void saveMapManagerState()
          To save the state of MapManager.
 boolean setAutoCommit(boolean b)
          WebNMS Map module has a connection to the database.
 boolean updateContainer(java.lang.String mapkey, java.util.Properties p)
          Updates the Map Container on the map specified.
 boolean updateGroup(java.lang.String mapkey, java.util.Properties p)
          Updates the map group on the map specified.
 boolean updateLink(java.lang.String mapkey, java.util.Properties p)
          Updates the map link on the map specified.
 boolean updateMap(java.lang.String mapkey, java.util.Properties p)
          Updates the properties of the map mentioned with the specified set of properties passed.
 boolean updateMap(java.lang.String mapkey, java.util.Properties p, java.util.Properties criteriaProps)
          Updates an existing map with the given properties.
 boolean updateSymbol(java.lang.String mapkey, java.util.Properties p)
          Updates the symbol on the map specified with given properties.
 

Method Detail

addMap

boolean addMap(java.lang.String mapname,
               java.util.Properties p)
               throws java.rmi.RemoteException,
                      NmsStorageException,
                      UserTransactionException
Adds a default map into the map server. Unlike custom maps, default maps are those which are not associated with any ManagedObject criteria with it. So the method just adds a map and does not create symbols in it as these maps are not associated with any ManagedObject criteria. After adding a map using this call, objects to the map can be added using the other api calls like addSymbol(), addLink(), addContainer(), etc. The parameters required are mapname and the properties of the map (MapDB object) to be added. The mapname string that gets passed will be taken as the name of the map. The name passed should be unique and should end with ".netmap". MapServer appends this extension even if not specified while adding the map into the database. The various properties that could be provided are as follows. Note that the property keys are case sensitive.

  Properties                 Description   

 label                    Label name that should be displayed on the client tree

 menuName                 Map Specific menu (to be in XML format) name relative to the mapdata/menus 
                          directory in WebNMS Home

 imageName                Image to be displayed in the back ground. The path should be relative
                          to images directory in WebNMS Home.

 treeIconFileName         Image to be displayed in the tree against map label. The path should be 
                          relative to the WebNMS Home directory.

 helpDoc                  Help file name for the particular map. The path should be relative to
                          the WebNMS Home directory.

 topology                 Possible layouts that could be applicable for the map. It should be separated
                          by commas. Some of the known layouts part of Web NMS are grid,star,ring,flow,
                          ethernet,etc. In addition to this users can have their own implementation of 
                          layout. The values given should be equal to the string returned in the getName() 
                          method of the layout implementation. For example, a value of "grid,star,ring"
                          would mean that only these three layouts can be applied. A value of "$grid" 
                          would mean that grid is the only possible layout. A value of "grid" alone would 
                          result in all layouts being taken as applicable and grid being taken as the default 
                          one.

                                The description of the topology properties used in map is as follows:
                                width : Width of the map symbol 
                                height : Height of the map symbol 
                                gapX : Distance between 2 symbols in X axis
                                gapY : Distance betwen 2 symbols in Y axis 
                                scroll : The type of scroll bar, either "vertical" or "horizontal" scrollbar.
                        Any value other than these two values or absence of this attribute will mean 
                          that both vertical and horizontal scroll bars are required.

 currentTopology          The default layout that should be taken from the list of applicable 
                          ones given part of the topology property.

 autoPlacement            The specified current topology (layout) will be applied only when 
                          this property is true. Default value is true.

 WebNMS                   Not used now. Reserved for future release of WebNMS.

 groupName                Not used now. Reserved for future release of WebNMS.

 mapSymbolRenderer        Class name of the map symbol renderer that should be used for painting this map.

 mapLinkRenderer          Class name of the map link renderer that should be used for painting this map.

 mapListener              Class name of any MapListeners for the Map.

 anchored                 Determines whether the Map is editable or not. When it is set to true , map becomes 
                          non-editable. cut,copy,paste,move or changing the layout is not possible ,when anchored 
                          property is set to true.
 
For more details on the properties of map please refer MapDB javadocs.

Apart from the properties specified here, the method handles specially one more property called parentNode. This handling is specific to the client and it can be used to specify the parent tree node, under which the map should be displayed. This property will be separated from the Properties argument passed and will not be added as user property of the map. If this property is not specified the method would look for the parentMapKey property and have its value for the tree node parent. If both these values are not present in the properties that gets passed, then the map would be added under the "Maps" node. If any map that need not to be displayed on the user tree of the client, a special property named as "addToTree" can be passed with the value "false" along with map properties. These maps will not be shown on the user tree of the client by default. These maps can be loaded dynamically from the client as and when required and also they will be cleaned up from the memory once they get closed by the user. Refer the help documentation for more details regarding this.

Parameters:
mapname - the name of the map to be added. The mapname should be unique and ends with ".netmap"
p - the properties that are desired for the map to be added
Returns:
true if the map is succesfully added, else false
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.
See Also:
MapDB, AutoLayout, MapSymbolRendererInterface, MapLinkRendererInterface, MapListener

addMapWithTabs

boolean addMapWithTabs(java.lang.String mapname,
                       java.util.Properties p,
                       java.util.Properties tabProp)
                       throws java.rmi.RemoteException,
                              NmsStorageException,
                              UserTransactionException
Use this method to insert the new map with tab panels being added.

Parameters:
mapname - name of the map
p - properties of the map
tabProp - properties that specifies the tabpanel keys and the criteria for the tab custom views.
 tabProperties
 tabPanels      property that specifies the tabs to be added. Keys should be separated by a comma delimiter(,)
  EVENT-PROPS   "FieldsWanted" and the criteria for the event tab view has to be specified here.
  ALERT-PROPS   "FieldsWanted" and the criteria for the alert tab view has to be specified here.
 Code snippet

                Properties tabprop=new Properties();
                        tabprop.put("tabPanels", "Events,Alerts");
                        Properties properties1 = new Properties();
                        properties1.put("FieldsWanted", "Status=severity;Source=source;Date/Time=time;Message=text;Category=category;Node=node;Entity=entity;");
                        properties1.put("source",net.getName());
                        tabprop.put("EVENT-PROPS", properties1);
                        Properties properties2 = new Properties();
                        properties2.put("FieldsWanted", "Status=severity=55;Failure Object=entity=135;Alarm Group=groupName=150;Date/Time=modTime=155;Alarm Message=message=275;");
                        tabprop.put("ALERT-PROPS", properties2);
                        
 Tabs get added only when DEVICE-VIEW parameter is enabled.
 
Returns:
true if the map is succesfully added, else false
Throws:
java.rmi.RemoteException - might be thrown if any error occurs during the execution of a remote method
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.
See Also:
addMap(String, Properties)

addCustomMap

boolean addCustomMap(java.lang.String mapname,
                     java.util.Properties mapprop,
                     java.util.Properties customProps)
                     throws java.rmi.RemoteException,
                            NmsStorageException,
                            UserTransactionException
Adds a custom map into the map server.

This facilitates creation of maps based on certain property criteria. The parameters to be passed to this method are :
mapname : the name of the map
mapprop : the properties of the map like imageName, treeIconFileName, etc. to be added
customProps : the criteria for the map to filter the ManagedObjects to create symbols to the map

The name and properties of map are same as explained in the addMap(String,Properties) method. Please refer the comments on the method. And by criteria properties, we mean the properties of the ManagedObject which will be used for filtering and creating objects to the map. User can give one or more property of ManagedObject as the Custom Map criteria.

The customProps argument specifying the map criteria will be used to query the topology database to filter a set of ManagedObjects matching it and a map comprising of mapsymbols representing those objects will be created. Please note the difference between this method and the addMap method. In case of the addMap method, one has to create the Map and add symbols manually to the map. But this addCustomMap api method will automatically create a Map and create map symbols for those ManagedObjects satisfying the given criteria. Symbols for the ManagedObjects that gets discovered later will also automatically get added to this map if they match the specified map criteria. Thus the creation, additions, deletions and updates of the map symbols based on the ManagedObjects will be automatically taken care by the map server.

If any map that need not to be displayed on the user tree of the client, a special property named as "addToTree" can be passed with the value "false" along with map properties. These maps will not be shown on the user tree of the client by default. These maps can be loaded dynamically from the client as and when required and also they will be cleaned up from the memory once they get closed by the user. Refer the help documentation for more details regarding this.

Parameters:
mapname - name of the map. The mapname should be unique and should end with .netmap
mapprop - properties desired for the map to be added
customProps - criteria properties of the map to be created
Returns:
true, if the map is successfully added
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.
See Also:
TopoAPI.getObjectNamesWithProps(Properties), addMap(String, Properties)

addCustomMapWithTabs

boolean addCustomMapWithTabs(java.lang.String mapname,
                             java.util.Properties mapprop,
                             java.util.Properties customProps,
                             java.util.Properties tabprop)
                             throws java.rmi.RemoteException,
                                    NmsStorageException,
                                    UserTransactionException
Adds a custom map with tabpanels into the map server.

This facilitates creation of maps based on certain property criteria. The parameters to be passed to this method are :
mapname : the name of the map
mapprop : the properties of the map like imageName, treeIconFileName, etc. to be added
customProps : the criteria for the map to filter the ManagedObjects to create symbols to the map tabProp : properties that specifies the tabpanel keys and the Event/Alert custom views criteria properties,if the added tab is either/both of of them

The name and properties of map are same as explained in the addMap(String,Properties) method. Please refer the comments on the method. And by criteria properties, we mean the properties of the ManagedObject which will be used for filtering and creating objects to the map. User can give one or more property of ManagedObject as the Custom Map criteria.

The customProps are same as explained in the addCustomMap(String, Properties, Properties) The tabProp are same as explained in the addMap(String, Properties)

Parameters:
mapname - name of the map. The mapname should be unique and should end with .netmap
mapprop - properties desired for the map to be added
customProps - criteria properties of the map to be created
tabProp - properties that specifies the tabpanel keys and the criteria for the tab custom views.
Returns:
true, if the map is successfully added
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.
See Also:
TopoAPI.getObjectNamesWithProps(Properties), addMap(String, Properties)

deleteMap

boolean deleteMap(java.lang.String mapkey)
                  throws java.rmi.RemoteException,
                         NmsStorageException,
                         UserTransactionException
Deletes the map specified by the key from the database. Can be used for deleting both default and custom maps. Deleting a map would result in all the objects in the map like symbols, links, containers and groups getting deleted from the database. Also this method will delete all the children maps recursively before deleting the parent map. Note : children maps doesn't necessarily mean the maps that are under the desired map in the client tree. There could be any map or even a non-map node say Event custom view node under any map in the client tree. Children maps are those which have thier parentMapKey property set to this map name.

Parameters:
mapkey - key of the map which needs to be deleted
Returns:
true if the map is successfully deleted, else false
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.

getMap

MapDB getMap(java.lang.String mapkey)
             throws java.rmi.RemoteException,
                    NmsStorageException,
                    UserTransactionException
Fetches the MapDB object for a specific map identified by the key passed. The MapDB returned will have all the properties of the map like image(background image), autoPlacement etc. Please note that the object returned is just for reference purpose. Altering this object wouldn't modify its properties in the database. To perform any sort of update on maps use updateMap(String, Properties) or updateMap(String, Properties, Properties).

Parameters:
mapkey - key of the map for which the MapDB object has to fetched
Returns:
the MapDB object corresponding the map when the map exists, else returns null
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.
See Also:
MapDB

doesTheMapExist

boolean doesTheMapExist(java.lang.String mapkey)
                        throws java.rmi.RemoteException,
                               NmsStorageException,
                               UserTransactionException
Ensures the existence of a map with the specified key.

Parameters:
mapkey - key of the map
Returns:
true if the map exists, else false
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.

getMapNames

java.util.Vector getMapNames()
                             throws java.rmi.RemoteException,
                                    NmsStorageException,
                                    UserTransactionException
Fetches the list of all the maps in the database. The returned vector includes both default and custom map keys.

Returns:
a Vector containing the keys of all the maps in the database
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.
See Also:
getCustomMapNames(), getDefaultMapNames()

getCustomMapNames

java.util.Vector getCustomMapNames()
                                   throws java.rmi.RemoteException,
                                          NmsStorageException,
                                          UserTransactionException
Fetches the list of all custom map keys present in the database.

Returns:
a Vector containing the keys of all custom maps in the database
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.
See Also:
getDefaultMapNames()

getDefaultMapNames

java.util.Vector getDefaultMapNames()
                                    throws java.rmi.RemoteException,
                                           NmsStorageException,
                                           UserTransactionException
Fetches the list of all default map keys present in the database.

Returns:
a Vector containing the keys of all default maps in the database
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.
See Also:
getCustomMapNames()

addSymbol

boolean addSymbol(java.lang.String mapkey,
                  java.util.Properties p)
                  throws java.rmi.RemoteException,
                         NmsStorageException,
                         UserTransactionException
Adds a symbol to the specified map. This call creates a MapSymbol object with the properties given and adds the MapSymbol to the map. The propertyNames in the second argument should match the variable names in the MapSymbol object. The MapSymbol name is unique in a given map and the key for the MapSymbol is formed by its name and the key of the map it belongs to.

This call imposes some restriction in case of custom maps if the objName property of the symbol is set. In default maps, this call just adds the symbol to the map if the map exists and there is no object in the map with the specified name, whatever be the objName property set. But in case of custom maps the API user should ensure that the ManagedObject corresponding the objName set in the properties would satisfy the map custom criteria. If the MO doesn't satify the map criteria, then the symbol isn't added, the call returning false. If no objName is specified in properties then the symbol gets added in both cases if the mapkey and name are valid.

Parameters:
mapkey - key of the map to which the symbol is to be added
p - the desired properties of MapSymbol to be added

   Properties                     Description

        name            name of the map symbol

        label           label to displayed on the display

        objName         name of the ManagedObject the symbol represents

        iconName        name of the Image file, relative to the images directory, which should be painted to 
                        represent this symbol

        menuName        name of the symbol specific menu file, relative to the mapdata/menus directory, which should be 
                        invoked while selecting the MapSymbol

        status          status of the MapSymbol

        mapName         name of the Map in which the symbol is to be added.

        parentName      name of the MapContainer in which symbol is to be added. When parentName is not specified, 
                  the symbol will be added to the base level of the map. This property gets validated and 
                  hence if the container specified doesn't exist, the method returns false and method doesn't adds 
                  the symbol to the database.

        groupName       name of the MapGroup to which symbol is to be a member of. This property gets validated and 
                  hence if the group specified doesn't exist, the method returns false and method doesn't adds 
                  the symbol to the database.

        objType         the object type. It is an integer. 
                        The predefined values are
                                  0             represents symbol
                                  1             represents Node
                                  2             represents Network
                                  3             represents gateway
                                  4             represents sub-symbol
                                  5             represents site

                        User can specify his/her own OBJTYPES in the
                        mapIcon.data conf file.

        x               x Co-ordinate of the MapSymbol 

        y               y Co-ordinate of the MapSymbol 

        width           width of the MapSymbol

        height          height of the MapSymbol
        
        anchored        the boolean value which determines whether the layout class applicable for the map should 
                  position the symbol or not. If set to true the layout ignores this symbol in which case care 
                  should be taken to set proper values for x, y, width and height values for the symbol to be 
                  painted.
 
Other than the above listed properties user can give his/her own properties . Those properties would be considered as user properties.
Returns:
true if the map symbol is added to the specified map successfully
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.
See Also:
MapSymbol

addContainer

boolean addContainer(java.lang.String mapkey,
                     java.util.Properties p)
                     throws java.rmi.RemoteException,
                            NmsStorageException,
                            UserTransactionException
Adds a Container to the specified map. This method creates a MapContainer object with the properties given and adds the MapContainer to the map identified by the mapkey. The propertyNames in the second argument should match the variable names in the MapContainer object. The MapContainer name is unique in a given map and the key for the MapContainer is formed by its name and the key of the map it belongs to.

After adding the container to the map, child symbols can be added to it using the parentName property of MapSymbol object. This parentName property should be filled with the name of the container object to which the symbol should be a child. The child symbol could be a map container in turn too. Presently it cannot be a map group.

Other than MapSymbol properties listed in the addSymbol(String, Properties) method javadocs, MapContainer can take three extra properties namely :

 topology            which is comma separated list of applicable topologies for the container to layout its 
                     child map symbols
 currentTopology     the topology which is in effect currently among the toplogies list
 containment         which signifies whether the children of this container should be within or outside 
                     the boundary of the container
 

Also the restriction in case of custom maps when the objName property being set, explained in addSymbol(String, Properties) method, is applicable for containers too.

Parameters:
mapkey - key of the map to which the container is to be added
p - properties of the map container object to be added.
Returns:
true if the Map Container is added to the specified map successfully.
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.
See Also:
addSymbol(String, Properties), MapContainer

addLink

boolean addLink(java.lang.String mapkey,
                java.util.Properties p)
                throws java.rmi.RemoteException,
                       NmsStorageException,
                       UserTransactionException
Adds a link to the map specified. This method creates a MapLink object with the properties given and adds the MapLink to the map identified by the mapkey.The propertyNames in the second argument should match the variable names in the MapLink object. The MapLink name is unique in a given map and the key for the MapLink is formed by its name and the key of the map it belongs to.

Other than MapSymbol properties listed in the addSymbol(String, Properties) method javadocs, MapLink can take three extra properties namely :

 source           name of the source MapSymbol from where the link is to originate. No validation is 
                         done on the server for these properties. Even if no such symbol is present which is 
                         specified here, the link would be added. 
 dest             name of the destination MapSymbol from where the symbol is to terminate. Gets added 
                         even if the symbol doesn't exist.
 thickness        thickness of the link in terms of pixels
 

Also the restriction in case of custom maps when the objName property being set, explained in addSymbol(String,Properties) method, is applicable for links too.

Parameters:
mapkey - key of the map to which the link is to be added
p - the desired set of properties of map link object
Returns:
true if the Map Link is added to the specified Map
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.
See Also:
addSymbol(String, Properties), MapSymbol, MapLink

addGroup

boolean addGroup(java.lang.String mapkey,
                 java.util.Properties p)
                 throws java.rmi.RemoteException,
                        NmsStorageException,
                        UserTransactionException
Adds a group to a map specified. This method creates a MapGroup object with the properties given and adds the MapGroup to the map identified by the mapkey. The propertyNames in the second argument should match the variable names in the MapGroup. The key for the MapGroup is formed by its name and the key of the map it belongs to.

After adding the group to the map, members into the group can be added using the groupName property of MapSymbol. This groupName property should be filled in with the name of the map group object to which this symbol should be a member. The member symbol could only be a map symbol or a map link. Presently it cannot be a map group or a map container.

Also the restriction in case of custom maps when the objName property being set, explained in addSymbol(String,Properties) method, is applicable for groups too.

Parameters:
mapkey - key of the map to which the group is to be added
p - properties of MapGroup object. There are no additional properties for MapGroup apart from those it inherits from MapSymbol.
Returns:
true if the Map Group is added to the specified map
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.

updateSymbol

boolean updateSymbol(java.lang.String mapkey,
                     java.util.Properties p)
                     throws java.rmi.RemoteException,
                            NmsStorageException,
                            UserTransactionException
Updates the symbol on the map specified with given properties. The MapSymbol to be updated is identified by the name property value in the Properties passed. The properties to be modified only should be passed in the second argument. The properties can contain any of the standard property of the MapSymbol object or user property defined by the user. Any other new property other than standard properties or existing user properties is added as one more user property for the symbol. Note : There is no need to fetch the object and pass the whole of the existing properties of the object. The property values which are to be updated is just sufficient in the Properties object. For example to update the menuName property of a symbol in a given map, the following code snippet would do :
 Code Snippet
      Properties props = new Properties();      
      props.put("name", "symbol_name_which_is_to_be_updated"); //this property is mandatory for update symbol
      props.put("menuName", "objectmenu"); //desired value for update
      .
      .
      .
      String mapname = "name_of_the_map_the_symbol_belongs";
      boolean result = mapAPI.updateSymbol(mapname, props);
      .
 

Just as stated in case of addSymbol(String, Properties), the restriction in case of custom maps, applies to this method too if the objName property is tried to be updated. API user should ensure that the ManagedObject corresponding the objName set in the properties would satisfy the custom map criteria. If the MO doesn't satify the map criteria, then the symbol wouldn't be updated and the method returns false. If the method returns false, none of the property stated would be updated.

Parameters:
mapkey - key of the map to which the symbol belongs to
p - desired properties of the map symbol to be updated
Returns:
true if the MapSymbol is updated
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.

updateContainer

boolean updateContainer(java.lang.String mapkey,
                        java.util.Properties p)
                        throws java.rmi.RemoteException,
                               NmsStorageException,
                               UserTransactionException
Updates the Map Container on the map specified. The Map container to be updated is identified by the name property from the second argument(properties) and mapkey. This works much similar to the updateSymbol(String, Properties) method. Refer the method's javadocs.

Parameters:
mapkey - key of the map to which the container belongs
p - desired properties of the container to be updated
Returns:
true if the MapContainer is updated
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.

updateLink

boolean updateLink(java.lang.String mapkey,
                   java.util.Properties p)
                   throws java.rmi.RemoteException,
                          NmsStorageException,
                          UserTransactionException
Updates the map link on the map specified. The MapLink to be updated is identified by the name property from the second argument(properties) and mapkey. This works much similar to the updateSymbol(String, Properties) method. Refer the method's javadocs.

Parameters:
mapkey - key of the map to which the link belongs
p - desired properties of the map link to be updated
Returns:
true if the link is updated successfully
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.

updateGroup

boolean updateGroup(java.lang.String mapkey,
                    java.util.Properties p)
                    throws java.rmi.RemoteException,
                           NmsStorageException,
                           UserTransactionException
Updates the map group on the map specified. The MapGroup to be updated is identified by the name property from the second argument(properties) and mapkey. This works much similar to the updateSymbol(String, Properties) method. Refer the method's javadocs.

Parameters:
mapkey - key of the map to which the group belongs
p - desired properties of the map group to be updated
Returns:
true if the group is updated successfully
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.

deleteSymbol

boolean deleteSymbol(java.lang.String mapkey,
                     java.lang.String name)
                     throws java.rmi.RemoteException,
                            NmsStorageException,
                            UserTransactionException
Deletes the specified symbol of the map from the database.

Parameters:
mapkey - key of the map in which the symbol is present
name - name of the symbol to be deleted
Returns:
true if the symbol is deleted
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.

deleteContainer

boolean deleteContainer(java.lang.String mapkey,
                        java.lang.String name)
                        throws java.rmi.RemoteException,
                               NmsStorageException,
                               UserTransactionException
Deletes the specified container of the map from the database. Also every the children containers and symbols too gets deleted recursively.

Parameters:
mapkey - key of the map in which the container is present
name - name of the container to be deleted
Returns:
true if the container is deleted
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.

deleteLink

boolean deleteLink(java.lang.String mapkey,
                   java.lang.String name)
                   throws java.rmi.RemoteException,
                          NmsStorageException,
                          UserTransactionException
Deletes the specified link of the map from the database.

Parameters:
mapkey - key of the map in which the link is present
name - name of the link to be deleted
Returns:
true if the link is deleted
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.

deleteGroup

boolean deleteGroup(java.lang.String mapkey,
                    java.lang.String name)
                    throws java.rmi.RemoteException,
                           NmsStorageException,
                           UserTransactionException
Deletes the specified group of the map from the database. Also deletes all the member objects of the group from the database.

Parameters:
mapkey - key of the map in which the group is present
name - name of the group to be deleted
Returns:
true if the group is deleted
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.

getSymbolProperties

java.util.Properties getSymbolProperties(java.lang.String mapkey,
                                         java.lang.String name)
                                         throws java.rmi.RemoteException,
                                                NmsStorageException,
                                                UserTransactionException
Fetches the properties of the specified map object. Key of any map object like link or group or container could be passed. Returns null if the object is not present in the database.

Parameters:
mapkey - key of the map where the object is present
name - name of MapSymbol object or an object which extends MapSymbol like MapLink, MapContainer or MapGroup
Returns:
properties of the MapSymbol including user properties. Returns null if the object doestn't exist.
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.

getLinkProperties

java.util.Properties getLinkProperties(java.lang.String mapkey,
                                       java.lang.String name)
                                       throws java.rmi.RemoteException,
                                              NmsStorageException,
                                              UserTransactionException
Fetches the properties of a MapLink object.

Parameters:
mapkey - key of the map in which the link is present
name - name of the link for which the properties is to be retrieved
Returns:
properties of the MapLink. Returns null if the link doestn't exist.
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.

updateMap

boolean updateMap(java.lang.String mapkey,
                  java.util.Properties p)
                  throws java.rmi.RemoteException,
                         NmsStorageException,
                         UserTransactionException
Updates the properties of the map mentioned with the specified set of properties passed. The map could be default or custom map. Note : There is no need to fetch the object and pass the whole of the existing properties of the object to the method. The property values which are to be updated is just sufficient in the Properties object. For example to update the treeIconFileName property of a given map, the following code snippet would do :
 Code Snippet
      Properties props = new Properties();      
      props.put("treeIconFileName", "ip.png"); //desired value for update
      .
      .
      .
      String mapname = "name_of_the_map_the_symbol_belongs";
      boolean result = mapAPI.updateMap(mapname, props);
      .
 

Parameters:
mapkey - key of the map to be updated
p - properties of the map that are to be updated
Returns:
true if the map is succesfully updated
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.
See Also:
addMap(String, Properties)

updateMap

boolean updateMap(java.lang.String mapkey,
                  java.util.Properties p,
                  java.util.Properties criteriaProps)
                  throws java.rmi.RemoteException,
                         NmsStorageException,
                         UserTransactionException
Updates an existing map with the given properties. This method can be used to update map properties alone for default/custom maps or both map properties and criteria properties or any of them for custom maps. Default map can not be updated to a custom map. If the third argument is not null if the method is used for a default map, then the method returns false.

Parameters:
mapkey - key of the map which is to be updated
p - map properties to be updated
criteriaProps - criteria of the custom map to be updated
Returns:
true if the map is succesfully updated
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.
See Also:
addCustomMap(String, Properties, Properties)

saveMapManagerState

void saveMapManagerState()
                         throws java.rmi.RemoteException
To save the state of MapManager. The MapManager is important to be saved as it contains information about all the map and its symbols and links. By default, the MapManager is saved every 5 minutes. It is also saved when a shutdown is invoked by the client.

Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown

getSymbolNamesAssociatedWithObject

java.util.Vector getSymbolNamesAssociatedWithObject(java.lang.String type,
                                                    java.lang.String objName)
                                                    throws java.rmi.RemoteException,
                                                           NmsStorageException,
                                                           UserTransactionException
To get all the Map Symbols representing a particular ManagedObject . Returns a Vector of keys of those map objects requested.

Parameters:
type - A String which can take values like "symbol" or "link" or "container" or "all". As it might be guessed, depending on the value of this parameter type the keys of symbols, links, containers or every one of these together respectively are returned.
objName - Name of the ManagedObject.
Returns:
vector of keys of MapSymbol or MapContainer or MapLink or All the three according to the type specified.
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.

getObject

java.lang.Object getObject(java.lang.String key)
                           throws java.rmi.RemoteException,
                                  NmsStorageException,
                                  UserTransactionException
To get the MapSymbol ,MapLink, MapGroup, MapContainer or MapDB Object from the provided key of the object. Note that this method just returns an object for reference. Any modifications in the object wouldn't update its properties in the database.

Parameters:
key - The respective key.
Returns:
java.lang.Object The object corresponding to the given key if any.
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.

getObjects

java.util.Vector getObjects(java.lang.String classname,
                            java.util.Properties match)
                            throws java.rmi.RemoteException,
                                   NmsStorageException,
                                   UserTransactionException
Gets the Vector of objects matching the given properties. The classname is the name of the class the objects belong to. This call can be used only if the object's properties are stored in an RDBMS. It is also assumed one object is stored in only one table. If one object is stored in multiple tables, then only partial object will be returned.

Parameters:
classname - is the name of the class , the objects belongs to, for example it can be "MapSymbol", "MapLink", "MapGroup", "MapContainer".
match - the criteria based on which the objects are to be selected from the database.
Returns:
vector of keys of those objects matching the filter.
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.

getSymbolNames

java.util.Vector getSymbolNames(java.lang.String mapname)
                                throws java.rmi.RemoteException,
                                       NmsStorageException,
                                       UserTransactionException
Returns all the mapsymbols, maplinks , map groups and map containers (keys only) belonging to this map.

Parameters:
mapname - name of the map .The mapname should end with .netmap
Returns:
keys of all map objects in the Map.
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.

setAutoCommit

boolean setAutoCommit(boolean b)
                      throws java.rmi.RemoteException,
                             java.sql.SQLException
WebNMS Map module has a connection to the database. This method sets the connection's auto-commit mode to true or false. By default auto-commit mode is true.

Parameters:
b - true to set the auto-commit
Returns:
true if auto-commit is successfully set .
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
java.sql.SQLException - exception from the database while setting auto commit

addMap

boolean addMap(java.lang.String mapname,
               java.util.Properties p,
               int index)
               throws java.rmi.RemoteException,
                      NmsStorageException,
                      UserTransactionException
Use this method to insert the new map being added at the specified index.

Parameters:
mapname - name of the map
p - properties of the map
index - the index at which this map should sit in the map tree hierarchy. Please note that the index starts with 0.
Returns:
true if the map is succesfully added, else false
Throws:
java.rmi.RemoteException - might be thrown if any error occurs during the execution of a remote method
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.
See Also:
addMap(String, Properties)

addMapWithTabs

boolean addMapWithTabs(java.lang.String mapname,
                       java.util.Properties p,
                       int index,
                       java.util.Properties tabProp)
                       throws java.rmi.RemoteException,
                              NmsStorageException,
                              UserTransactionException
Use this method to insert the new map with tab panels being added at the specified index.

Parameters:
mapname - name of the map
p - properties of the map
index - the index at which this map should sit in the map tree hierarchy. Please note that the index starts with 0.
tabProp - properties that specifies the tabpanel keys and the Event/Alert custom views criteria properties, if the added tab is either/both of of them
 tabProperties
 tabPanels      property that specifies the tabs to be added. Keys should be separated by a comma delimiter(,)
  EVENT-PROPS   "FieldsWanted" and the criteria for the event tab view has to be specified here.
  ALERT-PROPS   "FieldsWanted" and the criteria for the alert tab view has to be specified here.
 Code snippet

                Properties tabprop=new Properties();
                        tabprop.put("tabPanels", "Events,Alerts");
                        Properties properties1 = new Properties();
                        properties1.put("FieldsWanted", "Status=severity;Source=source;Date/Time=time;Message=text;Category=category;Node=node;Entity=entity;");
                        properties1.put("source",net.getName());
                        tabprop.put("EVENT-PROPS", properties1);
                        Properties properties2 = new Properties();
                        properties2.put("FieldsWanted", "Status=severity=55;Failure Object=entity=135;Alarm Group=groupName=150;Date/Time=modTime=155;Alarm Message=message=275;");
                        tabprop.put("ALERT-PROPS", properties2);
                        
 Tabs get added only when DEVICE-VIEW parameter is enabled.
 
Returns:
true if the map is succesfully added, else false
Throws:
java.rmi.RemoteException - might be thrown if any error occurs during the execution of a remote method
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.
See Also:
addMap(String, Properties)

addCustomMap

boolean addCustomMap(java.lang.String mapname,
                     java.util.Properties mapprop,
                     java.util.Properties customProps,
                     int index)
                     throws java.rmi.RemoteException,
                            NmsStorageException,
                            UserTransactionException
Use this method to insert the new custom map being added at the specified index.

Parameters:
mapname - name of the map
mapprop - properties of the map
customProps - criteria properties of the map to be created
index - the index at which this map should sit in the client tree hierarchy. Please note that the index starts with 0.
Returns:
true, if the map is successfully added
Throws:
java.rmi.RemoteException - might be thrown if any error occurs during the execution of a remote method
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.
See Also:
addCustomMap(String, Properties, Properties)

addCustomMapWithTabs

boolean addCustomMapWithTabs(java.lang.String mapname,
                             java.util.Properties mapprop,
                             java.util.Properties customProps,
                             int index,
                             java.util.Properties tabProp)
                             throws java.rmi.RemoteException,
                                    NmsStorageException,
                                    UserTransactionException
Adds a custom map with tabpanels at the specified index of the tree into the map server.

This facilitates creation of maps based on certain property criteria. The parameters to be passed to this method are :
mapname : the name of the map
mapprop : the properties of the map like imageName, treeIconFileName, etc. to be added
customProps : the criteria for the map to filter the ManagedObjects to create symbols to the map index : the index at which the map should sit in the client tree hierarchy. tabProp : properties that specifies the tabpanel keys and the Event/Alert custom views criteria properties,if the added tab is either/both of of them

The name and properties of map are same as explained in the addMap(String,Properties) method. Please refer the comments on the method. And by criteria properties, we mean the properties of the ManagedObject which will be used for filtering and creating objects to the map. User can give one or more property of ManagedObject as the Custom Map criteria.

The customProps are same as explained in the addCustomMap(String, Properties, Properties) The tabProp are same as explained in the addMap(String, Properties)

Parameters:
mapname - name of the map. The mapname should be unique and should end with .netmap
mapprop - properties desired for the map to be added
customProps - criteria properties of the map to be created
index - the index at which this map should sit in the client tree hierarchy. Please note that the index starts with 0.
tabProp - properties that specifies the tabpanel keys and the criteria for the tab custom views.
Returns:
true, if the map is successfully added
Throws:
java.rmi.RemoteException - exceptions that may occur during the execution of a remote method call are thrown
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.
See Also:
TopoAPI.getObjectNamesWithProps(Properties), addMap(String, Properties)

getPropertiesOfObject

java.util.Properties getPropertiesOfObject(java.lang.String objectkey)
                                           throws java.rmi.RemoteException,
                                                  NmsStorageException,
                                                  UserTransactionException
Searches for the object matching the specified key and returns the properties of the object. The search is carried out in all the map object tables viz., MapSymbol, MapLink, MapGroup, MapContainer, MapDB and ManagedMapObject tables.

Specified by:
getPropertiesOfObject in interface CommonAPI
Parameters:
objectkey - key of the object
Returns:
properties of the object that is passed
Throws:
java.rmi.RemoteException - might be thrown if any error occurs during the execution of a remote method
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.

getObjectNamesWithProps

java.util.Vector getObjectNamesWithProps(java.util.Properties prop)
                                         throws java.rmi.RemoteException,
                                                NmsStorageException,
                                                UserTransactionException
Finds the objects matching all the specified properties and returns a vector of their names. Objects searched for are MapSymbol, MapLink, MapGroup and MapContainer objects.

Specified by:
getObjectNamesWithProps in interface CommonAPI
Parameters:
prop - properties to be satisfied by the objects
Returns:
a vector of object names satisfying all the property values
Throws:
java.rmi.RemoteException - might be thrown if any error occurs during the execution of a remote method
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.

getCompleteList

java.util.Vector getCompleteList()
                                 throws java.rmi.RemoteException,
                                        NmsStorageException,
                                        UserTransactionException
Returns a vector of all the object names that are there in the database. This method lists only MapSymbol, MapGroup, MapContainer and MapLink object names.

Specified by:
getCompleteList in interface CommonAPI
Throws:
java.rmi.RemoteException - might be thrown if any error occurs during the execution of a remote method
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.

getAllSymbolProperties

java.util.Vector getAllSymbolProperties(java.lang.String mapName)
                                        throws java.rmi.RemoteException,
                                               NmsStorageException,
                                               UserTransactionException
This method can be used to get all the objects along with the properties present in the specified map. The objects might be Symbols,Links,Containers or Groups.

Parameters:
mapName - name of the map from which the properties of all the objects to be retrieved.
Returns:
vector containing the properties object for all the map objects.
Throws:
java.rmi.RemoteException - might be thrown if any error occurs during the execution of a remote method
NmsStorageException - that may occur if any SQL error occurs while doing database operations
UserTransactionException - that may occur if the current transaction is timed out.

addObjects

void addObjects(java.lang.String className,
                java.util.Vector mapObjects)
                throws java.rmi.RemoteException,
                       NmsStorageException,
                       UserTransactionException

Adds a vector of map objects into the Database. The map objects referred here might be MapSymbol, MapLink, MapGroup or MapContainer objects.The objects may belong to same class or of different classes. If all the objects to be added belongs to the same class, for instance if the vector contains only MapSymbol objects then the className parameter is used as com.adventnet.nms.mapdb.MapSymbol (Fully qualified classname) Or if the vector contains collection of symbols, links, groups (i.e, objects of different classes) then the className should be passed as null.

If the underlying database supports transaction, and if the transaction support is enabled, then this method ensures atomicity of the add operation. If the insertion of an object fails at any point, the changes made to the database tables from the start of the operation are all undone and the operation is abandoned. For example, if 10 objects are given to be added to the Database, 5 objects are added and the insertion of the 6th object fails, then the operation is rolled back completely which results in cleaning up the 5 inserted objects from the Database.

This method doesn't update the cache for the added objects. And also this method won't do any validation over the objects which are added into the vector. The user has to take care of setting valid name and mapName and other necessary properties for the map objects which are added in the vector.

Parameters:
className - which should be the fully qualified classname of the objects belongs to. For example it should be "com.adventnet.nms.mapdb.MapSymbol" if the vector contains only map symbol objects. Or null, if the vector contains objects of different classes.

mapObjects - a vector of map objects.

Throws:
java.rmi.RemoteException - might be thrown if any error occurs during the execution of a remote method
NmsStorageException - might be thrown if any database related error occurs
UserTransactionException - that may occur if the current transaction is timed out.

"WEBNMS_5 API Docs"

Copyright © 2013 ZOHO Corp., All Rights Reserved.