001    /**
002     * Copyright (c) 2000-2012 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.kernel.xuggler;
016    
017    import com.liferay.portal.kernel.progress.InstallStatus;
018    
019    /**
020     * @author Alexander Chow
021     */
022    public class XugglerInstallStatus implements InstallStatus {
023    
024            public static final int COMPLETED = 2;
025    
026            public static final int COPYING = 1;
027    
028            public static final int DOWNLOADING = 0;
029    
030            public int getStatus() {
031                    return _status;
032            }
033    
034            public String getStatusLabel() {
035                    int status = getStatus();
036    
037                    if (status == 0) {
038                            return "downloading-xuggler";
039                    }
040                    else if (status == 1) {
041                            return "copying-xuggler";
042                    }
043                    else if (status == 2) {
044                            return "completed";
045                    }
046    
047                    return "unknown";
048            }
049    
050            public void setStatus(int status) {
051                    _status = status;
052            }
053    
054            private int _status = UNKNOWN;
055    
056    }