KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > efs > openreports > providers > impl > UserProviderImpl


1 /*
2  * Copyright (C) 2002 Erik Swenson - eswenson@opensourcesoft.net
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the Free
6  * Software Foundation; either version 2 of the License, or (at your option)
7  * any later 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
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
16  * Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  */

19
20 package org.efs.openreports.providers.impl;
21
22 import java.util.List JavaDoc;
23
24 import org.apache.log4j.Logger;
25 import org.efs.openreports.objects.ReportUser;
26 import org.efs.openreports.providers.ProviderException;
27 import org.efs.openreports.providers.UserProvider;
28 import org.efs.openreports.providers.persistence.UserPersistenceProvider;
29
30 public class UserProviderImpl implements UserProvider
31 {
32     protected static Logger log =
33         Logger.getLogger(UserProviderImpl.class.getName());
34     
35     private UserPersistenceProvider userPersistenceProvider;
36
37     public UserProviderImpl() throws ProviderException
38     {
39         userPersistenceProvider = new UserPersistenceProvider();
40
41         log.info("UserProviderImpl created");
42     }
43
44     public ReportUser getUser(String JavaDoc name) throws ProviderException
45     {
46         return userPersistenceProvider.getUser(name);
47     }
48
49     public ReportUser getUser(Integer JavaDoc id) throws ProviderException
50     {
51         return userPersistenceProvider.getUser(id);
52     }
53
54     public List JavaDoc getUsers() throws ProviderException
55     {
56         return userPersistenceProvider.getUsers();
57     }
58
59     public ReportUser insertUser(ReportUser user) throws ProviderException
60     {
61         return userPersistenceProvider.insertUser(user);
62     }
63
64     public void updateUser(ReportUser user) throws ProviderException
65     {
66         userPersistenceProvider.updateUser(user);
67     }
68
69     public void deleteUser(ReportUser user) throws ProviderException
70     {
71         userPersistenceProvider.deleteUser(user);
72     }
73 }
Popular Tags