1 23 24 package com.sun.enterprise.admin.event; 25 26 import com.sun.enterprise.admin.event.AdminEvent; 27 28 import com.sun.enterprise.util.i18n.StringManager; 30 31 36 public class AuditModuleEvent extends AdminEvent { 37 38 41 public static final int ACTION_CREATE = 1; 42 public static final int ACTION_DELETE = 2; 43 public static final int ACTION_UPDATE = 3; 44 45 48 static final String eventType = AuditModuleEvent.class.getName(); 49 50 53 private int actionType; 54 private String moduleName; 55 56 private static StringManager localStrings = StringManager.getManager( AuditModuleEvent.class ); 58 59 68 public AuditModuleEvent(String instance, String module, int action) { 69 this(eventType, instance, module, action); 70 } 71 72 81 public AuditModuleEvent(String type, String instance, String module, int action) { 82 super(type, instance); 83 moduleName = module; 84 setAction(action); 85 } 86 87 90 public String getModuleName() { 91 return moduleName; 92 } 93 94 97 public int getActionType() { 98 return actionType; 99 } 100 101 106 private void setAction(int action) { 107 boolean valid = false; 108 if (action==ACTION_CREATE || 109 action==ACTION_DELETE || 110 action==ACTION_UPDATE ) 111 valid = true; 112 if (!valid) { 113 String msg = localStrings.getString( "admin.event.invalid_action", ""+action ); 114 throw new IllegalArgumentException ( msg ); 115 } 116 this.actionType = action; 117 } 118 119 } 120 | Popular Tags |