AdventNet Web NMS 4 API Specification

com.adventnet.nms.fe.common.ejb
Interface CustomSessionRemote

All Superinterfaces:
javax.ejb.EJBObject, java.rmi.Remote
All Known Subinterfaces:
AlertSessionRemote, EventSessionRemote, PerfSessionRemote, TopoSessionRemote

public interface CustomSessionRemote
extends javax.ejb.EJBObject

A common remote interface for all CustomView methods. This will be shared by all modules viz. Alert, Topo, Poll and Event Remote interfaces.

Since:
Web NMS 2.3
See Also:
EJBObject

Method Summary
 boolean createCustomView(java.lang.String userName, java.lang.String viewId, java.lang.String viewName, java.lang.String nodeType, TableColumn[] columnNames, java.util.Properties panelProps, java.util.Properties criteria)
          Adds a new custom view with the ID given, criteria specified in criteria Properties and columns to be viewed specified by columnNames.
 java.lang.String createCustomView(java.lang.String userName, java.lang.String viewName, java.lang.String nodeType, TableColumn[] columnNames, java.util.Properties panelProps, java.util.Properties criteria)
          Adds a new custom view with the criteria specified in criteria Properties and columns to be viewed specified by columnNames.
 java.util.Hashtable getAllViewIDsAndProps(java.lang.String userName)
          Returns a Hashtable containing viewID vs CustomViewProperties for all CustomViews of the user userName belonging to this module.
 ViewData getData(ViewCriteria viewCriteria)
          Retrieves the data which satisfies the CustomView criteria.
 java.util.Vector getObjectNamesWithProps(java.lang.String userName, java.util.Properties p)
          Returns a Vector of all the Persistent Object IDs matching the properties given in the argument.
 java.util.Properties getPropertiesOfObject(java.lang.String userName, java.lang.String objectname)
          Returns the Properties of the Persistent Object identified by the argument.
 int getTotalCount(java.lang.String userName, java.lang.String viewId)
          Returns total number of Objects matching the custom view viewId's criteria.
 int getTotalCount(java.lang.String userName, java.lang.String viewId, java.util.Properties criteria, boolean performOR, boolean appendCriteria)
          Returns total number of Objects matching the given criteria.
 int getTotalCount(ViewCriteria viewCriteria)
          Returns total number of Objects matching the given ViewCriteria.
 CustomViewProperties getViewProperties(java.lang.String userName, java.lang.String viewId)
          Gets all properties of the custom view for the user userName.
 boolean modifyCustomView(java.lang.String userName, java.lang.String viewId, TableColumn[] columnNames, java.util.Properties panelProps, java.util.Properties criteria)
          Modifies the columns, criteria and panel properties of the custom view.
 boolean removeCustomView(java.lang.String userName, java.lang.String viewId)
          Removes an existing custom view corresponding to the viewId given.
 boolean renameCustomView(java.lang.String userName, java.lang.String viewId, java.lang.String newName)
          Changes the display name (viewName) of the custom view.
 boolean saveViewState(java.lang.String userName, java.lang.String viewId, int viewlength, java.lang.String orderByColumn, boolean isAscendingOrder, TableColumn[] tableCol)
          This method saves the values passed i.e viewLength, orderByColumn , sort by Ascending or not and the Width of the TableColumn to the corresponding tables in the DB.
 
Methods inherited from interface javax.ejb.EJBObject
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove
 

Method Detail

createCustomView

public java.lang.String createCustomView(java.lang.String userName,
                                         java.lang.String viewName,
                                         java.lang.String nodeType,
                                         TableColumn[] columnNames,
                                         java.util.Properties panelProps,
                                         java.util.Properties criteria)
                                  throws java.rmi.RemoteException,
                                         com.adventnet.nms.fe.common.ejb.CustomViewException
Adds a new custom view with the criteria specified in criteria Properties and columns to be viewed specified by columnNames. This method returns a String which is the ID for the custom view and all further calls related to this custom view should be made with this ID as the reference. So client should retain this value. columnNames is the array of columns to be viewed in Custom view.
Parameters:
userName - : The name of the user for whom this custom view will be assigned
viewName - : The CustomView Logical Name
nodeType - : The type of the node to be represented in the tree
columns - : Properties that should be returned while getting the data. By defalt, some important properties will be returned irrespective of these selected columns
panelPros - : Extra properties of this custom view that should be stored for later use. This should contain a property with the key as parent and value as the Node ID of the parent custom view.
criteria - : Specifies the criteria. Objects matching these criteria will only be returned while getting data.
Returns:
id ID of the custom view. This id is to be used for all following calls related to this custom view.
Throws:
java.rmi.RemoteException - if a RMI error occurs
com.adventnet.nms.fe.common.ejb.CustomViewException - if an error related to Database or Custom view occurs or any of userName, viewName, nodeType, panelProps is null or invalid

createCustomView

public boolean createCustomView(java.lang.String userName,
                                java.lang.String viewId,
                                java.lang.String viewName,
                                java.lang.String nodeType,
                                TableColumn[] columnNames,
                                java.util.Properties panelProps,
                                java.util.Properties criteria)
                         throws java.rmi.RemoteException,
                                com.adventnet.nms.fe.common.ejb.CustomViewException
Adds a new custom view with the ID given, criteria specified in criteria Properties and columns to be viewed specified by columnNames. This method returns a String which is the ID for the custom view and all further calls related to this custom view should be made with this ID as the reference. So client should retain this value. columnNames is the array of columns to be viewed in Custom view.
Parameters:
userName - : The name of the user for whom this custom view will be assigned
viewId - : Custom view ID. All further queries regarding this custom view will be referenced by this Custom view ID.
viewName - : The CustomView Logical Name
nodeType - : The type of the node to be represented in the tree
columns - : Properties that should be returned while getting the data. By defalt, some important properties will be returned irrespective of these selected columns
panelPros - : Extra properties of this custom view that should be stored for later use. This should contain a property with the key as parent and value as the Node ID of the parent custom view.
criteria - : Specifies the criteria. Objects matching these criteria will only be returned while getting data.
Returns:
true if successfully created, false otherwise
Throws:
java.rmi.RemoteException - if a RMI error occurs
com.adventnet.nms.fe.common.ejb.CustomViewException - if an error related to Database or Custom view occurs or any of userName, viewId, viewName, panelProps is null or invalid

removeCustomView

public boolean removeCustomView(java.lang.String userName,
                                java.lang.String viewId)
                         throws java.rmi.RemoteException,
                                com.adventnet.nms.fe.common.ejb.CustomViewException
Removes an existing custom view corresponding to the viewId given.
Parameters:
userName - a String value
viewId - : id of the custom view
Returns:
'true' if successfully removed, 'false' otherwise
Throws:
java.rmi.RemoteException - if a RMI related error occurs
com.adventnet.nms.fe.common.ejb.CustomViewException - if Database or Custom view related error occurs or any of userName, viewId is null or invalid

modifyCustomView

public boolean modifyCustomView(java.lang.String userName,
                                java.lang.String viewId,
                                TableColumn[] columnNames,
                                java.util.Properties panelProps,
                                java.util.Properties criteria)
                         throws java.rmi.RemoteException,
                                com.adventnet.nms.fe.common.ejb.CustomViewException
Modifies the columns, criteria and panel properties of the custom view.
Parameters:
userName - : The name of the user for whom this custom view will be assigned
viewId - : Custom view ID. All further queries regarding this custom view will be referenced by this Custom view ID.
columns - : Properties that should be returned while getting the data. By defalt, some important properties will be returned irrespective of these selected columns
criteria - : Specifies the criteria. Objects matching these criteria will only be returned while getting data.
panelProps - : Extra properties of this custom view that should be stored for later use. This should contain a property with the key as parent and value as the custom view ID of the parent custom view.

If you want only the properties specified in panelProps should be present and all the old values should be deleted, then panelProps should contain an entry <UPDATE_ONLY> with a value false. By default, only those key-value pairs specified in this Properties object will be modified and other values will not be altered.

Returns:
a boolean value specifying whether the operation is successful or not.
Throws:
java.rmi.RemoteException - if a RMI related error occurs
com.adventnet.nms.fe.common.ejb.CustomViewException - if Database or Custom view related error occurs or any of userName, viewId, panelProps is null or invalid

getData

public ViewData getData(ViewCriteria viewCriteria)
                 throws java.rmi.RemoteException,
                        com.adventnet.nms.fe.common.ejb.CustomViewException
Retrieves the data which satisfies the CustomView criteria. Returns a ViewData object which contains the retrieved data. If the viewLength is 0, then all the properties would be returned starting from the startIndex.
Parameters:
viewCriteria:ViewCriteria - object containing the information about the custom view for which data has to be returned.

If the criteria specified in ViewCriteria is not null, then that Properties object will be used as the criteria. Else criteria assigned for the custom view during createCustomView will be taken.

Returns:
Data corresponding to this custom view. ViewData object contains total number of objects, Vector of required properties of the objects matching the given criteria, startIndex and viewLength.
Throws:
java.rmi.RemoteException - if an error occurs
com.adventnet.nms.fe.common.ejb.CustomViewException - if Database or Custom view related error occurs or viewCriteria is null or invalid

getTotalCount

public int getTotalCount(java.lang.String userName,
                         java.lang.String viewId)
                  throws java.rmi.RemoteException,
                         com.adventnet.nms.fe.common.ejb.CustomViewException
Returns total number of Objects matching the custom view viewId's criteria. This is same as the value of TotalLength in ViewData returned in getData method.
Parameters:
userName - name of the user whom this custom view belongs to
viewId - custom view id
Returns:
Total number of objects present matching the criteria
Throws:
com.adventnet.nms.fe.common.ejb.CustomViewException - if an error occurs or any of userName, viewId is null or empty

getTotalCount

public int getTotalCount(java.lang.String userName,
                         java.lang.String viewId,
                         java.util.Properties criteria,
                         boolean performOR,
                         boolean appendCriteria)
                  throws java.rmi.RemoteException,
                         com.adventnet.nms.fe.common.ejb.CustomViewException
Returns total number of Objects matching the given criteria. This is same as the value of TotalLength in ViewData returned in getData method.

If performOR is true, then this returns count of objects matching any of the properties given in criteria. If false, then count of objects matching all of the criteria mentioned in criteria will be returned. Note: This boolean is applicable only to criteria and has nothing to do with the criteria for the custom view viewId.

If appendCriteria is true, then criteria will be added with the criteria for the custom view viewId. If false, then only criteria will be considered.

Parameters:
userName - name of the user whom this custom view belongs to
viewId - custom view id
criteria - matching criteria.
performOR - If this is true, will return number of objects matching any of the Properties in criteria, when set to false will return number of objects matching all the matching Properties passed.
appendCriteria - If true appends criteria with the custom view viewId's criteria. Otherwise, only criteria will be taken into account.
Returns:
Total number of objects present matching the criteria.
Throws:
com.adventnet.nms.fe.common.ejb.CustomViewException - if an error occurs or any of userName, viewId or criteria is null or invalid

getTotalCount

public int getTotalCount(ViewCriteria viewCriteria)
                  throws java.rmi.RemoteException,
                         com.adventnet.nms.fe.common.ejb.CustomViewException
Returns total number of Objects matching the given ViewCriteria.

If the temporaryCustomView is true in the viewCriteria then the total returned will be based on the criteria set in the viewCriteria alone and the values viewId and userName in the viewCriteria will be ignored.

If temporaryCustomView is false in the viewCriteria, then the criteria used for creating the custom view with id as viewId for the user userName as specified by the in viewCriteria will be taken in consideration and criteria if set in the viewCriteria will be added to the base criteria based on the values of appendCriteria and performOR.

Parameters:
viewCriteria - a ViewCriteria value
Returns:
Total number of objects present matching the criteria.
Throws:
java.rmi.RemoteException - if an error occurs
com.adventnet.nms.fe.common.ejb.CustomViewException - if an error occurs or viewCriteria is null
See Also:
getData(ViewCriteria)

getViewProperties

public CustomViewProperties getViewProperties(java.lang.String userName,
                                              java.lang.String viewId)
                                       throws java.rmi.RemoteException,
                                              com.adventnet.nms.fe.common.ejb.CustomViewException
Gets all properties of the custom view for the user userName.
Parameters:
userName - : The name of the user for whom this custom view was assigned
viewId - : Custom view ID
Returns:
CustomViewProperties object containing the properties of custom view.
Throws:
java.rmi.RemoteException - if a RMI related error occurs
com.adventnet.nms.fe.common.ejb.CustomViewException - if Database or Custom view related error occurs

getAllViewIDsAndProps

public java.util.Hashtable getAllViewIDsAndProps(java.lang.String userName)
                                          throws java.rmi.RemoteException,
                                                 com.adventnet.nms.fe.common.ejb.CustomViewException
Returns a Hashtable containing viewID vs CustomViewProperties for all CustomViews of the user userName belonging to this module.
Parameters:
userName - : The name of the user whose custom views have to be returned.
Returns:
Hastable : viewId mapped to CustomViewProperties objects for all customview for the user belonging to the module of the extending class. Note:Returned CustomViewProperties won't have PanelProperties.
Throws:
java.rmi.RemoteException - : if a RMI related error occurs
com.adventnet.nms.fe.common.ejb.CustomViewException - : if Database or Custom view related error occurs or userName is null or invalid

renameCustomView

public boolean renameCustomView(java.lang.String userName,
                                java.lang.String viewId,
                                java.lang.String newName)
                         throws java.rmi.RemoteException,
                                com.adventnet.nms.fe.common.ejb.CustomViewException
Changes the display name (viewName) of the custom view.
Parameters:
userName - : The name of the user for whom this custom view was assigned
viewId - : Custom view ID
newName - : new display name for this custom view
Returns:
true if successfully renamed, false otherwise.
Throws:
java.rmi.RemoteException - if a RMI related error occurs
com.adventnet.nms.fe.common.ejb.CustomViewException - if Database or Custom view related error occurs or any of userName, viewId, newName is null or invalid

saveViewState

public boolean saveViewState(java.lang.String userName,
                             java.lang.String viewId,
                             int viewlength,
                             java.lang.String orderByColumn,
                             boolean isAscendingOrder,
                             TableColumn[] tableCol)
                      throws java.rmi.RemoteException,
                             com.adventnet.nms.fe.common.ejb.CustomViewException
This method saves the values passed i.e viewLength, orderByColumn , sort by Ascending or not and the Width of the TableColumn to the corresponding tables in the DB.
Parameters:
userName - a String Name of the user for whom CustomView state is saved.
viewId - a String Customview ID for which details are saved in DB.
viewlength - an int Viewlength to be saved.
orderByColumn - a String OrderByColumn to be saved
isAscendingOrder - a boolean value
tableCol - a TableColumn[] object with new Width for each Table Column
Returns:
a boolean value true if saved.
Throws:
java.rmi.RemoteException - if an error occurs
com.adventnet.nms.fe.common.ejb.CustomViewException - if Database or Custom view related error occurs

getObjectNamesWithProps

public java.util.Vector getObjectNamesWithProps(java.lang.String userName,
                                                java.util.Properties p)
                                         throws java.rmi.RemoteException
Returns a Vector of all the Persistent Object IDs matching the properties given in the argument. For example, in Topo this method will return a Vector of all ManagedObject names matching the properties given in the argument. Here name is the uniqueKey for ManagedObject.
Parameters:
userName - a String value for authentication
a - Properties value which contains the criteria
Returns:
a Vector which contains the unique names. for alerts, this will contain list of entities matching the criteria as specified in the arguments..
Throws:
java.rmi.RemoteException - if an error occurs

getPropertiesOfObject

public java.util.Properties getPropertiesOfObject(java.lang.String userName,
                                                  java.lang.String objectname)
                                           throws java.rmi.RemoteException
Returns the Properties of the Persistent Object identified by the argument. The given argument is the uniqueKey of that API.
Parameters:
userName - a String value for authentication
objectname - a unique value specifying the Object
Returns:
Properties of the object.
Throws:
java.rmi.RemoteException - if an error occurs

AdventNet Web NMS 4 API Specification