KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > security > AuthenticationScheme


1 /*
2  * SSL-Explorer
3  *
4  * Copyright (C) 2003-2006 3SP LTD. All Rights Reserved
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */

19             
20 package com.sslexplorer.security;
21
22 import java.util.Iterator JavaDoc;
23
24 import javax.servlet.http.HttpServletRequest JavaDoc;
25 import javax.servlet.http.HttpServletResponse JavaDoc;
26 import javax.servlet.http.HttpSession JavaDoc;
27
28 import com.sslexplorer.policyframework.Resource;
29
30 /**
31  * @author Brett Smith <brett@3sp.com>
32  */

33 public interface AuthenticationScheme extends Resource {
34
35     /**
36      * @param session
37      * @throws Exception
38      */

39     public void init(HttpSession JavaDoc session) throws Exception JavaDoc;
40
41     /**
42      * @return int
43      */

44     public int getCurrentModuleIndex();
45
46     /**
47      * @return int
48      */

49     public int getModuleCount();
50
51     /**
52      * Get if this scheme contains the specified module
53      *
54      * @param name name of module to test for
55      * @return has module
56      */

57     public boolean hasModule(String JavaDoc name);
58     
59     /**
60      * Remove a module from this scheme
61      *
62      * @param module module to remove
63      */

64     public void removeModule(String JavaDoc module);
65
66     /**
67      * Get an iterator of modules contained within this scheme.
68      *
69      * @return modules
70      */

71     public Iterator JavaDoc<String JavaDoc> modules();
72
73     /**
74      * Add a new authentication module to this scheme
75      *
76      * @param module name of module to add
77      */

78     public void addModule(String JavaDoc module);
79
80     /**
81      * Move the specified module up one in the list. If the module is
82      * already at the top of the scheme no action will occur.
83      *
84      * @param module module to move up in the scheme
85      */

86     public void moveUp(String JavaDoc module);
87
88     /**
89      * Move the specified module down one in the list. If the module is
90      * already at the bottom of the scheme no action will occur.
91      *
92      * @param module module to move down in the scheme
93      */

94     public void moveDown(String JavaDoc module);
95
96     /**
97      * Remove all modules from this sequence
98      */

99     public void clearModules();
100
101     /**
102      * @return User
103      */

104     public User getUser();
105
106     /**
107      * @param user
108      */

109     public void setUser(User user);
110
111     /**
112      * @return HttpSession
113      */

114     public HttpSession JavaDoc getServletSession();
115
116     /**
117      * @return AuthenticationModule
118      */

119     public AuthenticationModule nextAuthenticationModule();
120
121     /**
122      * @return AuthenticationModule
123      */

124     public AuthenticationModule currentAuthenticationModule();
125
126     /**
127      * @param request
128      * @param response
129      * @throws Exception
130      */

131     public void authenticationComplete(HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response) throws Exception JavaDoc;
132
133     /**
134      * @return String
135      */

136     public String JavaDoc getUsername();
137
138     /**
139      * @return String[]
140      */

141     public String JavaDoc[] getModules();
142
143     /**
144      * Get the module at the specified index.
145      *
146      * @param index index of module
147      * @return module
148      */

149     public String JavaDoc getModule(int index);
150
151     /**
152      * @return String
153      */

154     public String JavaDoc getSchemeName();
155
156     /**
157      * @param credentials
158      */

159     public void addCredentials(Credentials credentials);
160
161     /**
162      * @return Iterator
163      */

164     public Iterator JavaDoc credentials();
165
166     /**
167      * @param lock
168      */

169     public void setAccountLock(AccountLock lock);
170
171     /**
172      * @return AccountLock
173      */

174     public AccountLock getAccountLock();
175
176     /**
177      * @return boolean
178      */

179     public boolean getSessionLocked();
180
181     /**
182      * @return boolean
183      */

184     public boolean getEnabled();
185
186     /**
187      * @return int
188      */

189     public int getPriorityInt();
190     
191     /**
192      * @return String
193      */

194     public String JavaDoc getPriority();
195
196     /**
197      * @param priority
198      */

199     public void setPriorityInt(int priority);
200
201     /**
202      * Set whether this scheme is enabled
203      *
204      * @param enabled enabled
205      */

206     public void setEnabled(boolean enabled);
207     
208     /**
209      * Get if the scheme contains only system authentication modules
210      *
211      * @return system authentication modules only
212      */

213     public boolean isSystemScheme();
214 }
215
Popular Tags