Example name : SecuredAdminExample.java
Location :
<Web NMS Home>/examples/Security/authorization directory
This example explains how to use the methods present in the SecuredAdminAPI which have password as one of their arguments during the RMI mode of communication using the Cryptography technique.
The interfaces used in this example are : SecuredAdminAPI and CryptoGraphAPI
Methods used in this example are :
createUser
public boolean createUser(java.lang.String userName, java.lang.String groupName, java.lang.String password)
throws java.rmi.RemoteException, AuthorizationException
enCrypt
public string enCrypt(java.lang.String plainText) throws CryptoGraphException
createUserForOwner
public boolean createUserForOwner(java.lang.String userName, java.lang.String groupName, java.lang.String password, java.lang.String ownerName)
throws java.rmi.RemoteException, AuthorizationException.
changePasswordForSuper
public boolean changePassword(ava.lang.String userName, java.lang.String password)throws java.rmi.Exception,
AuthorizationException.
changePassword
public boolean changePassword(java.lang.String userName, java.lang.String old_pass, java.lang.String new_pass)
throws java.rmi.Exception AuthorizationException.
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.SecurityAdminExample -cu <username> <group name> <password>
- For changing password -
java com.adventnet.nms.example.security.authorization.SecurityAdminExample -cp <username> <old password > <new password>
- For creating user with owner -
java com.adventnet.nms.example.security.authorization.SecurityAdminExample -co <username> <group name> <password> <owner name>
- For changing password directly without taking the old password -
java com.adventnet.nms.example.security.authorization.SecurityAdminExample -csu <username> <password>
If there are any errors, while executing any of the above tasks, a suitable message to that effect is displayed.
After you have tried this example, to remove its association with Web NMS, you must remove the class file SecurityAdminExample.class from <Web NMS Home>/classes/com/adventnet/nms/example/security/authorization directory.
Copyright © 1996-2002, AdventNet Inc. All Rights Reserved.