com.liferay.portal.security.ldap
Class PortalLDAPUtil

java.lang.Object
  extended bycom.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

Field Summary
static java.lang.String IMPORT_BY_GROUP
           
static java.lang.String IMPORT_BY_USER
           
 
Constructor Summary
PortalLDAPUtil()
           
 
Method Summary
static void exportToLDAP(com.liferay.portal.model.Contact contact)
           
static void exportToLDAP(com.liferay.portal.model.User user)
           
static java.lang.String getAuthSearchFilter(long companyId, java.lang.String emailAddress, java.lang.String screenName, java.lang.String userId)
           
static javax.naming.ldap.LdapContext getContext(long companyId)
           
static java.util.Properties getGroupMappings(long companyId)
           
static java.lang.String getNameInNamespace(long companyId, javax.naming.Binding binding)
           
static javax.naming.Binding getUser(long companyId, java.lang.String screenName)
           
static java.util.Properties getUserMappings(long companyId)
           
static java.lang.String getUsersDN(long companyId)
           
static boolean hasUser(long companyId, java.lang.String screenName)
           
static void importFromLDAP()
           
static void importFromLDAP(long companyId)
           
static com.liferay.portal.model.UserGroup importLDAPGroup(long companyId, javax.naming.ldap.LdapContext ctx, javax.naming.directory.Attributes attrs, boolean importGroupMembership)
           
static com.liferay.portal.model.User importLDAPUser(long companyId, javax.naming.ldap.LdapContext ctx, javax.naming.directory.Attributes attrs, boolean importGroupMembership)
           
static com.liferay.portal.model.User importLDAPUser(long companyId, javax.naming.ldap.LdapContext ctx, javax.naming.directory.Attributes attrs, java.lang.String emailAddress, java.lang.String screenName, java.lang.String password, boolean importGroupMembership)
           
static boolean isAuthEnabled(long companyId)
           
static boolean isExportEnabled(long companyId)
           
static boolean isImportEnabled(long companyId)
           
static boolean isImportOnStartup(long companyId)
           
static boolean isNtlmEnabled(long companyId)
           
static boolean isPasswordPolicyEnabled(long companyId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMPORT_BY_USER

public static final java.lang.String IMPORT_BY_USER
See Also:
Constant Field Values

IMPORT_BY_GROUP

public static final java.lang.String IMPORT_BY_GROUP
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
Throws:
java.lang.Exception

exportToLDAP

public static void exportToLDAP(com.liferay.portal.model.User user)
                         throws java.lang.Exception
Throws:
java.lang.Exception

getAuthSearchFilter

public static java.lang.String getAuthSearchFilter(long companyId,
                                                   java.lang.String emailAddress,
                                                   java.lang.String screenName,
                                                   java.lang.String userId)
                                            throws com.liferay.portal.PortalException,
                                                   com.liferay.portal.SystemException
Throws:
com.liferay.portal.PortalException
com.liferay.portal.SystemException

getContext

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

getGroupMappings

public static java.util.Properties getGroupMappings(long companyId)
                                             throws java.lang.Exception
Throws:
java.lang.Exception

getNameInNamespace

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

getUser

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

getUserMappings

public static java.util.Properties getUserMappings(long companyId)
                                            throws java.lang.Exception
Throws:
java.lang.Exception

getUsersDN

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

hasUser

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

importFromLDAP

public static void importFromLDAP()
                           throws java.lang.Exception
Throws:
java.lang.Exception

importFromLDAP

public static void importFromLDAP(long companyId)
                           throws java.lang.Exception
Throws:
java.lang.Exception

importLDAPGroup

public static com.liferay.portal.model.UserGroup importLDAPGroup(long companyId,
                                                                 javax.naming.ldap.LdapContext ctx,
                                                                 javax.naming.directory.Attributes attrs,
                                                                 boolean importGroupMembership)
                                                          throws java.lang.Exception
Throws:
java.lang.Exception

importLDAPUser

public static com.liferay.portal.model.User importLDAPUser(long companyId,
                                                           javax.naming.ldap.LdapContext ctx,
                                                           javax.naming.directory.Attributes attrs,
                                                           boolean importGroupMembership)
                                                    throws java.lang.Exception
Throws:
java.lang.Exception

importLDAPUser

public static com.liferay.portal.model.User importLDAPUser(long companyId,
                                                           javax.naming.ldap.LdapContext ctx,
                                                           javax.naming.directory.Attributes attrs,
                                                           java.lang.String emailAddress,
                                                           java.lang.String screenName,
                                                           java.lang.String password,
                                                           boolean importGroupMembership)
                                                    throws java.lang.Exception
Throws:
java.lang.Exception

isAuthEnabled

public static boolean isAuthEnabled(long companyId)
                             throws com.liferay.portal.PortalException,
                                    com.liferay.portal.SystemException
Throws:
com.liferay.portal.PortalException
com.liferay.portal.SystemException

isExportEnabled

public static boolean isExportEnabled(long companyId)
                               throws com.liferay.portal.PortalException,
                                      com.liferay.portal.SystemException
Throws:
com.liferay.portal.PortalException
com.liferay.portal.SystemException

isImportEnabled

public static boolean isImportEnabled(long companyId)
                               throws com.liferay.portal.PortalException,
                                      com.liferay.portal.SystemException
Throws:
com.liferay.portal.PortalException
com.liferay.portal.SystemException

isImportOnStartup

public static boolean isImportOnStartup(long companyId)
                                 throws com.liferay.portal.PortalException,
                                        com.liferay.portal.SystemException
Throws:
com.liferay.portal.PortalException
com.liferay.portal.SystemException

isNtlmEnabled

public static boolean isNtlmEnabled(long companyId)
                             throws com.liferay.portal.PortalException,
                                    com.liferay.portal.SystemException
Throws:
com.liferay.portal.PortalException
com.liferay.portal.SystemException

isPasswordPolicyEnabled

public static boolean isPasswordPolicyEnabled(long companyId)
                                       throws com.liferay.portal.PortalException,
                                              com.liferay.portal.SystemException
Throws:
com.liferay.portal.PortalException
com.liferay.portal.SystemException