AdventNet Web NMS 4 API Specification

com.adventnet.nms.client
Interface CommonClientAPI

All Known Subinterfaces:
ClientAlertAPI, ClientAuditAPI, ClientEventAPI, ClientPollAPI, ClientTopoAPI
All Known Implementing Classes:
ClientCVAPIImpl

public interface CommonClientAPI

CommonClientAPI is the API interface for the Client side API implementation of CustomView manipulations. It mainly deals with the creating, saving and retrieving of CustomViews. The implementation of this interface (say ClientEventAPIImpl ) takes care of interacting with its server-side counterpart (say ServerEventFactoryAPIImpl ) and aids in the creation, deletion, saving and retrieval of CustomViews.


Method Summary
 NmsClientTableModel createCustomView(java.lang.String name)
          To create a custom view of the given name without any criteria and increment.
 NmsClientTableModel createCustomView(java.lang.String name, int increment)
          To create a custom view of the given name without any criteria and a preset increment value.
 NmsClientTableModel createCustomView(java.lang.String name, java.util.Properties criteria)
          To create a custom view of the given name with a preset criteria and no preset increment value.
 NmsClientTableModel createCustomView(java.lang.String name, java.util.Properties criteria, int increment)
          To create a custom view of the given name with a preset criteria and a preset increment value.
 NmsClientTableModel createCustomView(java.lang.String viewId, java.util.Properties criteria, int increment, java.lang.String[] displayFields, java.lang.String[] displayLabels, java.util.Properties panelProps)
          createCustomView method takes in the displayFields and their corresponding displayLabels when creating a Custom View.
 NmsClientTableModel getCustomView(java.lang.String name)
          Deprecated. Another method of similar functionlity exists retrieveCustomView(String)
 java.lang.String[] getCustomViewNames()
          Returns the names of all custom views for this user.
 java.lang.String[] getDefaultDisplayFields()
          getDefaultDisplayFields method returns an array of default field names to be used as display fields for new Custom Views.
 java.lang.String[] getDefaultDisplayLabels()
          getDefaultDisplayLabels method returns an array of default labels (display names) for the fields in the Custom View.
 boolean removeCustomView(java.lang.String name)
          Removes and cleans up the Custom view of the given name on the client and its counterpart on the server.
 NmsClientTableModel retrieveCustomView(java.lang.String name)
          To retrieve an already saved CustomView.
 boolean saveCustomView(java.lang.String name)
          Saves the Custom View of the given name for the current user for persistence.
 boolean saveCustomViewForAll(java.lang.String name)
          Saves the Custom View of the given name for all users.
 

Method Detail

createCustomView

public NmsClientTableModel createCustomView(java.lang.String name)
                                     throws java.rmi.RemoteException
To create a custom view of the given name without any criteria and increment. Presently when no increment value is specified a default of 10 is assumed. Using the returned NmsClientTableModel instance you could set the other options (like criteria properties, increment value, etc) even later.

Note that when no criteria is set for the Custom View model, all the objects are retrieved (It will be a catch all view). And when you set some criteria, only those objects matching the criteria are retrieved by the model.

Parameters:
name - The name for the Custom View.
Returns:
An instance of NmsClientTableModel implemention which could be made use of thereafter to iterate through the resulting set of objects.

createCustomView

public NmsClientTableModel createCustomView(java.lang.String name,
                                            int increment)
                                     throws java.rmi.RemoteException
To create a custom view of the given name without any criteria and a preset increment value.

Using the returned NmsClientTableModel instance you could set the other options (like criteria properties, etc) even later.

Note that when no criteria is set for the Custom View model, all the objects are retrieved (It will be a catch all view). And when you set some criteria, only those objects matching the criteria are retrieved by the model.

Parameters:
name - The name for the Custom View.
increment - The value by which to navigate the Custom View using getNext(), getPrevious() , etc., of the NmsClientTableModel. The increment value can be changed later using the setIncrement method of NmsClientTableModel.
Returns:
An instance of NmsClientTableModel implemention which could be made use of thereafter to iterate through the resulting set of objects.

createCustomView

public NmsClientTableModel createCustomView(java.lang.String name,
                                            java.util.Properties criteria)
                                     throws java.rmi.RemoteException
To create a custom view of the given name with a preset criteria and no preset increment value. Presently when no increment value is specified a default of 10 is assumed.

Note that when no criteria is set for the Custom View model, all the objects are retrieved (It will be a catch all view). And when you set some criteria, only those objects matching the criteria are retrieved by the model.

The criteria Properties you give could be something like the following. For example when you want to retrieve all critical and major events of categories starting with "LXE" between the time frame of say time1 and time2 (where time1 and time2 are the strings containing the long representation of the dates) then it would be

 Properties criteria = new Properties();
 criteria.put("stringseverity", "critical, major");
 criteria.put("category", "LXE*");
 criteria.put("time", " "+time1+" and "+time2);
 
To be more clear about how you could use the time in the criteria the above example criteria should result in something like

 " 167868778 and 87536743" for the "time" key.
 
Wildcards like astrick (*), not (!) and comma (,) can be used in the criteria.

Parameters:
name - The name for the Custom View.
criteria - The Properties to be satisfied, for an object to be in the Custom View. The criteria can be changed later using the changeCriteriaProperties method of NmsClientTableModel.
Returns:
An instance of NmsClientTableModel implemention which could be made use of thereafter to iterate through the resulting set of objects.

createCustomView

public NmsClientTableModel createCustomView(java.lang.String name,
                                            java.util.Properties criteria,
                                            int increment)
                                     throws java.rmi.RemoteException
To create a custom view of the given name with a preset criteria and a preset increment value.

Note that when no criteria is set for the Custom View model, all the objects are retrieved (It will be a catch all view). And when you set some criteria, only those objects matching the criteria are retrieved by the model.

Parameters:
name - The name for the Custom View.
increment - The value by which to navigate the Custom View using getNext(), getPrevious() , etc., of the NmsClientTableModel. The increment value can be changed later using the setIncrement method of NmsClientTableModel.
criteria - The Properties to be satisfied, for an object to be in the Custom View. The criteria can be changed later using the changeCriteriaProperties method of NmsClientTableModel. Some more details on criteria in createCustomView(String,Properties)
Returns:
An instance of NmsClientTableModel implemention which could be made use of thereafter to iterate through the resulting set of objects.

createCustomView

public NmsClientTableModel createCustomView(java.lang.String viewId,
                                            java.util.Properties criteria,
                                            int increment,
                                            java.lang.String[] displayFields,
                                            java.lang.String[] displayLabels,
                                            java.util.Properties panelProps)
createCustomView method takes in the displayFields and their corresponding displayLabels when creating a Custom View. The additional properties related to the custom view may be specified in the panelProps. If the parent node for this custom view needs to be specified, it can be done so by setting the by setting the value in the panelProps with key as "parent"

As from Web NMS 2.3, creating a custom view saves the same by default. If you want to just add the custom view and not save, then you will have to set a property "temporaryCustomView" with value as "true" in the panelProps. You may later save this view using the saveCustomView(String) method.

Parameters:
viewId - a String value to represent the Custom View
criteria - a Properties value specifying the criteria for the Custom View
increment - an int value by which the view is to be incremented. If invalid value is given( negative or 0) , default value 10 is taken.
displayFields - a String[] value specifying the display fields for the view. This should not be null.
displayLabels - a String[] value specifying the display labels for the view. This should be equal in length to the displayFields.
panelProps - a Properties value of the additional properties of that view. This should contain a property with the key as parent and value as the Node ID of the parent node in the tree.
Returns:
a NmsClientTableModel implemention which could be made use of thereafter to iterate through the resulting set of objects.

retrieveCustomView

public NmsClientTableModel retrieveCustomView(java.lang.String name)
                                       throws java.rmi.RemoteException
To retrieve an already saved CustomView. This would be useful when you need to retrieve the persistent Custom Views.

Parameters:
name - The name of the Custom View, already created, for which the NmsClientTableModel is required.
Returns:
An instance of NmsClientTableModel implemention which could be made use of thereafter to iterate through the resulting set of objects. Returns null if the name is null or an empty String.

getCustomView

public NmsClientTableModel getCustomView(java.lang.String name)
                                  throws java.rmi.RemoteException
Deprecated. Another method of similar functionlity exists retrieveCustomView(String)

This method would return the NmsClientTableModel reference given its name.

The API keeps track of all custom views created, retrieved or removed. Users of the API needn't worry about caching the instances of the created or retrieved NmsClientTableModels (which represent the custom views). All these are taken care of by the API.

Parameters:
name - The name of the Custom View, already created, for which the NmsClientTableModel is required.
Returns:
An instance of NmsClientTableModel implemention which could be made use of thereafter to iterate through the resulting set of objects. Returns null if the name is null or an empty String.

getCustomViewNames

public java.lang.String[] getCustomViewNames()
                                      throws java.rmi.RemoteException
Returns the names of all custom views for this user.
Returns:
the array of custom view names or null if there are none.

saveCustomView

public boolean saveCustomView(java.lang.String name)
                       throws java.rmi.RemoteException
Saves the Custom View of the given name for the current user for persistence.

As from Web NMS 2.3, creating a custom view saves the same by default. If you want to just add the custom view and not save, then you will have to set a property "temporaryCustomView" with value as "true" in the panelProps when adding a custom view.

Such a temporary custom view can be saved by using this method.

Parameters:
name - The name of the Custom View to be saved.
Returns:
true on success

saveCustomViewForAll

public boolean saveCustomViewForAll(java.lang.String name)
                             throws java.rmi.RemoteException
Saves the Custom View of the given name for all users.

As from Web NMS 2.3, creating a custom view saves the same by default. If you want to just add the custom view and not save, then you will have to set a property "temporaryCustomView" with value as "true" in the panelProps when adding a custom view.

Such a temporary custom view can be saved by using this method.

Returns:
true on success

removeCustomView

public boolean removeCustomView(java.lang.String name)
                         throws java.rmi.RemoteException
Removes and cleans up the Custom view of the given name on the client and its counterpart on the server.
Parameters:
name - The name of the Custom View to be removed.
Returns:
true on success

getDefaultDisplayFields

public java.lang.String[] getDefaultDisplayFields()
getDefaultDisplayFields method returns an array of default field names to be used as display fields for new Custom Views. These are a subset of the property names for an Object in that module. The labels that are displayed for these fields are available in getDefaultDisplayLabels()
Returns:
a String[] of display fields for the new Custom View.

getDefaultDisplayLabels

public java.lang.String[] getDefaultDisplayLabels()
getDefaultDisplayLabels method returns an array of default labels (display names) for the fields in the Custom View.

The size of the array returned by this method should match with those returned by getDefaultDisplayFields()

Returns:
a String[] value

AdventNet Web NMS 4 API Specification