KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sync4j > server > admin > ejb > AdminLocal


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

18 package sync4j.server.admin.ejb;
19
20 import javax.ejb.*;
21
22 import sync4j.framework.config.LoggingConfiguration;
23 import sync4j.framework.engine.source.SyncSource;
24 import sync4j.framework.security.Sync4jPrincipal;
25 import sync4j.framework.server.Sync4jUser;
26 import sync4j.framework.server.Sync4jDevice;
27 import sync4j.framework.server.store.Clause;
28 import sync4j.framework.server.Sync4jModule;
29 import sync4j.framework.server.error.ServerException;
30 import sync4j.framework.server.Sync4jModule;
31
32 import sync4j.server.admin.AdminException;
33
34 import sync4j.server.config.Configuration;
35
36 /**
37  *
38  * @author Luigia Fassina @ Funambol
39  *
40  * @version $Id: AdminLocal.java,v 1.6 2005/06/07 08:59:59 luigiafassina Exp $
41  *
42  */

43 public interface AdminLocal extends EJBLocalObject {
44
45     /**
46      * CONFIGURATION
47      */

48     public Configuration getConfig();
49
50     /**
51      * USER
52      */

53     public String JavaDoc[] getRoles()
54     throws ServerException, AdminException;
55
56     public Sync4jUser[] getUsers(Clause clause)
57     throws ServerException, AdminException;
58
59     public void addUser(Sync4jUser u)
60     throws ServerException, AdminException;
61
62     public void setUser(Sync4jUser u)
63     throws ServerException, AdminException;
64
65     public void deleteUser(String JavaDoc userName)
66     throws ServerException, AdminException;
67
68     public int countUsers(Clause clause)
69     throws ServerException, AdminException;
70
71
72     /**
73      * DEVICE
74      */

75     public Sync4jDevice[] getDevices(Clause clause)
76     throws ServerException, AdminException;
77
78     public String JavaDoc addDevice(Sync4jDevice d)
79     throws ServerException, AdminException;
80
81     public void setDevice(Sync4jDevice d)
82     throws ServerException, AdminException;
83
84     public void deleteDevice(String JavaDoc deviceId)
85     throws ServerException, AdminException;
86     
87     public int countDevices(Clause clause)
88     throws ServerException, AdminException;
89
90
91     /**
92      * PRINCIPAL
93      */

94     public Sync4jPrincipal[] getPrincipals(Clause clause)
95     throws ServerException, AdminException;
96
97     public String JavaDoc addPrincipal(Sync4jPrincipal p)
98     throws ServerException, AdminException;
99
100     public void deletePrincipal(String JavaDoc principalId)
101     throws ServerException, AdminException;
102     
103     public int countPrincipals(Clause clause)
104     throws ServerException, AdminException;
105     
106
107     /**
108      * MODULE
109      */

110     public Sync4jModule[] getModulesName()
111     throws ServerException, AdminException;
112
113     public Sync4jModule getModule(String JavaDoc moduleId)
114     throws ServerException, AdminException;
115
116     /**
117      * SOURCE
118      */

119     public void addSource(String JavaDoc moduleId, String JavaDoc connectorId, String JavaDoc sourceTypeId, SyncSource source)
120     throws ServerException, AdminException;
121
122     public void setSource(String JavaDoc moduleId, String JavaDoc connectorId, String JavaDoc sourceTypeId, SyncSource source)
123     throws ServerException, AdminException;
124
125     public void deleteSource(String JavaDoc sourceUri)
126     throws ServerException, AdminException;
127     
128     /**
129      * SETTINGS
130      */

131     
132     /**
133      * NOTE: do not use this method as it will be replaced by
134      * getServerConfiguration() in Sync4j 2.5
135      */

136     public LoggingConfiguration getLoggingConfiguration()
137     throws ServerException, AdminException;
138     
139     /**
140      * SERVER BEANS
141      */

142     
143     /**
144      * Returns the server bean with the given name. If the bean does not exist,
145      * am AdminException is thrown.
146      *
147      * @param bean the server bean
148      *
149      * @throws ServerException, AdminException
150      */

151     public Object JavaDoc getServerBean(String JavaDoc bean)
152     throws ServerException, AdminException;
153     
154     /**
155      * Sets the server bean with the given name.
156      *
157      * @param bean the server bean
158      * @param obj the bean instance
159      *
160      * @throws ServerException, AdminException
161      */

162     public void setServerBean(String JavaDoc bean, Object JavaDoc obj)
163     throws ServerException, AdminException;
164
165 }
166
Popular Tags