KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mr > kernel > security > MantaAuthorization


1 /*
2  * Copyright 2002 by
3  * <a HREF="http://www.coridan.com">Coridan</a>
4  * <a HREF="mailto: support@coridan.com ">support@coridan.com</a>
5  *
6  * The contents of this file are subject to the Mozilla Public License Version
7  * 1.1 (the "License"); you may not use this file except in compliance with the
8  * License. You may obtain a copy of the License at
9  * http://www.mozilla.org/MPL/
10  *
11  * Software distributed under the License is distributed on an "AS IS" basis,
12  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13  * for the specific language governing rights and limitations under the
14  * License.
15  *
16  * The Original Code is "MantaRay" (TM).
17  *
18  * The Initial Developer of the Original Code is Shirley Sasson.
19  * Portions created by the Initial Developer are Copyright (C) 2006
20  * Coridan Inc. All Rights Reserved.
21  *
22  * Contributor(s): all the names of the contributors are added in the source
23  * code where applicable.
24  *
25  * Alternatively, the contents of this file may be used under the terms of the
26  * LGPL license (the "GNU LESSER GENERAL PUBLIC LICENSE"), in which case the
27  * provisions of LGPL are applicable instead of those above. If you wish to
28  * allow use of your version of this file only under the terms of the LGPL
29  * License and not to allow others to use your version of this file under
30  * the MPL, indicate your decision by deleting the provisions above and
31  * replace them with the notice and other provisions required by the LGPL.
32  * If you do not delete the provisions above, a recipient may use your version
33  * of this file under either the MPL or the GNU LESSER GENERAL PUBLIC LICENSE.
34  
35  *
36  * This library is free software; you can redistribute it and/or modify it
37  * under the terms of the MPL as stated above or under the terms of the GNU
38  * Lesser General Public License as published by the Free Software Foundation;
39  * either version 2.1 of the License, or any later version.
40  *
41  * This library is distributed in the hope that it will be useful, but WITHOUT
42  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
43  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
44  * License for more details.
45  */

46
47 package org.mr.kernel.security;
48
49 import javax.jms.JMSSecurityException JavaDoc;
50 import java.net.InetAddress JavaDoc;
51
52 /**
53  * This interface is used by a Manta layer to check whether it has permissions to perform a certain action.
54  * The implementing class will implement the actual authorization.
55  *
56  * @version 1.0
57  * @since Mar 22, 2006
58  * @author Shirley Sasson
59  *
60  */

61 public interface MantaAuthorization {
62
63     /**
64      * This method is used to check whether or not a given IP address is in the list of allowed IPs.
65      *
66      * Each domain will hold a white (or black) list that holds authorized (or non authorized) IP addresses.
67      * When Manta wishes to perform some action that involves some IP address, it will call this method in order
68      * to determine whether or not this IP address is allowed or not.
69      *
70      * If IP address is authorized, the method returns with no value.
71      *
72      * @param inetAddress
73      * IP address to be checked against white/black list
74      * @throws SecurityException if IP address is unauthorized
75      */

76     public void authorize(InetAddress JavaDoc inetAddress) throws SecurityException JavaDoc;
77
78     /**
79      * This method is used to check whether or not a given session id represents a client that is allowed
80      * to perform a specific action.
81      *
82      * Actions that require an authorization might be creating a producer on a queue,
83      * creating a consumer on a topic, etc.
84      *
85      * Use this method when the action is to be performed on a specific queue, topic, etc.
86      * Then the name of the queue or topic will be specified as the "param" parameter.
87      *
88      * If the action is authorized, the method returns with no value.
89      *
90      * @param sessionID
91      * the session id returned from MantaAuthentication.authenticate method
92      * @param actionType
93      * an integer value indicating the action to perform.
94      * Use a member of ActionTypes
95      * @param param
96      * an object containing additional parameters relevant for the specific action
97      * @throws JMSSecurityException if action is unauthorized for the specific client
98      * @see org.mr.kernel.security.MantaAuthentication
99      * @see org.mr.kernel.security.SecurityActionTypes
100      */

101     public void authorize(SessionID sessionID, int actionType, Object JavaDoc param) throws JMSSecurityException JavaDoc;
102
103     /**
104      * This method is used to check whether or not a given session id represents a client that is allowed
105      * to perform a specific action.
106      *
107      * Actions that require an authorization might be creating a producer on a queue,
108      * creating a consumer on a topic, etc.
109      *
110      * Use this method when the action should not be performed on a specific queue, topic, etc.
111      *
112      * If the action is authorized, the method returns with no value.
113      *
114      * @param sessionID
115      * the session id returned from MantaAuthentication.authenticate method
116      * @param actionType
117      * an integer value indicating the action to perform.
118      * Use a member of ActionTypes
119      * @throws JMSSecurityException if action is unauthorized for the specific client
120      * @see org.mr.kernel.security.MantaAuthentication
121      * @see org.mr.kernel.security.SecurityActionTypes
122      */

123     public void authorize(SessionID sessionID, int actionType) throws JMSSecurityException JavaDoc;
124 }
125
Popular Tags