"WEBNMS_5 API Docs"

com.adventnet.security.authorization
Interface AuthObserver

All Superinterfaces:
java.rmi.Remote

public interface AuthObserver
extends java.rmi.Remote

This is the interface for getting notifications about the changes in authorization information such as addition/deletion/modifications of users,operations To listen for notifications, users should implement this interface and can register for any of the following updates.

For any change in the database, the update method of each of the observers registered will be called appropriately with the information about the change. Registering for all updates will notify any change in the authorization information. Registering for user updates will notify any change with respect to user name(e.g, adding/deleting user names). Registering for operation updates will notify any change when operation is associated/disassociated with the user.

 //Accessing the AuthorizationAdmin Handle through RMI.

 String name = "//[NMSServer]/NmsAuthAdminAPI";

  try 
  {
      AuthorizationAdmin authAdmin = (AuthorizationAdmin) Naming.lookup(name);
      
      if(authAdmin == null) 
      {
          System.out.println("Could not get a Reference to remote object, AuthorizationAdmin");
          System.exit(1);
      }
      else 
      {
          System.out.println("Got a reference to remote object, AuthorizationAdmin");                                             
      }
      
      boolean registerForAll = authAdmin.registerForAllUpdates(AuthObserver obs);
      boolean registerForUser = authAdmin.registerForUserUpdates(AuthObserver obs);
      boolean registerForOperation = authAdmin.registerForOperationUpdates(AuthObserver obs);
  }
  catch ( Exception e )
  {
      e.printStackTrace();
  }
 
To use RMI, the implementor class should extend UnicastRemoteObject. This implementor class can listen for notifications through RMI for the updates.

See Also:
AuthorizationAdmin.registerForAllUpdates(com.adventnet.security.authorization.AuthObserver), AuthorizationAdmin.registerForOperationUpdates(com.adventnet.security.authorization.AuthObserver), AuthorizationAdmin.registerForUserUpdates(com.adventnet.security.authorization.AuthObserver)

Field Summary
static java.lang.String ADD_OPERATION
          Implies that the operations have been added in the database for the users.
static java.lang.String ADD_USER
          Implies that a new user has been added to the database.
static java.lang.String ADDED_CUSTOM_VIEW
          Implies that a new custom view has been added.
static java.lang.String ASSIGNED_VIEW_TO_GROUP
          Implies that the group has got some additional scope criteria.
static java.lang.String DELETE_OPERATION
          Implies that the operations have been deleted from the database for the users.
static java.lang.String DELETE_USER
          Implies that a user has been deleted from the database.
static java.lang.String DELETED_AUTH_VIEW
          Implies that the authorized view has been removed from the data store.
static java.lang.String MODIFIED_VIEW_PROPERTY
          Implies that the properties have been changed for the authorized view.
static java.lang.String REMOVED_CUSTOM_VIEW
          Implies that an existing custom view is removed.
static java.lang.String REMOVED_CUSTOM_VIEW_COMPLETELY
          Implies that an existing custom view is removed.
static java.lang.String REMOVED_VIEW_FROM_GROUP
          Implies that some authorized views are removed from group.
static java.lang.String USER_ACCOUNT_EXPIRED
          Implies that the account for the user is expired.
static java.lang.String USER_DISABLED
          Implies that the user status has been disabled.
static java.lang.String USER_ENABLED
          Implies that the user status has been enabled.
 
Method Summary
 void update(java.lang.String type, java.util.Properties prop)
          This method is invoked when a database change is to be notified to the observer.
 

Field Detail

ADD_USER

static final java.lang.String ADD_USER
Implies that a new user has been added to the database. For this type, the properties will have String "username" as key and String 'the name of the newly added user' as value.

See Also:
Constant Field Values

DELETE_USER

static final java.lang.String DELETE_USER
Implies that a user has been deleted from the database. For this type, the properties will have String "username" as key and String 'the name of the deleted user' as value.

See Also:
Constant Field Values

ADD_OPERATION

static final java.lang.String ADD_OPERATION
Implies that the operations have been added in the database for the users. For this type, the properties will have two elements.First element will have String "username" as key and vector of usernames as value. The next element will have String "operationname" as key and vector of operations as value.This shows, for the users in the vector have got additional permission to do the operations in the operation vector.

See Also:
Constant Field Values

DELETE_OPERATION

static final java.lang.String DELETE_OPERATION
Implies that the operations have been deleted from the database for the users. For this type, the properties will have two elements.First element will have String "username" as key and vector of usernames as value. The next element will have String "operationname" as key and vector of operations as value.This shows, for the users in the vector are not authorized further to do the operations in the operation vector.

See Also:
Constant Field Values

USER_DISABLED

static final java.lang.String USER_DISABLED
Implies that the user status has been disabled. For this type, the Properties will have String "username" as key and Vector of users as value.The users in this Vector are disabled in the database.

See Also:
Constant Field Values

USER_ENABLED

static final java.lang.String USER_ENABLED
Implies that the user status has been enabled. For this type, the Properties will have String "username" as key and Vector of users as value.The users in the Vector are enabled in the database.

See Also:
Constant Field Values

USER_ACCOUNT_EXPIRED

static final java.lang.String USER_ACCOUNT_EXPIRED
Implies that the account for the user is expired. For this type, the properties will have String "username" as key and Vector of users as value.

See Also:
Constant Field Values

ADDED_CUSTOM_VIEW

static final java.lang.String ADDED_CUSTOM_VIEW
Implies that a new custom view has been added. For this type, the Properties will have String "username" as key and Vector of users as value. The users will get some additional criteria associated with the added custom view.

See Also:
Constant Field Values

REMOVED_CUSTOM_VIEW

static final java.lang.String REMOVED_CUSTOM_VIEW
Implies that an existing custom view is removed. For this type, the Properties will have String "username" as key and Vector of users as value. The criteria for the user have been changed.

See Also:
Constant Field Values

REMOVED_CUSTOM_VIEW_COMPLETELY

static final java.lang.String REMOVED_CUSTOM_VIEW_COMPLETELY
Implies that an existing custom view is removed. For this type, the Properties will have String "customview" as key and String custom view name as value. This custom view is completely removed from the data store. The criteria for the users associated with the removed custom view will be changed appropriately.

See Also:
Constant Field Values

MODIFIED_VIEW_PROPERTY

static final java.lang.String MODIFIED_VIEW_PROPERTY
Implies that the properties have been changed for the authorized view. For this type, the Properties will have two elements, String "cvscopes" as key and a Vector of CustomViewScopes as value and String "username" as key and Vector of users as value respectively.

See Also:
Constant Field Values

ASSIGNED_VIEW_TO_GROUP

static final java.lang.String ASSIGNED_VIEW_TO_GROUP
Implies that the group has got some additional scope criteria. For this type, the Properties will have two elements, String "cvscopes" as key and a Vector of CustomViewScopes as value and String "username" as key and Vector of users as value respectively.

See Also:
Constant Field Values

REMOVED_VIEW_FROM_GROUP

static final java.lang.String REMOVED_VIEW_FROM_GROUP
Implies that some authorized views are removed from group. For this type, the properties will have two elements, String "cvscopes" as key and a Vector of CustomViewScopes as value and String "username" as key and Vector of users as value respectively.

See Also:
Constant Field Values

DELETED_AUTH_VIEW

static final java.lang.String DELETED_AUTH_VIEW
Implies that the authorized view has been removed from the data store. For this type, the Properties will have two elements, String "cvscopes" as key and a Vector of CustomViewScopes as value and String "username" as key and Vector of users as value respectively.

See Also:
Constant Field Values
Method Detail

update

void update(java.lang.String type,
            java.util.Properties prop)
            throws java.rmi.RemoteException
This method is invoked when a database change is to be notified to the observer. The first argument identifies the type of database change and it can be one of the field variables.

Parameters:
type - any one of the field variables.
prop - The details of the user and operations that had been updated in the database.
Throws:
RemoteException - In case of RMI.

"WEBNMS_5 API Docs"

Copyright © 2011 ZOHO Corp., All Rights Reserved.