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