|
Web NMS has different modules, such as Topology, Fault, Performance. Each module has different base objects which are software representation of real world entities. For example, a network element is represented as a Managed Object (software representation), a failure in the network is represented as an Alert, and so on.
Being a framework, Web NMS provides some default properties to deal with these software representations. But in the case of domain specific customization, it is required to have more properties in those objects. The following section explains the approaches through which you can add more properties based on your requirement.
The following are three ways in which you can add your own custom properties:
This option allows you to extend the schema of the table and add additional properties to it. Web NMS takes care of data storage and retrieval for the additional properties. Objects that support Dynamic Schema Extension are Event, Alert, PolledData, MapContainer, MapGroup, MapLink, MapSymbol, and all Topology tables.
For the modules whose objects are modeled with Hibernate
like Topology, Fault Management, Map and Performance Management, in the
object's mapping file for which the property is to be added dynamically,
add a property tag with access attribute as in below sample tag.
For example if you need to add a new property to ManagedObject through
Dynamic Schema Extension, then add a below tag to ManagedObject.hbm.xml
file.
|
<property name="LOCATION" type="string" column="LOCATION" length="100" access="com.adventnet.nms.store.relational.hbn.DynamicPropertyAccessor"/> |
where location is the property of string data type with column name LOCATION and length 100.
|
|
Note: For
properties of type String and
Integer, the access classes are
DynamicPropertyAccessor, and IntegerDynamicPropertyAccessor respectively.
The implementation for Integer datatype is available in the <Web
NMS Home>/default_impl/dynamic_schema_extension folder as IntegerDynamicPropertyAccessor.java.
For other datatypes, refer to the README.html to
write your own implementation for the accessor class. |
Choose this option to add your own properties when
you are at the object modeling phase during design/development time
you need to add 3 to 5 additional properties.
you need to add additional properties only to the same type of objects (i.e., when no object is extended)
Decide on the additional properties to be created.
Add the new property to ManagedObject through Dynamic Schema Extension by adding a new tag to ManagedObject.hbm.xml file.
Add the additional properties to the object using its setProperties() method. To retrieve the properties of an object (including additional properties), use the getProperties() method.
Example
Further, while adding alert objects in the database, set the value for EVENTCOUNT as shown below:
Alert a = new Alert();
Properties prop = new Properties();
prop.setProperty("eventCount","1");
a.setProperties(prop);
Web NMS takes care of adding the value of eventCount into the column EVENTCOUNT of Alert table.
To add/modify/delete/retrieve an object's details, only one data manipulation command will be required as the base properties and additional properties are stored in the same table. Hence this option is advantageous as no extra query is required for object persistence into the database.
This option allows you to create user defined objects extending the base class or its derived class and thus in turn add additional properties. The properties of the base class will be stored in the table already available for it. For storing additional properties, you need to create another table. Objects that can be extended to store additional properties are Event, Alert, PolledData, ManagedObject and its derived classes.
Choose this option to add your own properties when
you are at the object modeling phase during design/development time
you need to add more than 5 additional properties
you need to add different additional properties to different types of objects extended from a base class.
Assume, you need to define three objects, ATypeNode, BTypeNode, and CTypeNode, derivatives of Node, and you need to add properties X and Y for ATypeNode, M and N for BTypeNode, and D and E for CTypeNode. In such a case, extending the object Node and adding the additional properties would be the right choice when compared to other approaches.
For complete information, refer Extended Alert topic.
To add/modify/delete an object's details, two data manipulation commands are required - one query for the base table and another for the extended table.
Hereafter, in Web NMS the module specific user properties tables like TOPOUSERPROPS, EVENTUSERPROPS, etc are commented. For example, ALERTUSERPROPS can be used to store the additional properties of the Alert object. EVENTUSERPROPS can be used to store the additional properties of the Event object. Each additional property will be stored in a separate row in the table.
All these tables will not be created, by default. If there is requirement to add any new property to the object, the same can be achieved using the dynamic schema extension. For every entry for an object in these tables will require a query and processing the ResultSet will all affect the performance. You are recommended not to use the user properties table hereafter.
|
|
Note: If the setUserProperty() method is called for a property that is not a default property or dynamically added property, the property will not be saved into database. |
However the user properties table can be enabled before server start
up by following the below steps.
Steps to enable user properties:
In the object mapping file say ManagedObject.hbm.xml or Event.hbm.xml or Alert.hbm.xml file, un-comment the map tag available at the end of the file.
For Topology module, ManagedObject.hbm.xml
needs to be modified. Similarly, for events and alerts, Event.hbm.xml
and Alert.hbm.xml file respectively.
where
ManagedObject.hbm.xml file will
be available under <Web NMS HOME>/classes/hbnlib/com/adventnet/nms/topodb
directory.
Event.hbm.xml file will be available
under <Web NMS HOME>/classes/hbnlib/com/adventnet/nms/eventdb
directory.
Alert.hbm.xml file will be available
under <Web NMS HOME>/classes/hbnlib/com/adventnet/nms/alertdb
directory.
A sample map tag in ManagedObject.hbm.xml
file which needs to be un-commented is as below.
|
<map name="mappedProperties" table="TOPOUSERPROPS"> |
In the DatabaseSchema.conf file, search for the alter queries of the table say TOPOUSERPROPS, EVENTUSERPROPS or ALERTUSERPROPS and un-comment the 2 alter queries available for that table.
In the NmsProcessFE.conf file available under <Web NMS HOME>/conf directory, search for IGNORE_ALERTUSERPROPS and IGNORE_EVENTUSERPROPS and set them to false. Note that this need not be done for topology module.
|
|
Note: For map module, no change is required as mentioned above. The user properties are enabled by default. |
Choose this option to add your own properties when
you need to add additional properties to any object at runtime.
you require a quick solution (of additional properties) after design/development phase.
you require to add only one or two properties (and not more). Note: It is advised not to use the 'User Properties' extensively, as this might greatly affect the performance level.
Additional properties can be added to the object using the setUserProperty() method, for example, setUserProperty of alert object. The property name and value has to be provided as arguments. Additional properties added using this method are stored in the associated predefined table.
To add/modify/delete/retrieve an object's details, n + 1 data manipulation commands will be required. One for the base table and n for the User properties table depending on the number of user properties (i.e., n).
Topology > Modeling/Defining ManagedObjects for Specific Network Elements
Fault Management > Designing for High Performance
Performance Management > Dynamic Table Creation
|