001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.security.ldap;
016    
017    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
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    
025    /**
026     * @author Edward Han
027     * @author Michael C. Han
028     * @author Brian Wing Shun Chan
029     * @author Marcellus Tavares
030     * @author Raymond Aug??
031     */
032    public class PortalLDAPExporterUtil {
033    
034            public static void exportToLDAP(
035                            Contact contact, Map<String, Serializable> contactExpandoAttributes)
036                    throws Exception {
037    
038                    getPortalLDAPExporter().exportToLDAP(contact, contactExpandoAttributes);
039            }
040    
041            /**
042             * @deprecated
043             */
044            public static void exportToLDAP(long userId, long userGroupId)
045                    throws Exception {
046    
047                    _portalLDAPExporter.exportToLDAP(userId, userGroupId);
048            }
049    
050            public static void exportToLDAP(
051                            long userId, long userGroupId, LDAPOperation ldapOperation)
052                    throws Exception {
053    
054                    getPortalLDAPExporter().exportToLDAP(
055                            userId, userGroupId, ldapOperation);
056            }
057    
058            public static void exportToLDAP(
059                            User user, Map<String, Serializable> userExpandoAttributes)
060                    throws Exception {
061    
062                    getPortalLDAPExporter().exportToLDAP(user, userExpandoAttributes);
063            }
064    
065            public static PortalLDAPExporter getPortalLDAPExporter() {
066                    PortalRuntimePermission.checkGetBeanProperty(
067                            PortalLDAPExporterUtil.class);
068    
069                    return _portalLDAPExporter;
070            }
071    
072            public void setPortalLDAPExporter(PortalLDAPExporter portalLDAPExporter) {
073                    PortalRuntimePermission.checkSetBeanProperty(getClass());
074    
075                    _portalLDAPExporter = portalLDAPExporter;
076            }
077    
078            private static PortalLDAPExporter _portalLDAPExporter;
079    
080    }