FileDocCategorySizeDatePackage
TraceEventNotificationFilter.javaAPI DocGlassfish v2 API3693Fri May 04 22:33:46 BST 2007com.sun.enterprise.admin.selfmanagement.event

TraceEventNotificationFilter

public class TraceEventNotificationFilter extends Object implements NotificationFilter

Fields Summary
private String
type
private String
ipAddress
private String
callerPrincipal
private String
componentName
Constructors Summary
public TraceEventNotificationFilter(String type, String ipAddress, String callerPrincipal, String componentName)

        this.type = type;
        this.ipAddress = ipAddress;
        this.callerPrincipal = callerPrincipal;
        this.componentName = componentName;
    
Methods Summary
public booleanisNotificationEnabled(javax.management.Notification notification)

        if ("*".equals(type) || type.equals(notification.getType()) ) {
            Map map = (HashMap)notification.getUserData();
            if (map != null) {
               if (ipAddress != null && !(ipAddress.equals("*")) && 
                  !(ipAddress.equals(map.get(CALLER_IPADDRESS)))) {
                   return false;
               }
               if (callerPrincipal != null && !(callerPrincipal.equals("*")) && 
                  !(callerPrincipal.equals(map.get(CALLER_PRINCIPAL)))) { 
                   return false;
               }
               if (componentName != null && !(componentName.equals("*")) && 
                  !(componentName.equals(map.get(COMPONENT_NAME)))) { 
                   return false;
               }
               return true;
            } else {
                return false;
            }
            
        }
        else
            return false;