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 37 public class SecurityServiceEvent extends AdminEvent { 38 39 42 public static final int ACTION_CREATE = 1; 43 public static final int ACTION_DELETE = 2; 44 public static final int ACTION_UPDATE = 3; 45 46 49 static final String eventType = SecurityServiceEvent.class.getName(); 50 51 54 private int actionType; 55 56 private static StringManager localStrings = StringManager.getManager( SecurityServiceEvent.class ); 58 59 67 public SecurityServiceEvent(String instance, int action) { 68 this(eventType, instance, action); 69 } 70 71 79 public SecurityServiceEvent(String type, String instance, int action) { 80 super(type, instance); 81 setAction(action); 82 } 83 84 87 public int getActionType() { 88 return actionType; 89 } 90 91 96 private void setAction(int action) { 97 boolean valid = false; 98 if (action==ACTION_CREATE || 99 action==ACTION_DELETE || 100 action==ACTION_UPDATE ) 101 valid = true; 102 if (!valid) { 103 String msg = localStrings.getString( "admin.event.invalid_action", ""+action ); 104 throw new IllegalArgumentException ( msg ); 105 } 106 this.actionType = action; 107 } 108 109 } 110 | Popular Tags |