Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
SecurityNotification |
|
| 1.0;1 |
1 | /* | |
2 | * $Id: SecurityNotification.java 10489 2008-01-23 17:53:38Z dfeist $ | |
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.context.notification; | |
12 | ||
13 | import org.mule.api.context.notification.ServerNotification; | |
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.api.context.UMOManager | |
23 | */ | |
24 | public class SecurityNotification extends ServerNotification | |
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 | static { | |
34 | 0 | registerAction("authenitication failed", SECURITY_AUTHENTICATION_FAILED); |
35 | 0 | } |
36 | ||
37 | public SecurityNotification(org.mule.api.security.SecurityException message, int action) | |
38 | { | |
39 | 0 | super(message, action); |
40 | 0 | resourceIdentifier = message.toString(); |
41 | 0 | } |
42 | ||
43 | protected String getPayloadToString() | |
44 | { | |
45 | 0 | return source.toString(); |
46 | } | |
47 | ||
48 | public String getType() | |
49 | { | |
50 | 0 | return TYPE_WARNING; |
51 | } | |
52 | } |