001: /*
002: * $Header: /cvsroot/mvnforum/myvietnam/src/net/myvietnam/mvncore/service/impl/EnvironmentServiceImplDefault.java,v 1.10 2007/10/11 04:45:26 minhnn Exp $
003: * $Author: minhnn $
004: * $Revision: 1.10 $
005: * $Date: 2007/10/11 04:45:26 $
006: *
007: * ====================================================================
008: *
009: * Copyright (C) 2002-2007 by MyVietnam.net
010: *
011: * All copyright notices regarding MyVietnam and MyVietnam CoreLib
012: * MUST remain intact in the scripts and source code.
013: *
014: * This library is free software; you can redistribute it and/or
015: * modify it under the terms of the GNU Lesser General Public
016: * License as published by the Free Software Foundation; either
017: * version 2.1 of the License, or (at your option) any later version.
018: *
019: * This library is distributed in the hope that it will be useful,
020: * but WITHOUT ANY WARRANTY; without even the implied warranty of
021: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
022: * Lesser General Public License for more details.
023: *
024: * You should have received a copy of the GNU Lesser General Public
025: * License along with this library; if not, write to the Free Software
026: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
027: *
028: * Correspondence and Marketing Questions can be sent to:
029: * info at MyVietnam net
030: *
031: * @author: Dung Bui
032: */
033: package net.myvietnam.mvncore.service.impl;
034:
035: import net.myvietnam.mvncore.service.EnvironmentService;
036:
037: public class EnvironmentServiceImplDefault implements
038: EnvironmentService {
039:
040: private boolean isEnterprise;
041: private boolean isPortlet;
042: private String customizeFor;
043: private boolean shouldRun = true;
044: private boolean enableMVNForum;
045: private boolean enableMVNAd;
046: private boolean enableMVNCMS;
047: private String reason = "Normal System";
048:
049: public EnvironmentServiceImplDefault(boolean isEnterprise,
050: boolean isPortlet, String customizeFor,
051: boolean enableMVNForum, boolean enableMVNCMS,
052: boolean enableMVNAd) {
053: this .isEnterprise = isEnterprise;
054: this .isPortlet = isPortlet;
055: this .customizeFor = customizeFor;
056: this .enableMVNForum = enableMVNForum;
057: this .enableMVNCMS = enableMVNCMS;
058: this .enableMVNAd = enableMVNAd;
059: }
060:
061: public boolean isPortlet() {
062: return isPortlet;
063: }
064:
065: public String customizeFor() {
066: return customizeFor;
067: }
068:
069: public boolean isEnterprise() {
070: return isEnterprise;
071: }
072:
073: /**
074: * This method could be use to stop run the forum in some condition.
075: * Some use could be a page that immediately stop the forum for security.
076: * Other usage is to check to run on some environment such as Servlet 2.3 or later
077: *
078: * @param shouldRun boolean the new shouldRun
079: * @param reason String the reason of the action, this reason will
080: * be shown in the error page
081: */
082: public void setShouldRun(boolean shouldRun, String reason) {
083: this .shouldRun = shouldRun;
084: this .reason = reason;
085: }
086:
087: public void setEnableMVNForum(boolean enable) {
088: this .enableMVNForum = enable;
089: }
090:
091: public void setEnableMVNCMS(boolean enable) {
092: this .enableMVNCMS = enable;
093: }
094:
095: public boolean isShouldRun() {
096: return shouldRun;
097: }
098:
099: public boolean isMVNForum() {
100: return enableMVNForum;
101: }
102:
103: public boolean isMVNCMS() {
104: return enableMVNCMS;
105: }
106:
107: public boolean isMVNAd() {
108: return enableMVNAd;
109: }
110:
111: public String getReason() {
112: return reason;
113: }
114:
115: public void overloadEnvironment() {
116: }
117:
118: }
|