001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.security.ldap;
016    
017    import com.liferay.portal.model.Contact;
018    import com.liferay.portal.model.User;
019    import com.liferay.portal.model.UserGroup;
020    
021    import java.io.Serializable;
022    
023    import java.util.List;
024    import java.util.Map;
025    import java.util.Properties;
026    
027    import javax.naming.directory.Attributes;
028    
029    /**
030     * @author Michael C. Han
031     * @author Brian Wing Shun Chan
032     * @author Marcellus Tavares
033     * @author Wesley Gong
034     */
035    public interface PortalToLDAPConverter {
036    
037            public String getGroupDNName(
038                            long ldapServerId, UserGroup userGroup, Properties groupMappings)
039                    throws Exception;
040    
041            public Modifications getLDAPContactModifications(
042                            Contact contact, Map<String, Serializable> contactExpandoAttributes,
043                            Properties contactMappings, Properties contactExpandoMappings)
044                    throws Exception;
045    
046            public Attributes getLDAPGroupAttributes(
047                            long ldapServerId, UserGroup userGroup, User user,
048                            Properties groupMappings, Properties userMappings)
049                    throws Exception;
050    
051            /**
052             * @deprecated
053             */
054            public Modifications getLDAPGroupModifications(
055                            long ldapServerId, UserGroup userGroup, User user,
056                            Properties groupMappings, Properties userMappings)
057                    throws Exception;
058    
059            public Modifications getLDAPGroupModifications(
060                            long ldapServerId, UserGroup userGroup, User user,
061                            Properties groupMappings, Properties userMappings,
062                            LDAPOperation ldapOperation)
063                    throws Exception;
064    
065            public Attributes getLDAPUserAttributes(
066                            long ldapServerId, User user, Properties userMappings)
067                    throws Exception;
068    
069            public Modifications getLDAPUserGroupModifications(
070                            long ldapServerId, List<UserGroup> userGroups, User user,
071                            Properties userMappings)
072                    throws Exception;
073    
074            public Modifications getLDAPUserModifications(
075                            User user, Map<String, Serializable> userExpandoAttributes,
076                            Properties userMappings, Properties userExpandoMappings)
077                    throws Exception;
078    
079            public String getUserDNName(
080                            long ldapServerId, User user, Properties userMappings)
081                    throws Exception;
082    
083    }