Coverage Report - org.mule.impl.internal.notifications.SecurityNotification
 
Classes in this File Line Coverage Branch Coverage Complexity
SecurityNotification
10%
1/10
0%
0/2
1.5
 
 1  
 /*
 2  
  * $Id: SecurityNotification.java 7963 2007-08-21 08:53:15Z dirk.olmes $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 
 11  
 package org.mule.impl.internal.notifications;
 12  
 
 13  
 import org.mule.umo.manager.UMOServerNotification;
 14  
 
 15  
 /**
 16  
  * <code>SecurityNotification</code> is fired when a request for authorisation
 17  
  * occurs. The event may denote successful access or denied access depending on the
 18  
  * type of event. Subscribing to these notifications developers can maintain an
 19  
  * access log, block clients, etc.
 20  
  * 
 21  
  * @see org.mule.MuleManager
 22  
  * @see org.mule.umo.manager.UMOManager
 23  
  */
 24  
 public class SecurityNotification extends UMOServerNotification
 25  
 {
 26  
     /**
 27  
      * Serial version
 28  
      */
 29  
     private static final long serialVersionUID = 5951835321289699941L;
 30  
 
 31  
     public static final int SECURITY_AUTHENTICATION_FAILED = SECURITY_EVENT_ACTION_START_RANGE + 1;
 32  
 
 33  2
     private static final transient String[] ACTIONS = new String[]{"authentication failed"};
 34  
 
 35  
     public SecurityNotification(org.mule.umo.security.SecurityException message, int action)
 36  
     {
 37  0
         super(message, action);
 38  0
         resourceIdentifier = message.toString();
 39  0
     }
 40  
 
 41  
     protected String getPayloadToString()
 42  
     {
 43  0
         return source.toString();
 44  
     }
 45  
 
 46  
     protected String getActionName(int action)
 47  
     {
 48  0
         int i = action - SECURITY_EVENT_ACTION_START_RANGE;
 49  0
         if (i - 1 > ACTIONS.length)
 50  
         {
 51  0
             return String.valueOf(action);
 52  
         }
 53  0
         return ACTIONS[i - 1];
 54  
     }
 55  
 
 56  
     public String getType()
 57  
     {
 58  0
         return TYPE_WARNING;
 59  
     }
 60  
 }