01: /*
02: * $Id: SecurityNotification.java 10489 2008-01-23 17:53:38Z dfeist $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
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: * Serial version
27: */
28: private static final long serialVersionUID = 5951835321289699941L;
29:
30: public static final int SECURITY_AUTHENTICATION_FAILED = SECURITY_EVENT_ACTION_START_RANGE + 1;
31:
32: static {
33: registerAction("authenitication failed",
34: SECURITY_AUTHENTICATION_FAILED);
35: }
36:
37: public SecurityNotification(
38: org.mule.api.security.SecurityException message, int action) {
39: super (message, action);
40: resourceIdentifier = message.toString();
41: }
42:
43: protected String getPayloadToString() {
44: return source.toString();
45: }
46:
47: public String getType() {
48: return TYPE_WARNING;
49: }
50: }
|