FileDocCategorySizeDatePackage
UserMgmtEvent.javaAPI DocGlassfish v2 API5752Fri May 04 22:33:36 BST 2007com.sun.enterprise.admin.event

UserMgmtEvent

public class UserMgmtEvent extends com.sun.enterprise.admin.event.AdminEvent
UserMgmtEvent - emitted by DAS upon changes user/group relationship content refered by AuthRealm element (this event is not about changes of realm element itself) This event does not cover the case of changes in realm content for this realm (It is the subject for another event - UserMgmtEvent) Attibutes: actionType, realmName, userName, groupList

Fields Summary
public static final int
ACTION_USERADD
Constant denoting action code
public static final int
ACTION_USERUPDATE
public static final int
ACTION_USERREMOVE
static final String
eventType
Event type
private int
actionType
Attributes
private String
realmName
private String
userName
private String[]
groupList
private static com.sun.enterprise.util.i18n.StringManager
localStrings
Constructors Summary
public UserMgmtEvent(String instance, String realm, int action, String user, String[] groups)
Create a new UserMgmtEvent.

param
instance name of the instance to which the event applies
param
realm name of the AuthRealm on which event happened.
param
action type of action - one of UserMgmtEvent.ACTION_USERADD, UserMgmtEvent.ACTION_USERUPDATE, UserMgmtEvent.ACTION_USERREMOVE
param
user name of user.
param
groups list of groups for the user.
throws
IllegalArgumentException if specified action is not valid


                                                                         
               
        this(eventType, instance, realm, action, user, groups);
    
public UserMgmtEvent(String type, String instance, String realm, int action, String user, String[] groups)
Create a new UserMgmtEvent.

param
type event type, a string representation for the event
param
instance name of the instance to which the event applies
param
realm name of the AuthRealm on which event happened.
param
action type of action - one of UserMgmtEvent.ACTION_USERADD, UserMgmtEvent.ACTION_USERUPDATE, UserMgmtEvent.ACTION_USERREMOVE
param
user name of user.
param
groups list of groups for the user.
throws
IllegalArgumentException if specified action is not valid

        super(type, instance);
        realmName = realm;
        userName  = user;
        groupList = groups;
        setAction(action);
    
Methods Summary
public intgetActionType()
Get action type for this event.

        return actionType;
    
public java.lang.StringgetAuthRealmName()
Get name of the AuthRealm on which event happened

        return realmName;
    
public java.lang.String[]getGroupList()
Get groups list for user

        return groupList;
    
public java.lang.StringgetUserName()
Get name of the user

        return userName;
    
private voidsetAction(int action)
Set action to specified value. If action is not one of allowed, then IllegalArgumentException is thrown.

throws
IllegalArgumentException if action is invalid

        boolean valid = false;
        if (action==ACTION_USERADD      ||
            action==ACTION_USERUPDATE   ||
            action==ACTION_USERREMOVE )
            valid = true;
        if (!valid) {
			String msg = localStrings.getString( "admin.event.invalid_action", ""+action );
            throw new IllegalArgumentException( msg );
        }
        this.actionType = action;