001    /**
002     * Copyright (c) 2000-present 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.exportimport;
016    
017    import com.liferay.portal.kernel.util.ProxyFactory;
018    import com.liferay.portal.model.User;
019    
020    /**
021     * @author Edward Han
022     * @author Michael C. Han
023     * @author Brian Wing Shun Chan
024     * @author Raymond Aug??
025     */
026    public class UserImporterUtil {
027    
028            public static long getLastImportTime() throws Exception {
029                    return _getInstance().getLastImportTime();
030            }
031    
032            public static User importUser(
033                            long ldapServerId, long companyId, String emailAddress,
034                            String screenName)
035                    throws Exception {
036    
037                    return _getInstance().importUser(
038                            ldapServerId, companyId, emailAddress, screenName);
039            }
040    
041            public static User importUser(
042                            long companyId, String emailAddress, String screenName)
043                    throws Exception {
044    
045                    return _getInstance().importUser(companyId, emailAddress, screenName);
046            }
047    
048            public static User importUserByScreenName(long companyId, String screenName)
049                    throws Exception {
050    
051                    return _getInstance().importUserByScreenName(companyId, screenName);
052            }
053    
054            public static void importUsers() throws Exception {
055                    _getInstance().importUsers();
056            }
057    
058            public static void importUsers(long companyId) throws Exception {
059                    _getInstance().importUsers(companyId);
060            }
061    
062            public static void importUsers(long ldapServerId, long companyId)
063                    throws Exception {
064    
065                    _getInstance().importUsers(ldapServerId, companyId);
066            }
067    
068            private static UserImporter _getInstance() {
069                    return _instance;
070            }
071    
072            private static final UserImporter _instance =
073                    ProxyFactory.newServiceTrackedInstance(UserImporter.class);
074    
075    }