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.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    }