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            public static void exportToLDAP(
042                            long userId, long userGroupId, LDAPOperation ldapOperation)
043                    throws Exception {
044    
045                    getPortalLDAPExporter().exportToLDAP(
046                            userId, userGroupId, ldapOperation);
047            }
048    
049            public static void exportToLDAP(
050                            User user, Map<String, Serializable> userExpandoAttributes)
051                    throws Exception {
052    
053                    getPortalLDAPExporter().exportToLDAP(user, userExpandoAttributes);
054            }
055    
056            public static PortalLDAPExporter getPortalLDAPExporter() {
057                    PortalRuntimePermission.checkGetBeanProperty(
058                            PortalLDAPExporterUtil.class);
059    
060                    return _portalLDAPExporter;
061            }
062    
063            public void setPortalLDAPExporter(PortalLDAPExporter portalLDAPExporter) {
064                    PortalRuntimePermission.checkSetBeanProperty(getClass());
065    
066                    _portalLDAPExporter = portalLDAPExporter;
067            }
068    
069            private static PortalLDAPExporter _portalLDAPExporter;
070    
071    }