1 18 package sync4j.server.admin.ejb; 19 20 import javax.ejb.*; 21 22 import sync4j.framework.core.*; 23 import sync4j.framework.config.ConfigurationConstants; 24 import sync4j.framework.config.LoggingConfiguration; 25 26 import sync4j.framework.server.error.*; 27 28 import sync4j.framework.engine.source.SyncSource; 29 30 import sync4j.framework.security.Sync4jPrincipal; 31 32 import sync4j.framework.server.Sync4jUser; 33 import sync4j.framework.server.Sync4jDevice; 34 import sync4j.framework.server.Sync4jModule; 35 36 import sync4j.framework.server.store.Clause; 37 38 import sync4j.server.admin.AdminManager; 39 import sync4j.server.admin.AdminException; 40 41 import sync4j.server.config.Configuration; 42 43 59 public class AdminBean 60 implements javax.ejb.SessionBean { 61 64 private SessionContext sessionContext = null; 65 private AdminManager admin = null; 66 67 public void ejbCreate() throws CreateException { 69 admin = new AdminManager(); 70 } 71 72 public Configuration getConfig() { 73 return admin.getConfig(); 74 } 75 76 public void ejbRemove() { 77 } 78 79 public void ejbActivate() { 80 } 81 82 public void ejbPassivate() { 83 } 84 85 public void setSessionContext(SessionContext sessionContext) 86 throws EJBException { 87 this.sessionContext = sessionContext; 88 } 89 90 98 public String [] getRoles() 99 throws ServerException, AdminException { 100 return admin.getRoles(); 101 } 102 103 113 public Sync4jUser[] getUsers(Clause clause) 114 throws ServerException, AdminException { 115 return admin.getUsers(clause); 116 } 117 118 126 public void addUser(Sync4jUser user) 127 throws ServerException, AdminException { 128 admin.addUser(user); 129 } 130 131 139 public void setUser(Sync4jUser user) 140 throws ServerException, AdminException { 141 admin.setUser(user); 142 } 143 144 152 public void deleteUser(String userName) 153 throws ServerException, AdminException { 154 admin.deleteUser(userName); 155 } 156 157 167 public int countUsers(Clause clause) 168 throws ServerException, AdminException { 169 return admin.countUsers(clause); 170 } 171 172 182 public Sync4jDevice[] getDevices(Clause clauses) 183 throws ServerException, AdminException { 184 return admin.getDevices(clauses); 185 } 186 187 197 public String addDevice(Sync4jDevice d) 198 throws ServerException, AdminException { 199 return admin.addDevice(d); 200 } 201 202 210 public void setDevice(Sync4jDevice d) 211 throws ServerException, AdminException { 212 admin.setDevice(d); 213 } 214 215 223 public void deleteDevice(String deviceId) 224 throws ServerException, AdminException{ 225 admin.deleteDevice(deviceId); 226 } 227 228 238 public int countDevices(Clause clauses) 239 throws ServerException, AdminException { 240 return admin.countDevices(clauses); 241 } 242 243 253 public Sync4jPrincipal[] getPrincipals(Clause clauses) 254 throws ServerException, AdminException { 255 return admin.getPrincipals(clauses); 256 } 257 258 268 public String addPrincipal(Sync4jPrincipal p) 269 throws ServerException, AdminException { 270 return admin.addPrincipal(p); 271 } 272 273 281 public void deletePrincipal(String principalId) 282 throws ServerException, AdminException { 283 admin.deletePrincipal(principalId); 284 } 285 286 296 public int countPrincipals(Clause clauses) 297 throws ServerException, AdminException { 298 return admin.countPrincipals(clauses); 299 } 300 301 309 public Sync4jModule[] getModulesName() 310 throws ServerException, AdminException { 311 return admin.getModulesName(); 312 } 313 314 324 public Sync4jModule getModule(String moduleId) 325 throws ServerException, AdminException { 326 return admin.getModule(moduleId); 327 } 328 329 343 public void addSource(String moduleId, String connectorId, String sourceTypeId, SyncSource source) 344 throws ServerException, AdminException { 345 admin.addSource(moduleId, connectorId, sourceTypeId, source); 346 } 347 348 362 public void setSource(String moduleId, String connectorId, String sourceTypeId, SyncSource source) 363 throws ServerException, AdminException{ 364 admin.setSource(moduleId, connectorId, sourceTypeId, source); 365 } 366 367 375 public void deleteSource(String sourceUri) 376 throws ServerException, AdminException{ 377 admin.deleteSource(sourceUri); 378 } 379 380 384 public LoggingConfiguration getLoggingConfiguration() 385 throws ServerException, AdminException { 386 return admin.getLoggingConfiguration(); 387 } 388 389 397 public Object getServerBean(String bean) 398 throws ServerException, AdminException { 399 return admin.getServerBean(bean); 400 } 401 402 410 public void setServerBean(String bean, Object obj) 411 throws ServerException, AdminException { 412 admin.setServerBean(bean, obj); 413 } 414 } 415 416 | Popular Tags |