001    /**
002     * Copyright (c) 2000-present 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    import com.liferay.portal.security.exportimport.UserOperation;
021    
022    import java.io.Serializable;
023    
024    import java.util.List;
025    import java.util.Map;
026    import java.util.Properties;
027    
028    import javax.naming.directory.Attributes;
029    
030    /**
031     * @author Michael C. Han
032     * @author Brian Wing Shun Chan
033     * @author Marcellus Tavares
034     * @author Wesley Gong
035     */
036    public interface PortalToLDAPConverter {
037    
038            public String getGroupDNName(
039                            long ldapServerId, UserGroup userGroup, Properties groupMappings)
040                    throws Exception;
041    
042            public Modifications getLDAPContactModifications(
043                            Contact contact, Map<String, Serializable> contactExpandoAttributes,
044                            Properties contactMappings, Properties contactExpandoMappings)
045                    throws Exception;
046    
047            public Attributes getLDAPGroupAttributes(
048                            long ldapServerId, UserGroup userGroup, User user,
049                            Properties groupMappings, Properties userMappings)
050                    throws Exception;
051    
052            public Modifications getLDAPGroupModifications(
053                            long ldapServerId, UserGroup userGroup, User user,
054                            Properties groupMappings, Properties userMappings,
055                            UserOperation userOperation)
056                    throws Exception;
057    
058            public Attributes getLDAPUserAttributes(
059                            long ldapServerId, User user, Properties userMappings)
060                    throws Exception;
061    
062            public Modifications getLDAPUserGroupModifications(
063                            long ldapServerId, List<UserGroup> userGroups, User user,
064                            Properties userMappings)
065                    throws Exception;
066    
067            public Modifications getLDAPUserModifications(
068                            User user, Map<String, Serializable> userExpandoAttributes,
069                            Properties userMappings, Properties userExpandoMappings)
070                    throws Exception;
071    
072            public String getUserDNName(
073                            long ldapServerId, User user, Properties userMappings)
074                    throws Exception;
075    
076    }