|
AdventNet Web NMS 4 API Specification | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.adventnet.nms.client.ClientCVAPIImpl
ClientCVAPIImpl is the implementation of the CommonClientAPI which the API users would user to manipulate with Custom Views. An abstract class which will be extended by the respective clientapi modules viz Alert, Event, Topo and Poll.
CommonClientAPI| Field Summary | |
protected java.util.Hashtable |
customViewsHT
customViewsHT acts as a cache for the custom views got from FE. |
protected java.lang.String |
lookupName
lookupName holds the value got via the getLookupName() |
protected ServerCustomViewAPI |
serverCVApi
serverCVApi holds the ServerCustomViewAPI implementation got by RMI lookup. |
protected static java.lang.String |
sessionId
sessionId holds the unique id as got from FE-Server for this client session. |
protected java.util.Vector |
temporaryCustomViews
temporaryCustomViews holds the list of the temporary custom-views. |
protected java.lang.String |
user
user holds the name of the user for whom this instance was created. |
| Constructor Summary | |
ClientCVAPIImpl(java.lang.String hostName,
int rmiRegPort,
java.lang.String userName)
Constructor with params of host name and rmi registry port of the server and user name with which the client logs in. |
|
ClientCVAPIImpl(java.lang.String hostName,
int rmiRegPort,
java.lang.String userName,
java.lang.String password)
|
|
ClientCVAPIImpl(java.lang.String hostName,
int rmiRegPort,
java.lang.String userName,
java.lang.String password,
java.lang.String cryptoClass)
|
|
ClientCVAPIImpl(java.lang.String hostName,
java.lang.String userName)
|
|
| 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. |
java.rmi.Remote |
getAPI(java.lang.String lookupName)
getAPI returns the required Remote API either by direct RMI lookup on
FE Server in the default mode or via the RMIAccessAPI's getAPI method in
case password is available. |
NmsClientTableModel |
getCustomView(java.lang.String viewId)
Returns the reference to the NmsClientTableModel instance of the given viewId if any. |
java.lang.String[] |
getCustomViewNames()
Returns the names of all custom views for the specified user in the module. |
abstract java.lang.String[] |
getDefaultDisplayFields()
getDefaultDisplayFields method returns an array of
default field names to be used as display fields for new Custom Views. |
abstract java.lang.String[] |
getDefaultDisplayLabels()
getDefaultDisplayLabels method returns an array of
default labels (display names) for the fields in the Custom View. |
protected abstract java.lang.String |
getKeyFieldName()
getKeyFieldName returns the name of the property
by which the Object is uniquely identified. |
protected abstract java.lang.String |
getLookupName()
getLookupName returns the name to be used for RMI lookup. |
ServerCustomViewAPI |
getServerAPI()
Deprecated. since direct usage of serverside API is not recommended. Any communication with the server should be made via the CommonClientAPI |
java.lang.String |
getSessionId()
getSessionId method returns the sessionId with which
the client communicates with the FE-Server for Custom View related operations like
registering/unregistering for updates, getting data for the custom view, etc.,. |
java.lang.String |
getUserName()
getUserName returns the user name for whom this instance was
created. |
protected abstract boolean |
isShowLatest()
isShowLatest specifies whether or not a module
shows the latest objects (objects created/updated lately) always. |
boolean |
removeCustomView(java.lang.String viewId)
Cleans up the custom view given the viewId. |
NmsClientTableModel |
retrieveCustomView(java.lang.String viewId)
Can be used to retrieve an already saved custom view. |
boolean |
saveCustomView(java.lang.String viewId)
Saves the Custom View of the given name for the current user for persistence. |
boolean |
saveCustomViewForAll(java.lang.String viewId)
Saves the Custom View of the given name for all users. |
void |
showDialog()
showDialog this synchronized method is called whenever any connectionException is thrown
Brings up the connection lost popup message only during the first call |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.lang.String lookupName
lookupName holds the value got via the getLookupName()protected java.util.Hashtable customViewsHT
customViewsHT acts as a cache for the custom views got from FE.protected java.util.Vector temporaryCustomViews
temporaryCustomViews holds the list of the temporary custom-views.protected java.lang.String user
user holds the name of the user for whom this instance was created.protected ServerCustomViewAPI serverCVApi
serverCVApi holds the ServerCustomViewAPI implementation got by RMI lookup.protected static java.lang.String sessionId
sessionId holds the unique id as got from FE-Server for this client session.| Constructor Detail |
public ClientCVAPIImpl(java.lang.String hostName,
java.lang.String userName)
public ClientCVAPIImpl(java.lang.String hostName,
int rmiRegPort,
java.lang.String userName)
public ClientCVAPIImpl(java.lang.String hostName,
int rmiRegPort,
java.lang.String userName,
java.lang.String password)
throws java.lang.Exception
public ClientCVAPIImpl(java.lang.String hostName,
int rmiRegPort,
java.lang.String userName,
java.lang.String password,
java.lang.String cryptoClass)
throws java.lang.Exception
| Method Detail |
public java.rmi.Remote getAPI(java.lang.String lookupName)
throws java.rmi.RemoteException,
java.rmi.NotBoundException,
java.net.MalformedURLException,
com.adventnet.nms.client.RMIAccessException,
AuthenticationException
getAPI returns the required Remote API either by direct RMI lookup on
FE Server in the default mode or via the RMIAccessAPI's getAPI method in
case password is available. The second mode is the only way of getting an API in case
the WebNMS is started in the "Secure RMI Mode". The password should have been
made available when creating an instance of this class (via the constructor).lookupName - the API name to lookuppublic java.lang.String[] getCustomViewNames()
getCustomViewNames in interface CommonClientAPIcom.adventnet.nms.client.CommonClientAPIpublic boolean saveCustomView(java.lang.String viewId)
CommonClientAPI
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.
saveCustomView in interface CommonClientAPIcom.adventnet.nms.client.CommonClientAPIname - The name of the Custom View to be saved.public boolean saveCustomViewForAll(java.lang.String viewId)
CommonClientAPIAs 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.
saveCustomViewForAll in interface CommonClientAPIcom.adventnet.nms.client.CommonClientAPIpublic boolean removeCustomView(java.lang.String viewId)
removeCustomView in interface CommonClientAPIcom.adventnet.nms.client.CommonClientAPIname - The name of the Custom View to be removed.public NmsClientTableModel createCustomView(java.lang.String name)
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 method will return 'null' if 'null' value is given for the CustomView name.
createCustomView in interface CommonClientAPI
public NmsClientTableModel createCustomView(java.lang.String name,
int increment)
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.
createCustomView in interface CommonClientAPIname - The name with which the Custom View is to be created.increment - The value by which the Custom Views should get incremented. If a negative value
or zero is given for this parameter, Custom View will get created with default
increment value as 10.
The method will return 'null' if 'null' value is given for the CustomView name.
public NmsClientTableModel createCustomView(java.lang.String name,
java.util.Properties criteria)
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 alerts of categories starting with "LXE" between the time frame of say time1 //No Internationalisation 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");//No Internationalisation
criteria.put("category", "LXE*");//No Internationalisation
criteria.put("time", " "+time1+" and "+time2);//No Internationalisation
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.//No Internationalisation
Wildcards like astrick (*), not (!) and comma (,) can be used in the
criteria.
The method will return 'null' if 'null' value is given for the CustomView name.
- Specified by:
createCustomView in interface CommonClientAPI
- Returns:
- An instance of NmsClientTableModel implemention which could be
made use of thereafter to iterate through the resulting set of objects.
public NmsClientTableModel createCustomView(java.lang.String name,
java.util.Properties criteria,
int increment)
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.
createCustomView in interface CommonClientAPIname - The name with which the Custom View is to be created.increment - The value by which the Custom Views should get incremented. If a negative value
or zero is given for this parameter, Custom View will get created with default
increment value as 10.
The method will return 'null' if 'null' value is given for the CustomView name.
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)
CommonClientAPIcreateCustomView 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 CommonClientAPI.saveCustomView(String) method.
createCustomView in interface CommonClientAPIcom.adventnet.nms.client.CommonClientAPIviewId - a String value to represent the Custom Viewcriteria - a Properties value specifying the criteria for the Custom Viewincrement - 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.NmsClientTableModel implemention which could be
made use of thereafter to iterate through the resulting set of objects.public NmsClientTableModel retrieveCustomView(java.lang.String viewId)
retrieveCustomView in interface CommonClientAPIcom.adventnet.nms.client.CommonClientAPIname - The name of the Custom View, already created, for which the
NmsClientTableModel is required.public NmsClientTableModel getCustomView(java.lang.String viewId)
getCustomView in interface CommonClientAPIcom.adventnet.nms.client.CommonClientAPIname - The name of the Custom View, already created, for which the
NmsClientTableModel is required.protected abstract java.lang.String getLookupName()
getLookupName returns the name to be used for RMI lookup.
The RMI lookup with this name should return a reference to a class
which implements ServerCustomViewAPI.String value of the name to used for lookupprotected abstract java.lang.String getKeyFieldName()
getKeyFieldName returns the name of the property
by which the Object is uniquely identified.public abstract 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()getDefaultDisplayFields in interface CommonClientAPIString[] of display fields for the new Custom View.public abstract 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()
getDefaultDisplayLabels in interface CommonClientAPIString[] valueprotected abstract boolean isShowLatest()
isShowLatest specifies whether or not a module
shows the latest objects (objects created/updated lately) always.
If this returns true and if the objects in the Custom View show the latest, then the view will get updated such that it will always contain the latest.
For example, if the custom view contains 95 objects and and what is being currently viewed is from 86 to 95 (latest) with the view length of 10. The view can be specified as [86 to 95 of 95].
Say a new object gets added increasing the total to 96 for this custom view.
Now if this method were to return true, then the row gets added in the view, with the range changing to [87 to 96 of 96] example : Event module custom views.
If this method returns false, then the rows stay unaffected, with the total alone changing .Hence the view will be [86 to 95 of 96]. You may see the 96th row by doing a query for next set of rows. example : Topo module custom views.
boolean value whether to showlatest or not.public ServerCustomViewAPI getServerAPI()
getServerAPI method returns the reference to the module specific
implementation of ServerCustomViewAPI, the same which
was got by RMI lookup.ServerCustomViewAPI of that module.public java.lang.String getUserName()
getUserName returns the user name for whom this instance was
created. The same can be used for interacting with FE.String value of the userName.public java.lang.String getSessionId()
getSessionId method returns the sessionId with which
the client communicates with the FE-Server for Custom View related operations like
registering/unregistering for updates, getting data for the custom view, etc.,.String value of the session's id as got from FE-Server.public void showDialog()
showDialog this synchronized method is called whenever any connectionException is thrown
Brings up the connection lost popup message only during the first call
|
AdventNet Web NMS 4 API Specification | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||