Security Example



Example Overview

Example name : SecurityExample.java
Location : <Web NMS Home>/examples/Security/authorization directory

This example is designed to give a complete picture of Security Services' administrative features. Here a user is created, a group is then assigned to that user, the group is then associated to a view and the operations are specified to that view and other administrative functions are performed. If the process is explained step by step, then the steps involved in this example are :

Step : 1 Create a user 
Step : 2 Assign an operation to view
Step : 3 Get the Hashtable of Operations for a View
Step : 4 Assign the view to a group
Step : 5 Change the password for an existing user
Step : 6 Set and Get the password age for the user
Step : 7 Set and Get the user expiry time
Step : 8 Set the status for a user
Step : 9 Get all the attributes for a user
Step : 10 Get the entire operations in the operation tree

Methods used in this example are listed below :

Note : The source code will have comment statements in it which will explain to you the different segments of the program.

 

Integration with Web NMS

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.

  1. java  com.adventnet.nms.example.security.authorization.SecurityExample   "create user"
  2. java  com.adventnet.nms.example.security.authorization.SecurityExample   "change password"
  3. java  com.adventnet.nms.example.security.authorization.SecurityExample   "password age"
  4. java  com.adventnet.nms.example.security.authorization.SecurityExample   "user expiration"
  5. java  com.adventnet.nms.example.security.authorization.SecurityExample   "remove user"
  6. java  com.adventnet.nms.example.security.authorization.SecurityExample   "get attributes"
  7. java  com.adventnet.nms.example.security.authorization.SecurityExample   "operations tree"
  8. java  com.adventnet.nms.example.security.authorization.SecurityExample   "user status"
  1. java  com.adventnet.nms.example.security.authorization.SecurityExample   "create user"  <username> <group name>  <view name>  <operation name>
  2. java  com.adventnet.nms.example.security.authorization.SecurityExample   "change password"  <username>  <new password>
  3. java  com.adventnet.nms.example.security.authorization.SecurityExample   "password age"   <username>  <password age in days>
  4. java  com.adventnet.nms.example.security.authorization.SecurityExample   "user expiration"  <username>  <user age in days>
  5. java  com.adventnet.nms.example.security.authorization.SecurityExample   "remove user"  <username> <remove trace i.e. true or false>
  6. java  com.adventnet.nms.example.security.authorization.SecurityExample   "get attributes" <username>
  7. java  com.adventnet.nms.example.security.authorization.SecurityExample   "operations tree"
  8. java  com.adventnet.nms.example.security.authorization.SecurityExample   "user status"  <username>  <user status>

Note : Ensure that the double quotes (" ") are specified appropriately, as mentioned above.

Sample Output

On successful execution of this example, based on the above mentioned command line arguments, each of the administrative functionalities of the Security Services is exhibited appropriately.

De-referencing

After you have tried this example, to remove its association with Web NMS, you must remove the class file SecurityExample.class from <Web NMS Home>/classes/com/adventnet/nms/example/security/authorization directory.


Copyright © 1996-2002, AdventNet Inc. All Rights Reserved.