1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.security.ldap;
16  
17  import com.liferay.portal.model.User;
18  
19  import javax.naming.directory.Attributes;
20  import javax.naming.ldap.LdapContext;
21  
22  /**
23   * <a href="PortalLDAPImporterUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Edward Han
26   * @author Michael C. Han
27   * @author Brian Wing Shun Chan
28   */
29  public class PortalLDAPImporterUtil {
30  
31      public static void importFromLDAP() throws Exception {
32          _portalLDAPImporter.importFromLDAP();
33      }
34  
35      public static void importFromLDAP(long companyId) throws Exception {
36          _portalLDAPImporter.importFromLDAP(companyId);
37      }
38  
39      public static void importFromLDAP(long ldapServerId, long companyId)
40          throws Exception {
41  
42          _portalLDAPImporter.importFromLDAP(ldapServerId, companyId);
43      }
44  
45      public static User importLDAPUser(
46              long ldapServerId, long companyId, LdapContext ldapContext,
47              Attributes attributes, String password,
48              boolean importGroupMembership)
49          throws Exception {
50  
51          return _portalLDAPImporter.importLDAPUser(
52              ldapServerId, companyId, ldapContext, attributes, password,
53              importGroupMembership);
54      }
55  
56      public void setPortalLDAPImporter(PortalLDAPImporter portalLDAPImporter) {
57          _portalLDAPImporter = portalLDAPImporter;
58      }
59  
60      private static PortalLDAPImporter _portalLDAPImporter;
61  
62  }