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