View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.context.notification;
8   
9   import org.mule.api.context.notification.ServerNotification;
10  import org.mule.api.security.SecurityException;
11  
12  /**
13   * <code>SecurityNotification</code> is fired when a request for authorisation failed.
14   */
15  public class SecurityNotification extends ServerNotification
16  {
17      /**
18       * Serial version
19       */
20      private static final long serialVersionUID = 5951835321289699941L;
21  
22      public static final int SECURITY_AUTHENTICATION_FAILED = SECURITY_EVENT_ACTION_START_RANGE + 1;
23  
24      static
25      {
26          registerAction("authentication failed", SECURITY_AUTHENTICATION_FAILED);
27      }
28  
29      public SecurityNotification(SecurityException message, int action)
30      {
31          super(message.getDetailedMessage(), action);
32          resourceIdentifier = message.getClass().getName();
33      }
34  
35      @Override
36      public String getType()
37      {
38          return TYPE_WARNING;
39      }
40  }