"WEBNMS_5 API Docs"

com.adventnet.security.authorization
Interface CustomViewScopeAPI

All Superinterfaces:
AuthorizationAdmin, java.rmi.Remote

public interface CustomViewScopeAPI
extends AuthorizationAdmin

This class used to provide the Custom View Scope support for framework in Web NMS. The Custom View Scope is the collection of module specific authorized views which belong to different user/group based on their security level. This interface class extends the AuthorizationAdmin which is used to define basic security polcies.

Here is some sample code showing how the CustomViewScopeAPI might be used:

 
 //Accessing CustomViewScopeAPI via RMI
 try
 {
     cvsapi = (CustomViewScopeAPI) Naming. lookup ("//[NMSServer]/NmsAuthAdminAPI");
     System.out.println ( "Successfully got the handle for CustomViewScopeAPI");
 }
 catch (Exception remoteException) 
 {
     System.out.println ( "Error in getting the handle for CustomViewScopeAPI"); 
 }

 

// Accessing CustomViewScopeAPI from the same JVM cvsapi = (CustomViewScopeAPI) NmsUtil.getAPI ("NmsAuthAdminAPI");

// Accessing CustomViewScopeAPI via RMIAccessAPI in the NMS RMI secure mode try { RMIAccessAPI rmiApi = Naming.lookup ("//[NMSServer]/RMIAccessAPI"); cvsapi = (CustomViewScopeAPI) rmiApi.getAPI ( userName , password , "NmsAuthAdminAPI" ); } catch (Exception remoteException) { System.out.println ( "Error in getting the handle for CustomViewScopeAPI"); } // create a CustomViewScope here, cvsapi.createCVScope("cvscope"); // create an AuthorizedView with some criteria Properties criteria = new Properties(); criteria.setProperty("severity","2"); //Major has severity 2 criteria.setProperty("entity","s*"); //entity starts with 's' AuthorizedViewObject avo = new AuthorizedViewObject(); avo.setAuthorizedViewName("authorizedView"); avo.setViewProperties(criteria); cvsapi.createAuthorizedView(avo); // AuthorizedView created. // Now assign this authorizedView to both CVScope and group. cvsapi.assignViewToCVScope("cvscope","authorizedView"); cvsapi.assignViewToGroup("groupName","authorizedView"); Now the users belong to the group 'groupName' can see only those objects which have the specified criteria. // To view the criteria for an user Properties[] p = cvsapi.getCriteria("cvscope","userName");

See Also:
AuthorizationAdmin

Method Summary
 boolean assignViewToCVScope(java.lang.String cvscope, java.lang.String view)
          Method for associating Authorized View name with Custom View Scope.
 boolean assignViewToCVScope(java.lang.String cvscope, java.util.Vector viewsVector)
          Method for assigning Vector of Authorized View Names to Custom View Scope.
 boolean assignViewToCVScope(java.lang.String cvscope, java.util.Vector viewsVector, java.util.Properties prop)
          Method for assigning Vector of Authorized View names to Custom View Scope.
 boolean assignViewToGroup(java.lang.String groupName, java.util.Vector authViews)
          Method for assigning a set of authorizedviews to a group.
 boolean createCVScope(java.lang.String cvscope)
          Method to create a Custom view Scope (CVS).
 java.util.Vector getAllAuthorizedViews()
          Method to get All authorized Views that have Properties.
 java.util.Vector getAllCustomViewScope()
          Method to get All custom View scope names.
 java.util.Properties[] getCriteria(java.lang.String cvscope, java.lang.String userName)
          Method to get Array of Properties for the User with respect to Custom View Scope.
 java.util.Vector getCVScopeForGroup(java.lang.String groupName)
          Method to get All Custom View Scopes associated with the group.
 java.util.Vector getCVScopeForUser(java.lang.String userName)
          Method to get All Custom View Scopes associated with the user.
 java.util.Vector getCVScopeForView(java.lang.String view)
          Method to get All Custom View Scope names for an Authorized View Name.
 java.util.Hashtable getDescription(java.lang.String nodeName)
          Method to get ALL descriptions for any parent node present in the conf file "securityDescription.xml".
 java.util.Properties getPropertyNamesForCustomViewScope()
          Method for getting all property names of CustomViewScopes which would be useful while creating authorized views.
 java.util.Vector getViewsForCVScope(java.lang.String cvscope)
          Method to get All authorized View names associated with Custom View Scope name.
 boolean modifyViewProperty(java.lang.String ViewName, java.util.Properties viewProp)
          Method to modify Properties for a Authorized View.
 boolean removeAuthorizedView(java.lang.String authView)
          Method for removing authorizedView Completely from the data store.
 boolean removeCVScope(java.lang.String cvscope)
          Method to remove Custom view Scope.
 boolean removeViewFromCVScope(java.lang.String cvscope, java.lang.String view)
          Method to remove the Authorized View name association from the Custom View Scope.
 boolean removeViewFromGroup(java.lang.String groupName, java.util.Vector authViews)
          Method for removing a set of authViews from a group.
 void setDescription(java.lang.String nodeName, java.util.Hashtable descData)
          Method to set Descriptions for any user,group, or operatrion.
 
Methods inherited from interface com.adventnet.security.authorization.AuthorizationAdmin
addOperation, assignOperationToView, assignOperationToView, assignOperationToView, assignOperationToView, assignOperationToView, assignOperationToView, assignOperationToView, assignOperationToView, assignOperationToViewAndGroup, assignOperationToViewAndGroup, assignUserToGroup, assignUserToGroup, assignUserToGroup, assignUserToGroup, assignViewToGroup, assignViewToGroup, assignViewToGroup, assignViewToGroup, changePassword, changePassword, createAuthorizedView, createAuthorizedView, createUser, createUser, createUserForOwner, createUserForOwner, deRegisterFromAllUpdates, deRegisterFromOperationUpdates, deRegisterFromUserUpdates, getAllAttributes, getAllGroupNames, getAllGroups, getAllOperations, getAllUserNames, getAllViewNames, getDescriptiveName, getOperationsForView, getOperationsForViewInHash, getPasswordAge, getUserExpirationTime, getUsers, init, isUserNamePresent, isUserNamePresent, registerForAllUpdates, registerForOperationUpdates, registerForUserUpdates, removeAuthorizedView, removeOperation, removeOperation, removeOperation, removeOperationFromView, removeOperationsFromView, removeOwnerFromGroup, removeOwnerFromGroup, removeOwnerFromUser, removeOwnerFromUser, removeOwnerFromView, removeOwnerFromView, removeUser, removeUser, removeUserFromGroup, removeUserFromGroup, removeUserFromGroup, removeViewFromGroup, removeViewFromGroup, setDescriptiveName, setPasswordAge, setUserExpirationTime, setUserStatus, updateXML
 

Method Detail

createCVScope

boolean createCVScope(java.lang.String cvscope)
                      throws AuthorizationException,
                             java.rmi.RemoteException
Method to create a Custom view Scope (CVS).

Parameters:
cvscope - Name of CVS to be created.
Returns:
True, if created successfully.Otherwise false.
Throws:
AuthorizationException - In case of any error while query.
java.rmi.RemoteException - In case of RMI.

removeCVScope

boolean removeCVScope(java.lang.String cvscope)
                      throws AuthorizationException,
                             java.rmi.RemoteException
Method to remove Custom view Scope.

Parameters:
cvscope - CVS name to be removed.
Returns:
True,if removed successfully.Otherwise false.
Throws:
AuthorizationException - In case of any error while query.
java.rmi.RemoteException - In case of RMI.

assignViewToCVScope

boolean assignViewToCVScope(java.lang.String cvscope,
                            java.lang.String view)
                            throws AuthorizationException,
                                   java.rmi.RemoteException
Method for associating Authorized View name with Custom View Scope.

Parameters:
cvscope - Name of the Custom View Scope.
view - Name of the Authorized View Name.
Returns:
True,if assigned successfully.Otherwise false.
Throws:
AuthorizationException - In case of any error while query.
java.rmi.RemoteException - In case of RMI.

assignViewToCVScope

boolean assignViewToCVScope(java.lang.String cvscope,
                            java.util.Vector viewsVector)
                            throws AuthorizationException,
                                   java.rmi.RemoteException
Method for assigning Vector of Authorized View Names to Custom View Scope.

Parameters:
cvscope - Name of the Custom View Scope.
viewsVector - Authorized View Names.
Returns:
True, if all the authorized View Names are associated with Custom View Scope.
Throws:
AuthorizationException - In case of any error while query.
java.rmi.RemoteException - In case of RMI.

assignViewToCVScope

boolean assignViewToCVScope(java.lang.String cvscope,
                            java.util.Vector viewsVector,
                            java.util.Properties prop)
                            throws AuthorizationException,
                                   java.rmi.RemoteException
Method for assigning Vector of Authorized View names to Custom View Scope.

Parameters:
cvscope - Name of the Custom View Scope.
viewVector - Authorized View Name
prop - Properties of the Authorized View Object
Returns:
True, if the datatype is valid for the assigned value of authorized Object and if all the authorized View Names are assosciated with Custom View Scope
Throws:
AuthorizationException - In case of any error while query.
java.rmi.RemoteException - In caes of RMI

removeViewFromCVScope

boolean removeViewFromCVScope(java.lang.String cvscope,
                              java.lang.String view)
                              throws AuthorizationException,
                                     java.rmi.RemoteException
Method to remove the Authorized View name association from the Custom View Scope.

Parameters:
cvscope - Name of the Custom View Scope.
view - Name of the Authorized View Name.
Returns:
True, if removed properly.Otherwise false.
Throws:
AuthorizationException - In case of any error while query.
java.rmi.RemoteException - In case of RMI.

getViewsForCVScope

java.util.Vector getViewsForCVScope(java.lang.String cvscope)
                                    throws AuthorizationException,
                                           java.rmi.RemoteException
Method to get All authorized View names associated with Custom View Scope name.

Parameters:
cvscope - Name of the Custom View.
Returns:
Vector Authorized View names associated with Custom View.
Throws:
AuthorizationException - In case of any error while query.
java.rmi.RemoteException - In case of RMI.

getCVScopeForView

java.util.Vector getCVScopeForView(java.lang.String view)
                                   throws AuthorizationException,
                                          java.rmi.RemoteException
Method to get All Custom View Scope names for an Authorized View Name.

Parameters:
view - Name of the View for which Custom Views are needed.
Returns:
Vector Custom View Scopes associated with view.
Throws:
AuthorizationException - In case of any error while query.
java.rmi.RemoteException - In case of RMI.

getCriteria

java.util.Properties[] getCriteria(java.lang.String cvscope,
                                   java.lang.String userName)
                                   throws AuthorizationException,
                                          java.rmi.RemoteException
Method to get Array of Properties for the User with respect to Custom View Scope.

Parameters:
cvscope - Name of the Custom View Scope.
userName - User for whom Criteria are needed.
Returns:
Properties[] Array of Properties for the user with respect to Custom View Scope.
Throws:
AuthorizationException - In case of any error while query.
java.rmi.RemoteException - In case of RMI.

getCVScopeForUser

java.util.Vector getCVScopeForUser(java.lang.String userName)
                                   throws AuthorizationException,
                                          java.rmi.RemoteException
Method to get All Custom View Scopes associated with the user.

Parameters:
userName - Name of the user for whom Custom Views are required.
Returns:
Vector of Custom Views for this User.
Throws:
AuthorizationException - In case of any error while query.
java.rmi.RemoteException - In case of RMI.

getCVScopeForGroup

java.util.Vector getCVScopeForGroup(java.lang.String groupName)
                                    throws AuthorizationException,
                                           java.rmi.RemoteException
Method to get All Custom View Scopes associated with the group.

Parameters:
groupName - Name of the group for which Custom Views are required.
Returns:
Vector of Custom Views for this Group.
Throws:
AuthorizationException - In case of any error while query.
java.rmi.RemoteException - In case of RMI.

getAllCustomViewScope

java.util.Vector getAllCustomViewScope()
                                       throws AuthorizationException,
                                              java.rmi.RemoteException
Method to get All custom View scope names.

Returns:
Vector of Custom View Scopes.
Throws:
AuthorizationException - In case of any error while query.
java.rmi.RemoteException - In case of RMI.

getDescription

java.util.Hashtable getDescription(java.lang.String nodeName)
                                   throws AuthorizationException,
                                          java.rmi.RemoteException
Method to get ALL descriptions for any parent node present in the conf file "securityDescription.xml".

Parameters:
nodeName - Any parent node in the "securityDescription.xml" file.
Returns:
Hashtable with the key as username and the value as description.
Throws:
AuthorizationException - In case of any error while query.
java.rmi.RemoteException - In case of RMI.

setDescription

void setDescription(java.lang.String nodeName,
                    java.util.Hashtable descData)
                    throws AuthorizationException,
                           java.rmi.RemoteException
Method to set Descriptions for any user,group, or operatrion.

Parameters:
nodeName - Node name to which the description is to be set.
descData - The values for the Node.
Throws:
AuthorizationException - In case of any error while query.
java.rmi.RemoteException - In case of RMI.

getAllAuthorizedViews

java.util.Vector getAllAuthorizedViews()
                                       throws AuthorizationException,
                                              java.rmi.RemoteException
Method to get All authorized Views that have Properties. So, the Custom Views can be assigned to these authorized Views.

Returns:
Vector of Authorized Views.
Throws:
AuthorizationException - In case of any error while query.
java.rmi.RemoteException - In case of RMI.

modifyViewProperty

boolean modifyViewProperty(java.lang.String ViewName,
                           java.util.Properties viewProp)
                           throws AuthorizationException,
                                  java.rmi.RemoteException
Method to modify Properties for a Authorized View.

Returns:
True, if modified successfully.Otherwise false.
Throws:
AuthorizationException - In case of any error while query.
java.rmi.RemoteException - In case of RMI.

removeAuthorizedView

boolean removeAuthorizedView(java.lang.String authView)
                             throws AuthorizationException,
                                    java.rmi.RemoteException
Method for removing authorizedView Completely from the data store.

Returns:
True, if removed succefully.Otherwise false.
Throws:
AuthorizationException - In case of any error while query.
java.rmi.RemoteException - In case of RMI.

assignViewToGroup

boolean assignViewToGroup(java.lang.String groupName,
                          java.util.Vector authViews)
                          throws AuthorizationException,
                                 java.rmi.RemoteException
Method for assigning a set of authorizedviews to a group.

Returns:
True, if assigned successfully.Otherwise false.
Throws:
AuthorizationException - In case of any error while query.
java.rmi.RemoteException - In case of RMI.

removeViewFromGroup

boolean removeViewFromGroup(java.lang.String groupName,
                            java.util.Vector authViews)
                            throws AuthorizationException,
                                   java.rmi.RemoteException
Method for removing a set of authViews from a group.

Returns:
True, if removed successfully.Otherwise false.
Throws:
AuthorizationException - In case of any error while query.
java.rmi.RemoteException - In case of RMI.

getPropertyNamesForCustomViewScope

java.util.Properties getPropertyNamesForCustomViewScope()
                                                        throws AuthorizationException,
                                                               java.rmi.RemoteException
Method for getting all property names of CustomViewScopes which would be useful while creating authorized views. This will give property names of the following CustomViewScopes Stats Admin, Maps, Network Database, Events, Alerts and Provisioning.

Returns:
Properties with the key as CustomViewScope name and the value as corresponding property names Vector for the CustomViewScope.
Throws:
AuthorizationException - in case of any error.
java.rmi.RemoteException - in case of RMI

"WEBNMS_5 API Docs"

Copyright © 2011 ZOHO Corp., All Rights Reserved.