FileDocCategorySizeDatePackage
AuthRealmEvent.javaAPI DocGlassfish v2 API5137Fri May 04 22:33:34 BST 2007com.sun.enterprise.admin.event

AuthRealmEvent

public class AuthRealmEvent extends com.sun.enterprise.admin.event.AdminEvent
AuthRealmEvent - emitted by DAS after comletion of create/delete/update operation on security-service.auth-realm element Contains name of realm and action type. This event does not cover the case of changes in realm content for this realm (It is the subject for another event - UserMgmtEvent)

Fields Summary
public static final int
ACTION_CREATE
Constant denoting action code
public static final int
ACTION_DELETE
public static final int
ACTION_UPDATE
static final String
eventType
Event type
private int
actionType
Attributes
private String
realmName
private static com.sun.enterprise.util.i18n.StringManager
localStrings
Constructors Summary
public AuthRealmEvent(String instance, String realm, int action)
Create a new AuthRealmEvent.

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 AuthRealmEvent.ACTION_CREATE, AuthRealmEvent.ACTION_DELETE, AuthRealmEvent.ACTION_UPDATE
throws
IllegalArgumentException if specified action is not valid


                                                                      
           
        this(eventType, instance, realm, action);
    
public AuthRealmEvent(String type, String instance, String realm, int action)
Create a new AuthRealmEvent.

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 AuthRealmEvent.ACTION_CREATE, AuthRealmEvent.ACTION_DELETE, AuthRealmEvent.ACTION_UPDATE
throws
IllegalArgumentException if specified action is not valid

        super(type, instance);
        realmName = realm;
        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;
    
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_CREATE ||
            action==ACTION_DELETE ||
            action==ACTION_UPDATE )
            valid = true;
        if (!valid) {
			String msg = localStrings.getString( "admin.event.invalid_action", ""+action );
            throw new IllegalArgumentException( msg );
        }
        this.actionType = action;