KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jmx > remote > security > NotificationAccessController


1 /*
2  * @(#)NotificationAccessController.java 1.2 05/11/17
3  *
4  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.jmx.remote.security;
9
10 import javax.management.Notification JavaDoc;
11 import javax.management.ObjectName JavaDoc;
12 import javax.security.auth.Subject JavaDoc;
13
14 /**
15  * <p>This interface allows to control remote access to the
16  * {@code addNotificationListener} and {@code removeNotificationListener}
17  * methods when the notification listener parameter is of type
18  * {@code NotificationListener} and also allows to control remote access
19  * to the notifications being forwarded to the interested remote listeners.</p>
20  *
21  * <p>An implementation of this interface can be supplied to a
22  * {@code JMXConnectorServer} in the environment map through the
23  * {@code com.sun.jmx.remote.notification.access.controller}
24  * environment map property.</p>
25  *
26  * @since 1.6
27  */

28 public interface NotificationAccessController {
29
30     /**
31      * This method is called when a remote
32      * {@link javax.management.remote.JMXConnector} invokes the method
33      * {@link javax.management.MBeanServerConnection#addNotificationListener(ObjectName,NotificationListener,NotificationFilter,Object)}.
34      *
35      * @param connectionId the {@code connectionId} of the remote client
36      * adding the listener.
37      * @param name the name of the MBean where the listener is to be added.
38      * @param subject the authenticated subject representing the remote client.
39      *
40      * @throws SecurityException if the remote client with the supplied
41      * authenticated subject does not have the rights to add a listener
42      * to the supplied MBean.
43      */

44     public void addNotificationListener(String JavaDoc connectionId,
45                                         ObjectName JavaDoc name,
46                                         Subject JavaDoc subject)
47         throws SecurityException JavaDoc;
48
49     /**
50      * This method is called when a remote
51      * {@link javax.management.remote.JMXConnector} invokes the method
52      * {@link javax.management.MBeanServerConnection#removeNotificationListener(ObjectName,NotificationListener)}
53      * or the method
54      * {@link javax.management.MBeanServerConnection#removeNotificationListener(ObjectName,NotificationListener,NotificationFilter,Object)}.
55      *
56      * @param connectionId the {@code connectionId} of the remote client
57      * removing the listener.
58      * @param name the name of the MBean where the listener is to be removed.
59      * @param subject the authenticated subject representing the remote client.
60      *
61      * @throws SecurityException if the remote client with the supplied
62      * authenticated subject does not have the rights to remove a listener
63      * from the supplied MBean.
64      */

65     public void removeNotificationListener(String JavaDoc connectionId,
66                                            ObjectName JavaDoc name,
67                                            Subject JavaDoc subject)
68         throws SecurityException JavaDoc;
69
70     /**
71      * This method is called before the
72      * {@link javax.management.remote.JMXConnectorServer}
73      * forwards the notification to the interested remote
74      * listener represented by the authenticated subject.
75      *
76      * @param connectionId the {@code connectionId} of the remote client
77      * receiving the notification.
78      * @param name the name of the MBean forwarding the notification.
79      * @param notification the notification to be forwarded to the interested
80      * remote listener.
81      * @param subject the authenticated subject representing the remote client.
82      *
83      * @throws SecurityException if the remote client with
84      * the supplied authenticated subject does not have the
85      * rights to receive the notification.
86      */

87     public void fetchNotification(String JavaDoc connectionId,
88                                   ObjectName JavaDoc name,
89                                   Notification JavaDoc notification,
90                                   Subject JavaDoc subject)
91         throws SecurityException JavaDoc;
92 }
93
Popular Tags