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 38 public class AuthRealmEvent extends AdminEvent { 39 40 43 public static final int ACTION_CREATE = 1; 44 public static final int ACTION_DELETE = 2; 45 public static final int ACTION_UPDATE = 3; 46 47 50 static final String eventType = AuthRealmEvent.class.getName(); 51 52 55 private int actionType; 56 private String realmName; 57 58 private static StringManager localStrings = StringManager.getManager( AuthRealmEvent.class ); 60 61 70 public AuthRealmEvent(String instance, String realm, int action) { 71 this(eventType, instance, realm, action); 72 } 73 74 83 public AuthRealmEvent(String type, String instance, String realm, int action) { 84 super(type, instance); 85 realmName = realm; 86 setAction(action); 87 } 88 89 92 public String getAuthRealmName() { 93 return realmName; 94 } 95 96 99 public int getActionType() { 100 return actionType; 101 } 102 103 108 private void setAction(int action) { 109 boolean valid = false; 110 if (action==ACTION_CREATE || 111 action==ACTION_DELETE || 112 action==ACTION_UPDATE ) 113 valid = true; 114 if (!valid) { 115 String msg = localStrings.getString( "admin.event.invalid_action", ""+action ); 116 throw new IllegalArgumentException ( msg ); 117 } 118 this.actionType = action; 119 } 120 121 } 122 | Popular Tags |