com.liferay.portal.security.ldap
Class PortalLDAPUtil

java.lang.Object
  extended by com.liferay.portal.security.ldap.PortalLDAPUtil

public class PortalLDAPUtil
extends java.lang.Object

View Source

Author:
Michael Young, Brian Wing Shun Chan, Jerry Niu, Scott Lee, Hervé Ménage, Samuel Kong, Ryan Park, Wesley Gong

Field Summary
static java.lang.String IMPORT_BY_GROUP
          Deprecated. Use PortalLDAPImporter.IMPORT_BY_GROUP.
static java.lang.String IMPORT_BY_USER
          Deprecated. Use PortalLDAPImporter.IMPORT_BY_USER.
 
Constructor Summary
PortalLDAPUtil()
           
 
Method Summary
static void exportToLDAP(com.liferay.portal.model.Contact contact)
          Deprecated. Use PortalLDAPExporter.exportToLDAP(Contact).
static void exportToLDAP(com.liferay.portal.model.User user)
          Deprecated. Use PortalLDAPExporter.exportToLDAP(User).
static java.lang.String getAuthSearchFilter(long ldapServerId, long companyId, java.lang.String emailAddress, java.lang.String screenName, java.lang.String userId)
          Deprecated. Use LDAPSettingsUtil.getAuthSearchFilter(long, long, String, String, String).
static javax.naming.ldap.LdapContext getContext(long ldapServerId, long companyId)
           
static javax.naming.ldap.LdapContext getContext(long companyId, java.lang.String providerURL, java.lang.String principal, java.lang.String credentials)
           
static javax.naming.directory.Attributes getGroupAttributes(long ldapServerId, long companyId, javax.naming.ldap.LdapContext ldapContext, java.lang.String fullDistinguishedName)
           
static javax.naming.directory.Attributes getGroupAttributes(long ldapServerId, long companyId, javax.naming.ldap.LdapContext ldapContext, java.lang.String fullDistinguishedName, boolean includeReferenceAttributes)
           
static java.util.Properties getGroupMappings(long ldapServerId, long companyId)
          Deprecated. Use LDAPSettingsUtil.getGroupMappings(long, long).
static byte[] getGroups(long companyId, javax.naming.ldap.LdapContext ldapContext, byte[] cookie, int maxResults, java.lang.String baseDN, java.lang.String groupFilter, java.util.List<javax.naming.directory.SearchResult> searchResults)
           
static byte[] getGroups(long companyId, javax.naming.ldap.LdapContext ldapContext, byte[] cookie, int maxResults, java.lang.String baseDN, java.lang.String groupFilter, java.lang.String[] attributeIds, java.util.List<javax.naming.directory.SearchResult> searchResults)
           
static byte[] getGroups(long ldapServerId, long companyId, javax.naming.ldap.LdapContext ldapContext, byte[] cookie, int maxResults, java.util.List<javax.naming.directory.SearchResult> searchResults)
           
static byte[] getGroups(long ldapServerId, long companyId, javax.naming.ldap.LdapContext ldapContext, byte[] cookie, int maxResults, java.lang.String[] attributeIds, java.util.List<javax.naming.directory.SearchResult> searchResults)
           
static long getLdapServerId(long companyId, java.lang.String screenName)
           
static javax.naming.directory.Attribute getMultivaluedAttribute(long companyId, javax.naming.ldap.LdapContext ldapContext, java.lang.String baseDN, java.lang.String filter, javax.naming.directory.Attribute attribute)
           
static java.lang.String getNameInNamespace(long ldapServerId, long companyId, javax.naming.Binding binding)
           
static javax.naming.Binding getUser(long ldapServerId, long companyId, java.lang.String screenName)
           
static javax.naming.directory.Attributes getUserAttributes(long ldapServerId, long companyId, javax.naming.ldap.LdapContext ldapContext, java.lang.String fullDistinguishedName)
           
static java.util.Properties getUserMappings(long ldapServerId, long companyId)
          Deprecated. Use LDAPSettingsUtil.getUserMappings(long, long).
static byte[] getUsers(long companyId, javax.naming.ldap.LdapContext ldapContext, byte[] cookie, int maxResults, java.lang.String baseDN, java.lang.String userFilter, java.util.List<javax.naming.directory.SearchResult> searchResults)
           
static byte[] getUsers(long companyId, javax.naming.ldap.LdapContext ldapContext, byte[] cookie, int maxResults, java.lang.String baseDN, java.lang.String userFilter, java.lang.String[] attributeIds, java.util.List<javax.naming.directory.SearchResult> searchResults)
           
static byte[] getUsers(long ldapServerId, long companyId, javax.naming.ldap.LdapContext ldapContext, byte[] cookie, int maxResults, java.util.List<javax.naming.directory.SearchResult> searchResults)
           
static byte[] getUsers(long ldapServerId, long companyId, javax.naming.ldap.LdapContext ldapContext, byte[] cookie, int maxResults, java.lang.String[] attributeIds, java.util.List<javax.naming.directory.SearchResult> searchResults)
           
static java.lang.String getUsersDN(long ldapServerId, long companyId)
           
static boolean hasUser(long ldapServerId, long companyId, java.lang.String screenName)
           
static void importFromLDAP()
          Deprecated. Use PortalLDAPImporter.importFromLDAP().
static void importFromLDAP(long companyId)
          Deprecated. Use PortalLDAPImporter.importFromLDAP(long).
static void importFromLDAP(long ldapServerId, long companyId)
          Deprecated. Use PortalLDAPImporter.importFromLDAP(long, long).
static com.liferay.portal.model.UserGroup importLDAPGroup(long ldapServerId, long companyId, javax.naming.ldap.LdapContext ldapContext, javax.naming.directory.Attributes attributes, boolean importGroupMembership)
          Deprecated. Use PortalLDAPImporter.importLDAPGroup(long, long, LdapContext, Attributes, boolean).
static com.liferay.portal.model.User importLDAPUser(long ldapServerId, long companyId, javax.naming.ldap.LdapContext ldapContext, javax.naming.directory.Attributes attributes, java.lang.String password, boolean importGroupMembership)
          Deprecated. Use PortalLDAPImporter#importLDAPUser(long, long, LdapContext, Attributes, boolean).
static boolean isAuthEnabled(long companyId)
          Deprecated. Use AuthSettingsUtil.isLDAPAuthEnabled(long).
static boolean isExportEnabled(long companyId)
          Deprecated. Use LDAPSettingsUtil.isExportEnabled(long).
static boolean isImportEnabled(long companyId)
          Deprecated. Use LDAPSettingsUtil.isImportEnabled(long).
static boolean isImportOnStartup(long companyId)
          Deprecated. Use LDAPSettingsUtil.isImportOnStartup(long).
static boolean isNtlmEnabled(long companyId)
          Deprecated. Use AuthSettingsUtil.isNtlmEnabled(long).
static boolean isPasswordPolicyEnabled(long companyId)
          Deprecated. Use LDAPSettingsUtil.isPasswordPolicyEnabled(long).
static boolean isSiteMinderEnabled(long companyId)
          Deprecated. Use AuthSettingsUtil.isSiteMinderEnabled(long).
static byte[] searchLDAP(long companyId, javax.naming.ldap.LdapContext ldapContext, byte[] cookie, int maxResults, java.lang.String baseDN, java.lang.String filter, java.lang.String[] attributeIds, java.util.List<javax.naming.directory.SearchResult> searchResults)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMPORT_BY_GROUP

public static final java.lang.String IMPORT_BY_GROUP
Deprecated. Use PortalLDAPImporter.IMPORT_BY_GROUP.
See Also:
Constant Field Values

IMPORT_BY_USER

public static final java.lang.String IMPORT_BY_USER
Deprecated. Use PortalLDAPImporter.IMPORT_BY_USER.
See Also:
Constant Field Values
Constructor Detail

PortalLDAPUtil

public PortalLDAPUtil()
Method Detail

exportToLDAP

public static void exportToLDAP(com.liferay.portal.model.Contact contact)
                         throws java.lang.Exception
Deprecated. Use PortalLDAPExporter.exportToLDAP(Contact).

Throws:
java.lang.Exception

exportToLDAP

public static void exportToLDAP(com.liferay.portal.model.User user)
                         throws java.lang.Exception
Deprecated. Use PortalLDAPExporter.exportToLDAP(User).

Throws:
java.lang.Exception

getAuthSearchFilter

public static java.lang.String getAuthSearchFilter(long ldapServerId,
                                                   long companyId,
                                                   java.lang.String emailAddress,
                                                   java.lang.String screenName,
                                                   java.lang.String userId)
                                            throws com.liferay.portal.SystemException
Deprecated. Use LDAPSettingsUtil.getAuthSearchFilter(long, long, String, String, String).

Throws:
com.liferay.portal.SystemException

getContext

public static javax.naming.ldap.LdapContext getContext(long ldapServerId,
                                                       long companyId)
                                                throws java.lang.Exception
Throws:
java.lang.Exception

getContext

public static javax.naming.ldap.LdapContext getContext(long companyId,
                                                       java.lang.String providerURL,
                                                       java.lang.String principal,
                                                       java.lang.String credentials)
                                                throws java.lang.Exception
Throws:
java.lang.Exception

getGroupAttributes

public static javax.naming.directory.Attributes getGroupAttributes(long ldapServerId,
                                                                   long companyId,
                                                                   javax.naming.ldap.LdapContext ldapContext,
                                                                   java.lang.String fullDistinguishedName)
                                                            throws java.lang.Exception
Throws:
java.lang.Exception

getGroupAttributes

public static javax.naming.directory.Attributes getGroupAttributes(long ldapServerId,
                                                                   long companyId,
                                                                   javax.naming.ldap.LdapContext ldapContext,
                                                                   java.lang.String fullDistinguishedName,
                                                                   boolean includeReferenceAttributes)
                                                            throws java.lang.Exception
Throws:
java.lang.Exception

getGroupMappings

public static java.util.Properties getGroupMappings(long ldapServerId,
                                                    long companyId)
                                             throws java.lang.Exception
Deprecated. Use LDAPSettingsUtil.getGroupMappings(long, long).

Throws:
java.lang.Exception

getGroups

public static byte[] getGroups(long companyId,
                               javax.naming.ldap.LdapContext ldapContext,
                               byte[] cookie,
                               int maxResults,
                               java.lang.String baseDN,
                               java.lang.String groupFilter,
                               java.util.List<javax.naming.directory.SearchResult> searchResults)
                        throws java.lang.Exception
Throws:
java.lang.Exception

getGroups

public static byte[] getGroups(long companyId,
                               javax.naming.ldap.LdapContext ldapContext,
                               byte[] cookie,
                               int maxResults,
                               java.lang.String baseDN,
                               java.lang.String groupFilter,
                               java.lang.String[] attributeIds,
                               java.util.List<javax.naming.directory.SearchResult> searchResults)
                        throws java.lang.Exception
Throws:
java.lang.Exception

getGroups

public static byte[] getGroups(long ldapServerId,
                               long companyId,
                               javax.naming.ldap.LdapContext ldapContext,
                               byte[] cookie,
                               int maxResults,
                               java.util.List<javax.naming.directory.SearchResult> searchResults)
                        throws java.lang.Exception
Throws:
java.lang.Exception

getGroups

public static byte[] getGroups(long ldapServerId,
                               long companyId,
                               javax.naming.ldap.LdapContext ldapContext,
                               byte[] cookie,
                               int maxResults,
                               java.lang.String[] attributeIds,
                               java.util.List<javax.naming.directory.SearchResult> searchResults)
                        throws java.lang.Exception
Throws:
java.lang.Exception

getLdapServerId

public static long getLdapServerId(long companyId,
                                   java.lang.String screenName)
                            throws java.lang.Exception
Throws:
java.lang.Exception

getMultivaluedAttribute

public static javax.naming.directory.Attribute getMultivaluedAttribute(long companyId,
                                                                       javax.naming.ldap.LdapContext ldapContext,
                                                                       java.lang.String baseDN,
                                                                       java.lang.String filter,
                                                                       javax.naming.directory.Attribute attribute)
                                                                throws java.lang.Exception
Throws:
java.lang.Exception

getNameInNamespace

public static java.lang.String getNameInNamespace(long ldapServerId,
                                                  long companyId,
                                                  javax.naming.Binding binding)
                                           throws java.lang.Exception
Throws:
java.lang.Exception

getUser

public static javax.naming.Binding getUser(long ldapServerId,
                                           long companyId,
                                           java.lang.String screenName)
                                    throws java.lang.Exception
Throws:
java.lang.Exception

getUserAttributes

public static javax.naming.directory.Attributes getUserAttributes(long ldapServerId,
                                                                  long companyId,
                                                                  javax.naming.ldap.LdapContext ldapContext,
                                                                  java.lang.String fullDistinguishedName)
                                                           throws java.lang.Exception
Throws:
java.lang.Exception

getUserMappings

public static java.util.Properties getUserMappings(long ldapServerId,
                                                   long companyId)
                                            throws java.lang.Exception
Deprecated. Use LDAPSettingsUtil.getUserMappings(long, long).

Throws:
java.lang.Exception

getUsers

public static byte[] getUsers(long companyId,
                              javax.naming.ldap.LdapContext ldapContext,
                              byte[] cookie,
                              int maxResults,
                              java.lang.String baseDN,
                              java.lang.String userFilter,
                              java.util.List<javax.naming.directory.SearchResult> searchResults)
                       throws java.lang.Exception
Throws:
java.lang.Exception

getUsers

public static byte[] getUsers(long companyId,
                              javax.naming.ldap.LdapContext ldapContext,
                              byte[] cookie,
                              int maxResults,
                              java.lang.String baseDN,
                              java.lang.String userFilter,
                              java.lang.String[] attributeIds,
                              java.util.List<javax.naming.directory.SearchResult> searchResults)
                       throws java.lang.Exception
Throws:
java.lang.Exception

getUsers

public static byte[] getUsers(long ldapServerId,
                              long companyId,
                              javax.naming.ldap.LdapContext ldapContext,
                              byte[] cookie,
                              int maxResults,
                              java.util.List<javax.naming.directory.SearchResult> searchResults)
                       throws java.lang.Exception
Throws:
java.lang.Exception

getUsers

public static byte[] getUsers(long ldapServerId,
                              long companyId,
                              javax.naming.ldap.LdapContext ldapContext,
                              byte[] cookie,
                              int maxResults,
                              java.lang.String[] attributeIds,
                              java.util.List<javax.naming.directory.SearchResult> searchResults)
                       throws java.lang.Exception
Throws:
java.lang.Exception

getUsersDN

public static java.lang.String getUsersDN(long ldapServerId,
                                          long companyId)
                                   throws java.lang.Exception
Throws:
java.lang.Exception

hasUser

public static boolean hasUser(long ldapServerId,
                              long companyId,
                              java.lang.String screenName)
                       throws java.lang.Exception
Throws:
java.lang.Exception

importFromLDAP

public static void importFromLDAP()
                           throws java.lang.Exception
Deprecated. Use PortalLDAPImporter.importFromLDAP().

Throws:
java.lang.Exception

importFromLDAP

public static void importFromLDAP(long companyId)
                           throws java.lang.Exception
Deprecated. Use PortalLDAPImporter.importFromLDAP(long).

Throws:
java.lang.Exception

importFromLDAP

public static void importFromLDAP(long ldapServerId,
                                  long companyId)
                           throws java.lang.Exception
Deprecated. Use PortalLDAPImporter.importFromLDAP(long, long).

Throws:
java.lang.Exception

importLDAPGroup

public static com.liferay.portal.model.UserGroup importLDAPGroup(long ldapServerId,
                                                                 long companyId,
                                                                 javax.naming.ldap.LdapContext ldapContext,
                                                                 javax.naming.directory.Attributes attributes,
                                                                 boolean importGroupMembership)
                                                          throws java.lang.Exception
Deprecated. Use PortalLDAPImporter.importLDAPGroup(long, long, LdapContext, Attributes, boolean).

Throws:
java.lang.Exception

importLDAPUser

public static com.liferay.portal.model.User importLDAPUser(long ldapServerId,
                                                           long companyId,
                                                           javax.naming.ldap.LdapContext ldapContext,
                                                           javax.naming.directory.Attributes attributes,
                                                           java.lang.String password,
                                                           boolean importGroupMembership)
                                                    throws java.lang.Exception
Deprecated. Use PortalLDAPImporter#importLDAPUser(long, long, LdapContext, Attributes, boolean).

Throws:
java.lang.Exception

isAuthEnabled

public static boolean isAuthEnabled(long companyId)
                             throws com.liferay.portal.SystemException
Deprecated. Use AuthSettingsUtil.isLDAPAuthEnabled(long).

Throws:
com.liferay.portal.SystemException

isExportEnabled

public static boolean isExportEnabled(long companyId)
                               throws com.liferay.portal.SystemException
Deprecated. Use LDAPSettingsUtil.isExportEnabled(long).

Throws:
com.liferay.portal.SystemException

isImportEnabled

public static boolean isImportEnabled(long companyId)
                               throws com.liferay.portal.SystemException
Deprecated. Use LDAPSettingsUtil.isImportEnabled(long).

Throws:
com.liferay.portal.SystemException

isImportOnStartup

public static boolean isImportOnStartup(long companyId)
                                 throws com.liferay.portal.SystemException
Deprecated. Use LDAPSettingsUtil.isImportOnStartup(long).

Throws:
com.liferay.portal.SystemException

isNtlmEnabled

public static boolean isNtlmEnabled(long companyId)
                             throws com.liferay.portal.SystemException
Deprecated. Use AuthSettingsUtil.isNtlmEnabled(long).

Throws:
com.liferay.portal.SystemException

isPasswordPolicyEnabled

public static boolean isPasswordPolicyEnabled(long companyId)
                                       throws com.liferay.portal.SystemException
Deprecated. Use LDAPSettingsUtil.isPasswordPolicyEnabled(long).

Throws:
com.liferay.portal.SystemException

isSiteMinderEnabled

public static boolean isSiteMinderEnabled(long companyId)
                                   throws com.liferay.portal.SystemException
Deprecated. Use AuthSettingsUtil.isSiteMinderEnabled(long).

Throws:
com.liferay.portal.SystemException

searchLDAP

public static byte[] searchLDAP(long companyId,
                                javax.naming.ldap.LdapContext ldapContext,
                                byte[] cookie,
                                int maxResults,
                                java.lang.String baseDN,
                                java.lang.String filter,
                                java.lang.String[] attributeIds,
                                java.util.List<javax.naming.directory.SearchResult> searchResults)
                         throws java.lang.Exception
Throws:
java.lang.Exception