01: /* Copyright 2002 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.ldap;
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.apache.commons.logging.Log;
13: import org.apache.commons.logging.LogFactory;
14:
15: /**
16: * Returns an instance of the ldap <code>IEntityGroupStore</code>.
17: * @author Dan Ellentuck
18: * @version $Revision: 35435 $
19: */
20:
21: public class LDAPGroupStoreFactory implements IEntityGroupStoreFactory {
22: private static final Log log = LogFactory
23: .getLog(LDAPGroupStoreFactory.class);
24: protected static LDAPGroupStore groupStore;
25:
26: /**
27: * ReferenceGroupServiceFactory constructor.
28: */
29: public LDAPGroupStoreFactory() {
30: super ();
31: }
32:
33: /**
34: * @return org.jasig.portal.groups.ldap.LDAPGroupStore
35: */
36: protected static synchronized LDAPGroupStore getGroupStore() {
37: if (groupStore == null) {
38: groupStore = new LDAPGroupStore();
39: }
40: return groupStore;
41: }
42:
43: /**
44: * Return an instance of the group store implementation.
45: * @return IEntityGroupStore
46: * @exception GroupsException
47: */
48: public IEntityGroupStore newGroupStore() throws GroupsException {
49: return newGroupStore(null);
50: }
51:
52: /**
53: * Return an instance of the group store implementation.
54: * @return IEntityGroupStore
55: * @exception GroupsException
56: */
57: public IEntityGroupStore newGroupStore(
58: ComponentGroupServiceDescriptor svcDescriptor)
59: throws GroupsException {
60: return newInstance();
61: }
62:
63: /**
64: * Return an instance of the group store implementation.
65: * @return IEntityGroupStore
66: * @exception GroupsException
67: */
68: public IEntityGroupStore newInstance() throws GroupsException {
69: return getGroupStore();
70: }
71: }
|