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.kernel.exception.SystemException;
018    import com.liferay.portal.model.Contact;
019    import com.liferay.portal.model.User;
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     */
032    public interface PortalToLDAPConverter {
033    
034            public Modifications getLDAPContactModifications(
035                            Contact contact, Map<String, Serializable> contactExpandoAttributes,
036                            Properties contactMappings, Properties contactExpandoMappings)
037                    throws Exception;
038    
039            public Attributes getLDAPUserAttributes(
040                            long ldapServerId, User user, Properties userMappings)
041                    throws SystemException;
042    
043            public Modifications getLDAPUserModifications(
044                            User user, Map<String, Serializable> userExpandoAttributes,
045                            Properties userMappings, Properties userExpandoMappings)
046                    throws Exception;
047    
048            public String getUserDNName(
049                            long ldapServerId, User user, Properties userMappings)
050                    throws Exception;
051    
052    }