001    /**
002     * Copyright (c) 2000-2012 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                    throws Exception;
055    
056            public Attributes getLDAPUserAttributes(
057                            long ldapServerId, User user, Properties userMappings)
058                    throws Exception;
059    
060            public Modifications getLDAPUserGroupModifications(
061                            long ldapServerId, List<UserGroup> userGroups, User user,
062                            Properties userMappings)
063                    throws Exception;
064    
065            public Modifications getLDAPUserModifications(
066                            User user, Map<String, Serializable> userExpandoAttributes,
067                            Properties userMappings, Properties userExpandoMappings)
068                    throws Exception;
069    
070            public String getUserDNName(
071                            long ldapServerId, User user, Properties userMappings)
072                    throws Exception;
073    
074    }