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.events;
016    
017    import com.liferay.portal.kernel.dao.db.DB;
018    import com.liferay.portal.kernel.upgrade.UpgradeException;
019    import com.liferay.portal.verify.VerifyException;
020    
021    import java.sql.Connection;
022    
023    /**
024     * @author Brian Wing Shun Chan
025     * @author Alexander Chow
026     * @author Raymond Aug??
027     */
028    public class StartupHelperUtil {
029    
030            public static StartupHelper getStartupHelper() {
031                    return _startupHelper;
032            }
033    
034            public static boolean isDBNew() {
035                    return getStartupHelper().isDBNew();
036            }
037    
038            public static boolean isStartupFinished() {
039                    return getStartupHelper().isStartupFinished();
040            }
041    
042            public static boolean isUpgraded() {
043                    return getStartupHelper().isUpgraded();
044            }
045    
046            public static boolean isUpgrading() {
047                    return getStartupHelper().isUpgrading();
048            }
049    
050            public static boolean isVerified() {
051                    return getStartupHelper().isVerified();
052            }
053    
054            public static void setDbNew(boolean dbNew) {
055                    getStartupHelper().setDbNew(dbNew);
056            }
057    
058            public static void setDropIndexes(boolean dropIndexes) {
059                    getStartupHelper().setDropIndexes(dropIndexes);
060            }
061    
062            public static void setStartupFinished(boolean startupFinished) {
063                    getStartupHelper().setStartupFinished(startupFinished);
064            }
065    
066            public static void updateIndexes() {
067                    getStartupHelper().updateIndexes();
068            }
069    
070            public static void updateIndexes(boolean dropIndexes) {
071                    getStartupHelper().updateIndexes(dropIndexes);
072            }
073    
074            public static void updateIndexes(
075                    DB db, Connection connection, boolean dropIndexes) {
076    
077                    getStartupHelper().updateIndexes(db, connection, dropIndexes);
078            }
079    
080            public static void upgradeProcess(int buildNumber) throws UpgradeException {
081                    getStartupHelper().upgradeProcess(buildNumber);
082            }
083    
084            public static void verifyProcess(boolean newBuildNumber, boolean verified)
085                    throws VerifyException {
086    
087                    getStartupHelper().verifyProcess(newBuildNumber, verified);
088            }
089    
090            public void setStartupHelper(StartupHelper startupHelper) {
091                    _startupHelper = startupHelper;
092            }
093    
094            private static StartupHelper _startupHelper;
095    
096    }