KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > interop > security > SimpleSubject


1 /**
2  *
3  * Copyright 2004-2005 The Apache Software Foundation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18 package org.apache.geronimo.interop.security;
19
20 public class SimpleSubject {
21     // -----------------------------------------------------------------------
22
// public data
23
// -----------------------------------------------------------------------
24

25     public static final int FLAG_SESSION_MANAGER = 1;
26
27     // -----------------------------------------------------------------------
28
// private data
29
// -----------------------------------------------------------------------
30

31     private static ThreadLocal JavaDoc _current = new ThreadLocal JavaDoc();
32
33     private String JavaDoc _username;
34
35     private String JavaDoc _password;
36
37     private int _flags;
38
39     // -----------------------------------------------------------------------
40
// public methods
41
// -----------------------------------------------------------------------
42

43     public static SimpleSubject getCurrent() {
44         return (SimpleSubject) _current.get();
45     }
46
47     public static void setCurrent(SimpleSubject subject) {
48         _current.set(subject);
49     }
50
51     public SimpleSubject(String JavaDoc username, String JavaDoc password) {
52         _username = username;
53         _password = password;
54     }
55
56     public String JavaDoc getUsername() {
57         return _username;
58     }
59
60     public String JavaDoc getPassword() {
61         return _password;
62     }
63
64     public int getFlags() {
65         return _flags;
66     }
67
68     public void setFlags(int flags) {
69         _flags = flags;
70     }
71 }
72
Popular Tags