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

AuditModuleEvent

public class AuditModuleEvent extends com.sun.enterprise.admin.event.AdminEvent
Audit Module Event - emitted by DAS after comletion of create/delete/update operation on security-service.audit-module element Contains name of module and action type.

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
moduleName
private static com.sun.enterprise.util.i18n.StringManager
localStrings
Constructors Summary
public AuditModuleEvent(String instance, String module, int action)
Create a new AuditModuleEvent.

param
type event type, a string representation for the event
param
instance name of the instance to which the event applies
param
module name of the Audit Module on which event happened.
param
action type of action - one of AuditModuleEvent.ACTION_CREATE, AuditModuleEvent.ACTION_DELETE, AuditModuleEvent.ACTION_UPDATE
throws
IllegalArgumentException if specified action is not valid


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

param
type event type, a string representation for the event
param
instance name of the instance to which the event applies
param
module name of the Audit Module on which event happened.
param
action type of action - one of AuditModuleEvent.ACTION_CREATE, AuditModuleEvent.ACTION_DELETE, AuditModuleEvent.ACTION_UPDATE
throws
IllegalArgumentException if specified action is not valid

        super(type, instance);
        moduleName = module;
        setAction(action);
    
Methods Summary
public intgetActionType()
Get action type for this event.

        return actionType;
    
public java.lang.StringgetModuleName()
Get name of the Audit Module on which event happened

        return moduleName;
    
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;