Example name : GetOperationsForUser.java
Location : <Web NMS Home>/examples/Security/authorization directory
This example explains how to use the method "getOperationsForUser(java.lang.String userName)" and will return the list of authorized operations for the specified user.
The interface used in this example is AuthorizationEngine
Method used in this example is :
After getting handle of the NmsAuthEngineAPI through an RMI lookup, the example gets the allowed operations for a given user.
Note : The source code will have comment statements in it which will explain to you the different segments of the program.
The steps given below will help you in integrating this example with Web NMS. If any of the steps given below are not followed properly, then the example might not function in a desired manner.
java com.adventnet.nms.example.security.authorization.GetOperationsForUser <username>
If there are operations assigned to the user, the output message printed in your console will be : "The operations for the user <username> are : <list of operations>"
Alternatively, if there are no operations assigned to the user, the following message is printed : "No operations for user <username>"
After you have tried this example, to remove its association with Web NMS, you must remove the class file GetOperationsForUser.class from <Web NMS Home>/classes/com/adventnet/nms/example/security/authorization directory.
Copyright © 1996-2002, AdventNet Inc. All Rights Reserved.