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            public Modifications getLDAPGroupModifications(
052                            long ldapServerId, UserGroup userGroup, User user,
053                            Properties groupMappings, Properties userMappings,
054                            LDAPOperation ldapOperation)
055                    throws Exception;
056    
057            public Attributes getLDAPUserAttributes(
058                            long ldapServerId, User user, Properties userMappings)
059                    throws Exception;
060    
061            public Modifications getLDAPUserGroupModifications(
062                            long ldapServerId, List<UserGroup> userGroups, User user,
063                            Properties userMappings)
064                    throws Exception;
065    
066            public Modifications getLDAPUserModifications(
067                            User user, Map<String, Serializable> userExpandoAttributes,
068                            Properties userMappings, Properties userExpandoMappings)
069                    throws Exception;
070    
071            public String getUserDNName(
072                            long ldapServerId, User user, Properties userMappings)
073                    throws Exception;
074    
075    }