001
014
015 package com.liferay.portal.security.ldap;
016
017 import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
018 import com.liferay.portal.model.User;
019
020 import javax.naming.directory.Attributes;
021 import javax.naming.ldap.LdapContext;
022
023
029 public class PortalLDAPImporterUtil {
030
031 public static PortalLDAPImporter getPortalLDAPImporter() {
032 PortalRuntimePermission.checkGetBeanProperty(
033 PortalLDAPImporterUtil.class);
034
035 return _portalLDAPImporter;
036 }
037
038 public static void importFromLDAP() throws Exception {
039 getPortalLDAPImporter().importFromLDAP();
040 }
041
042 public static void importFromLDAP(long companyId) throws Exception {
043 getPortalLDAPImporter().importFromLDAP(companyId);
044 }
045
046 public static void importFromLDAP(long ldapServerId, long companyId)
047 throws Exception {
048
049 getPortalLDAPImporter().importFromLDAP(ldapServerId, companyId);
050 }
051
052 public static User importLDAPUser(
053 long ldapServerId, long companyId, LdapContext ldapContext,
054 Attributes attributes, String password)
055 throws Exception {
056
057 return getPortalLDAPImporter().importLDAPUser(
058 ldapServerId, companyId, ldapContext, attributes, password);
059 }
060
061 public static User importLDAPUser(
062 long ldapServerId, long companyId, String emailAddress,
063 String screenName)
064 throws Exception {
065
066 return getPortalLDAPImporter().importLDAPUser(
067 ldapServerId, companyId, emailAddress, screenName);
068 }
069
070 public static User importLDAPUser(
071 long companyId, String emailAddress, String screenName)
072 throws Exception {
073
074 return getPortalLDAPImporter().importLDAPUser(
075 companyId, emailAddress, screenName);
076 }
077
078 public static User importLDAPUserByScreenName(
079 long companyId, String screenName)
080 throws Exception {
081
082 return getPortalLDAPImporter().importLDAPUserByScreenName(
083 companyId, screenName);
084 }
085
086 public void setPortalLDAPImporter(PortalLDAPImporter portalLDAPImporter) {
087 PortalRuntimePermission.checkSetBeanProperty(getClass());
088
089 _portalLDAPImporter = portalLDAPImporter;
090 }
091
092 private static PortalLDAPImporter _portalLDAPImporter;
093
094 }