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

Constructor Summary
PortalLDAPUtil()
           
 
Method Summary
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.List<javax.naming.directory.SearchResult> getGroups(long companyId, javax.naming.ldap.LdapContext ldapContext, int maxResults, java.lang.String baseDN, java.lang.String groupFilter)
           
static java.util.List<javax.naming.directory.SearchResult> getGroups(long ldapServerId, long companyId, javax.naming.ldap.LdapContext ldapContext, int maxResults)
           
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.List<javax.naming.directory.SearchResult> getUsers(long companyId, javax.naming.ldap.LdapContext ldapContext, int maxResults, java.lang.String baseDN, java.lang.String userFilter)
           
static java.util.List<javax.naming.directory.SearchResult> getUsers(long ldapServerId, long companyId, javax.naming.ldap.LdapContext ldapContext, int maxResults)
           
static java.lang.String getUsersDN(long ldapServerId, long companyId)
           
static boolean hasUser(long ldapServerId, long companyId, java.lang.String screenName)
           
static java.util.List<javax.naming.directory.SearchResult> searchLDAP(long companyId, javax.naming.ldap.LdapContext ldapContext, int maxResults, java.lang.String baseDN, java.lang.String filter, java.lang.String[] attributeIds)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortalLDAPUtil

public PortalLDAPUtil()
Method Detail

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

getGroups

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

getGroups

public static java.util.List<javax.naming.directory.SearchResult> getGroups(long ldapServerId,
                                                                            long companyId,
                                                                            javax.naming.ldap.LdapContext ldapContext,
                                                                            int maxResults)
                                                                     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

getUsers

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

getUsers

public static java.util.List<javax.naming.directory.SearchResult> getUsers(long ldapServerId,
                                                                           long companyId,
                                                                           javax.naming.ldap.LdapContext ldapContext,
                                                                           int maxResults)
                                                                    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

searchLDAP

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