01: /* Copyright 2003 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal.groups.filesystem;
07:
08: import org.jasig.portal.groups.ComponentGroupServiceDescriptor;
09: import org.jasig.portal.groups.GroupsException;
10: import org.jasig.portal.groups.IEntityGroupStore;
11: import org.jasig.portal.groups.IEntityGroupStoreFactory;
12: import org.jasig.portal.groups.IEntityStore;
13: import org.jasig.portal.groups.IEntityStoreFactory;
14: import org.apache.commons.logging.Log;
15: import org.apache.commons.logging.LogFactory;
16:
17: /**
18: * Returns <code>IEntityGroupStore</code> and <code>IEntityStore</code>
19: * implementations for the file system group service.
20: *
21: * @author Dan Ellentuck
22: * @version $Revision: 35547 $
23: */
24:
25: public class FileSystemGroupStoreFactory implements
26: IEntityGroupStoreFactory, IEntityStoreFactory {
27: private static final Log log = LogFactory
28: .getLog(FileSystemGroupStoreFactory.class);
29:
30: /**
31: * ReferenceGroupServiceFactory constructor.
32: */
33: public FileSystemGroupStoreFactory() {
34: super ();
35: }
36:
37: /**
38: * @return org.jasig.portal.groups.filesystem.FileSystemGroupStore
39: */
40: protected static FileSystemGroupStore getGroupStore()
41: throws GroupsException {
42: return new FileSystemGroupStore();
43: }
44:
45: /**
46: * Return an instance of the entity store implementation.
47: * @return IEntityStore
48: * @exception GroupsException
49: */
50: public IEntityStore newEntityStore() throws GroupsException {
51: return getGroupStore();
52: }
53:
54: /**
55: * Return an instance of the entity group store implementation.
56: * @return IEntityGroupStore
57: * @exception GroupsException
58: */
59: public IEntityGroupStore newGroupStore() throws GroupsException {
60: return newGroupStore(null);
61: }
62:
63: /**
64: * Return an instance of the entity group store implementation.
65: * @return IEntityGroupStore
66: * @exception GroupsException
67: */
68: public IEntityGroupStore newGroupStore(
69: ComponentGroupServiceDescriptor svcDescriptor)
70: throws GroupsException {
71: FileSystemGroupStore fsGroupStore = (FileSystemGroupStore) getGroupStore();
72: String groupsRoot = (String) svcDescriptor.get("groupsRoot");
73: if (groupsRoot != null) {
74: fsGroupStore.setGroupsRootPath(groupsRoot);
75: }
76: return fsGroupStore;
77: }
78: }
|