KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > api > bean > info > ISecurityInfo


1 /**
2  * EasyBeans
3  * Copyright (C) 2006 Bull S.A.S.
4  * Contact: easybeans@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: ISecurityInfo.java 1121 2006-09-27 08:51:06Z benoitf $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.easybeans.api.bean.info;
27
28 import java.util.List JavaDoc;
29
30 import javax.security.auth.Subject JavaDoc;
31
32 /**
33  * Runtime info about security.
34  * @author Florent Benoit
35  */

36 public interface ISecurityInfo {
37
38     /**
39      * Adds a role for this bean (for isCallerInRole).
40      * @param roleName the name of a role.
41      */

42     void addDeclaredRole(String JavaDoc roleName);
43
44     /**
45      * Sets the list of declared roles.
46      * @param declaredRoles list of declared roles.
47      */

48     void setDeclaredRole(List JavaDoc<String JavaDoc> declaredRoles);
49
50     /**
51      * @return list of roles declared for this bean.
52      */

53     List JavaDoc<String JavaDoc> getDeclaredRoles();
54
55     /**
56      * Adds a method containing security.
57      * @param methodSecurityInfo the info about security.
58      */

59     void addMethodSecurityInfo(IMethodSecurityInfo methodSecurityInfo);
60
61     /**
62      * @return list of security infos on all methods.
63      */

64     List JavaDoc<IMethodSecurityInfo> getMethodSecurityInfos();
65
66     /**
67      * Sets the name of the run-as security role.
68      * @param runAsRole the name of the role.
69      */

70     void setRunAsRole(String JavaDoc runAsRole);
71
72
73     /**
74      * Gets run-as name.
75      * @return the name of the security role for the run-as.
76      */

77     String JavaDoc getRunAsRole();
78
79
80     /**
81      * Gets run-as role subject.
82      * @return a subject with run-as role as role.
83      */

84     Subject JavaDoc getRunAsSubject();
85
86 }
87
Popular Tags