KickJava   Java API By Example, From Geeks To Geeks.

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


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.List JavaDoc;
23
24 import com.sslexplorer.core.Database;
25 import com.sslexplorer.navigation.Favorite;
26
27 /**
28  * The <i>System Configuration> {@link com.sslexplorer.core.Database}
29  * implementation is responsible for storing an retrieving SSL-Explorer's basic
30  * resources and configuration.
31  *
32  * @author Brett Smith <a HREF="mailto: brett@3sp.com">&lt;brett@3sp.com&gt;</a>
33  */

34 public interface SystemDatabase extends Database {
35
36     /**
37      * @param type
38      * @param favoriteKey the3 id fo the resource.
39      * @param username
40      * @throws Exception
41      */

42     public void addFavorite(int type, int favoriteKey, String JavaDoc username) throws Exception JavaDoc;
43
44     /**
45      * @param type
46      * @param favoriteKey
47      * @param username
48      * @throws Exception
49      */

50     public void removeFavorite(int type, int favoriteKey, String JavaDoc username) throws Exception JavaDoc;
51
52     /**
53      * @param ipadrress
54      * @return boolean
55      * @throws Exception
56      */

57     public boolean verifyIPAddress(String JavaDoc ipadrress) throws Exception JavaDoc;
58
59     /**
60      * @param ipAddress
61      * @param ipRestrictions
62      * @return boolean
63      * @throws Exception
64      */

65     public boolean verifyIPAddress(String JavaDoc ipAddress, IpRestriction[] ipRestrictions) throws Exception JavaDoc;
66
67     /**
68      * @param id
69      * @throws Exception
70      */

71     public void removeIpRestriction(int id) throws Exception JavaDoc;
72
73     /**
74      * Create an Ip restriction.
75      *
76      * @param addressPattern address pattern
77      * @param type type (see {@link IpRestriction#getType()}.
78      * @throws Exception
79      */

80     public void addIpRestriction(String JavaDoc addressPattern, int type) throws Exception JavaDoc;
81
82     /**
83      * Update an Ip restriction.
84      *
85      * @param restriction restriction to update
86      * @throws Exception on any error
87      */

88     public void updateIpRestriction(IpRestriction restriction) throws Exception JavaDoc;
89
90     /**
91      * Get an array of all configured IP restrictions
92      *
93      * @return Ip restrictions
94      * @throws Exception on any error
95      */

96     public IpRestriction[] getIpRestrictions() throws Exception JavaDoc;
97     
98     /**
99      * Get an IP restriction given its Id. <code>null</code> will be returned
100      * if there is no such restriction.
101      *
102      * @param id id of restriction
103      * @return ip restriction or <code>null</code> if no such restriction
104      * @throws Exception on any other error
105      */

106     public IpRestriction getIpRestriction(int id) throws Exception JavaDoc;
107
108     /**
109      * Swap priorities of <i>restriction1</i> with <i>restriction2</i>
110      * and persist to database.
111      *
112      * @param restriction1 restriction 1
113      * @param restriction2 restriction 2
114      * @throws Exception if restriction cannot be swapped
115      */

116     public void swapIpRestrictions(IpRestriction restriction1, IpRestriction restriction2) throws Exception JavaDoc;
117
118     /**
119      * @param type
120      * @param username
121      * @return List<Favorite>
122      * @throws Exception
123      */

124     public List JavaDoc<Favorite> getFavorites(int type, User username) throws Exception JavaDoc;
125
126     /**
127      * @param type
128      * @param user
129      * @param favoriteKey
130      * @return Favorite
131      * @throws Exception
132      */

133     public Favorite getFavorite(int type, User user, int favoriteKey) throws Exception JavaDoc;
134
135     /**
136      * @return List<AuthenticationScheme>
137      * @throws Exception
138      */

139     public List JavaDoc<AuthenticationScheme> getAuthenticationSchemeSequences() throws Exception JavaDoc;
140
141     /**
142      * @param realmID the realm id the authetication scheme is in.
143      * @return List<AuthenticationScheme>
144      * @throws Exception
145      */

146     public List JavaDoc<AuthenticationScheme> getAuthenticationSchemeSequences(int realmID) throws Exception JavaDoc;
147
148     /**
149      * @param id
150      * @return AuthenticationScheme
151      * @throws Exception
152      */

153     public AuthenticationScheme getAuthenticationSchemeSequence(int id) throws Exception JavaDoc;
154     
155     /**
156      * @param name
157      * @param realmID
158      * @return AuthenticationScheme
159      * @throws Exception
160      */

161     public AuthenticationScheme getAuthenticationSchemeSequence(String JavaDoc name, int realmID) throws Exception JavaDoc;
162
163     /**
164      * @param realmID
165      * @param name
166      * @param description
167      * @param modules
168      * @param enabled
169      * @param priority
170      * @return AuthenticationScheme
171      * @throws Exception
172      */

173     public AuthenticationScheme createAuthenticationSchemeSequence(int realmID, String JavaDoc name, String JavaDoc description, String JavaDoc[] modules, boolean enabled, int priority) throws Exception JavaDoc;
174
175     /**
176      * @param sequence
177      * @throws Exception
178      */

179     public void updateAuthenticationSchemeSequence(AuthenticationScheme sequence) throws Exception JavaDoc;
180     
181     /**
182      * @param scheme
183      * @param schemes
184      * @throws Exception
185      */

186     public void moveAuthenticationSchemeUp(AuthenticationScheme scheme, List JavaDoc<AuthenticationScheme> schemes) throws Exception JavaDoc;
187
188     /**
189      * @param scheme
190      * @param schemes
191      * @throws Exception
192      */

193     public void moveAuthenticationSchemeDown(AuthenticationScheme scheme, List JavaDoc<AuthenticationScheme> schemes) throws Exception JavaDoc;
194
195     /**
196      * @param id
197      * @throws Exception
198      */

199     public void deleteAuthenticationSchemeSequence(int id) throws Exception JavaDoc;
200
201 }
Popular Tags