View Javadoc

1   /***
2   Copyright (C) 2005 The Java Community
3   
4   This program is free software; you can redistribute it and/or modify  it under
5   the terms of the GNU General Public License as published by  the Free Software
6   Foundation; either version 2 of the License, or  (at your option) any later
7   version.
8   
9   This program is distributed in the hope that it will be useful,  but WITHOUT
10  ANY WARRANTY; without even the implied warranty of  MERCHANTABILITY or FITNESS
11  FOR A PARTICULAR PURPOSE. See the  GNU General Public License for more details.
12  
13  You should have received a copy of the GNU General Public License  along with
14  this program; if not, write to the Free Software  Foundation, Inc., 59 Temple
15  Place, Suite 330, Boston, MA 02111-1307 USA.
16  */
17  package org.bejug.javacareers.jobs.service;
18  
19  import java.util.List;
20  import java.util.Set;
21  
22  import org.bejug.javacareers.common.exception.DuplicateUserNameException;
23  import org.bejug.javacareers.common.exception.LastAdminException;
24  import org.bejug.javacareers.jobs.model.Country;
25  import org.bejug.javacareers.jobs.model.OfferType;
26  import org.bejug.javacareers.jobs.model.OrganisationType;
27  import org.bejug.javacareers.jobs.model.Profile;
28  import org.bejug.javacareers.jobs.model.Region;
29  import org.bejug.javacareers.jobs.model.User;
30  
31  /***
32   * The User service implementation which will be called by the view. This
33   * can be any view including RUI and/or HTML web clients.
34   *
35   * @author Sven Schauwvliege (Last modified by $Author: schauwvliege $)
36   * @version $Revision: 1.2 $ - $Date: 2005/09/13 08:10:55 $
37   */
38  public interface AdminService {
39  
40      /***
41       * stores a user.
42       * @param user A job user.
43       * @throws org.bejug.javacareers.common.exception.DuplicateUserNameException if username
44       * is already in use
45       * @throws LastAdminException when trying to change the last admin to a normal
46       * user.
47       */
48      void storeUser(User user) throws DuplicateUserNameException, LastAdminException;
49  
50      /***
51       * delete a user.
52       * @param userId the user to delete
53       * @throws LastAdminException if someone deletes the last admin.
54       */
55      void deleteUser(Integer userId) throws LastAdminException;
56      
57      /***
58       * get a user.
59       * @return a user
60       * @param userName String
61       */
62      User getUserByUserName(String userName);
63      
64      /***
65       * get a list of users.
66       * @return a list containing all the users
67       */
68      List getUsers();
69  
70      /***
71       * gets a user by id.
72       * @param id the id of the user
73       * @return the wanted user
74       */
75      User getUser(Integer id);
76      
77      
78      /***
79       * Adds a OrganisationType.
80       * @param organisationType A OrgnaisationType.
81       */
82      void storeOrganisationType(OrganisationType organisationType);
83  
84      /***
85       * delete a organisationType.
86       * @param id the id of the organisationType to delete Integer.
87       */
88      void deleteOrganisationType(Integer id);
89     
90      /***
91       * get a list of organisationType.
92       * @return a list containing all the organisationType
93       */
94      List getOrganisationTypes();
95      
96      /***
97       * gets a organisationType by id.
98       * @param id the id of the organisationType
99       * @return the wanted organisationType
100      */
101     OrganisationType getOrganisationType(Integer id);
102     
103     /***
104      * delete a offerType.
105      * @param id the id of the offerType to delete Integer.
106      */
107     void deleteOfferType(Integer id);
108    
109     /***
110      * Adds a offerType.
111      * @param offerType A OfferType.
112      */
113     void storeOfferType(OfferType offerType);
114     
115     /***
116      * get a list of offerType.
117      * @return a list containing all the offerType
118      */
119     List getOfferTypes();
120     
121     /***
122      * gets a OfferType by id.
123      * @param id the id of the OfferType
124      * @return the wanted OfferType
125      */
126     OfferType getOfferType(Integer id);
127     
128     
129     /***
130      * delete a CountryDao.
131      * @param id the id of the CountryDao to delete Integer.
132      */
133     void deleteCountry(Integer id);
134    
135     /***
136      * Adds a CountryDao.
137      * @param country the country to store.
138      */
139     void storeCountry(Country country);
140     
141     /***
142      * get a list of CountryDao.
143      * @return a list containing all the Countrys
144      */
145     List getCountries();
146     
147     /***
148      * gets a CountryDao by id.
149      * @param id the id of the CountryDao
150      * @return the wanted CountryDao
151      */
152     Country getCountry(Integer id);
153 
154     /***
155      * @param country a String containing the country.
156      * @return a set of regions.
157      */
158     Set getRegions(String country);
159 
160     /***
161      * @param region a String indication the regio to get.
162      * @return the wanted Region.
163      */
164     Region getRegionByName(String region);
165     
166     /***
167      *
168      * @param profile Profile
169      */
170     void storeProfile(Profile profile);
171 
172    /***
173     *
174     * @param id the profile id
175     */
176    void deleteProfile(Integer id);
177    
178     /***
179      *
180      * @return profiles List
181      */
182     List getProfiles();
183 }	
184 /***
185  * $Log: AdminService.java,v $
186  * Revision 1.2  2005/09/13 08:10:55  schauwvliege
187  * organize imports
188  *
189  * Revision 1.1  2005/08/26 07:58:27  ge0ffrey
190  * split up the sources in service, serviceimpl and webclient
191  *
192  * Revision 1.13  2005/08/16 09:10:14  bme_jcs
193  * checkstyle errors resolved
194  *
195  * Revision 1.12  2005/08/12 08:33:09  bme_jcs
196  * moved profile-methods from jobservice to adminservice
197  *
198  * Revision 1.11  2005/08/11 12:17:03  bavo_jcs
199  * Role change rule
200  *
201  * Revision 1.10  2005/08/10 14:00:11  schauwvliege
202  * added RegioDao
203  *
204  * Revision 1.9  2005/08/10 11:56:45  bme_jcs
205  * changed add in store
206  *
207  * Revision 1.7  2005/08/09 12:59:56  bavo_jcs
208  * Optimized imports
209  *
210  * Revision 1.6  2005/08/08 09:38:21  bme_jcs
211  * resolved checkstyle errors
212  *
213  * Revision 1.5  2005/08/03 13:16:03  bme_jcs
214  * getDao's removed and storeObject renamed to store
215  *
216  * Revision 1.4  2005/07/05 15:13:11  schauwvliege
217  * added person/contact and location to model
218  *
219  * Revision 1.3  2005/06/14 13:40:04  schauwvliege
220  * Renamed add to store
221  *
222  * Revision 1.2  2005/06/09 08:18:52  bejug_cc
223  * Fix initial import
224  *
225  * Revision 1.13  2005/06/07 12:12:56  ssc
226  * Delete last admin exception
227  *
228  * Revision 1.12  2005/06/06 10:02:09  ssc
229  * Offertype support
230  *
231  * Revision 1.11  2005/05/17 11:59:56  ssc
232  * Refactored User and Publisher class to User Class added cvAdded Boolean, added Address to user, Fixed test to work with this setup
233  *
234  * Revision 1.10  2005/05/12 08:23:55  ssc
235  * Checkstyle errors
236  *
237  * Revision 1.9  2005/05/11 17:20:39  sja
238  * corrected import of DuplicationUserNameException.
239  *
240  * Revision 1.8  2005/05/11 10:14:52  ssc
241  * Checstyle errors
242  *
243  * Revision 1.7  2005/05/10 14:38:06  ssc
244  * Deleted Salutation
245  *
246  * Revision 1.6  2005/05/10 11:59:33  ssc
247  * Duplicate user/user exception
248  *
249  * Revision 1.5  2005/05/09 14:54:45  ssc
250  * checkstyle
251  *
252  * Revision 1.4  2005/05/09 13:28:35  bme
253  * updated for the introduction of the 'generalised' parameterhandling
254  *
255  * Revision 1.3  2005/05/04 11:17:47  sja
256  * Corrected JavaDoc.
257  *
258  * Revision 1.2  2005/05/03 13:18:05  ssc
259  * Added OrganisationType in AdminService
260  *
261  * Revision 1.1  2005/05/03 11:09:25  ssc
262  * Renamed User service to AdminService
263  *
264  * Revision 1.1  2005/05/02 13:36:15  ssc
265  * First release
266  *
267  *
268  */