KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > security > auth > JSubject


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 2005 Bull S.A.
4  * Contact: jonas-team@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: JSubject.java,v 1.1 2005/04/19 07:59:00 benoitf Exp $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.jonas.security.auth;
26
27 import java.io.Serializable JavaDoc;
28 import java.security.Principal JavaDoc;
29
30 /**
31  * Designed to embeds Object for JResourceLoginModule.
32  * This is due to the fact that Subject class isn't serializable with JacORB
33  * Could be removed when it will be the case
34  * @author Florent.
35  */

36 public class JSubject implements Serializable JavaDoc {
37
38     /**
39      * principal name of the user
40      */

41     private Principal JavaDoc name = null;
42
43     /**
44      * Roles of the user
45      */

46     private Principal JavaDoc group = null;
47
48     /**
49      * Build new object with name and group
50      * @param name the given name
51      * @param group the group containing all roles
52      */

53     public JSubject(Principal JavaDoc name, Principal JavaDoc group) {
54         this.name = name;
55         this.group = group;
56     }
57
58
59     /**
60      * @return the group (containing groups)
61      */

62     public Principal JavaDoc getGroup() {
63         return group;
64     }
65
66     /**
67      * @return name of user
68      */

69     public Principal JavaDoc getName() {
70         return name;
71     }
72
73
74 }
75
Popular Tags