001: /**
002: Licensed to the Apache Software Foundation (ASF) under one or more
003: contributor license agreements. See the NOTICE file distributed with
004: this work for additional information regarding copyright ownership.
005: The ASF licenses this file to You under the Apache License, Version 2.0
006: (the "License"); you may not use this file except in compliance with
007: the License. You may obtain a copy of the License at
008:
009: http://www.apache.org/licenses/LICENSE-2.0
010:
011: Unless required by applicable law or agreed to in writing, software
012: distributed under the License is distributed on an "AS IS" BASIS,
013: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: See the License for the specific language governing permissions and
015: limitations under the License.
016:
017: $Header:$
018: */package org.apache.beehive.netui.util.config.bean;
019:
020: /**
021: *
022: */
023: public class PageFlowConfig {
024:
025: private static final boolean DEFAULT_ENABLE_SELF_NESTING = false;
026: private static final int DEFAULT_MAX_FORWARDS_PER_REQUEST = 25;
027: private static final int DEFAULT_MAX_NESTING_STACK_DEPTH = 10;
028: private static final boolean DEFAULT_ENSURE_SECURE_FORWARDS = false;
029: private static final boolean DEFAULT_THROW_SESSION_EXPIRED_EXCEPTION = true;
030: private static final MultipartHandler DEFAULT_MULTIPART_HANDLER = MultipartHandler.DISABLED;
031: private static final PreventCache DEFAULT_PREVENT_CACHE = PreventCache.DEFAULT;
032:
033: private boolean _enableSelfNesting;
034: private boolean _ensureSecureForwards;
035: private boolean _throwSessionExpiredException;
036: private int _maxForwardsPerRequest;
037: private int _maxNestingStackDepth;
038: private MultipartHandler _multipartHandler;
039: private PreventCache _preventCache;
040: private ModuleConfigLocatorConfig[] _moduleConfigLocators;
041:
042: public PageFlowConfig() {
043: _enableSelfNesting = DEFAULT_ENABLE_SELF_NESTING;
044: _ensureSecureForwards = DEFAULT_ENSURE_SECURE_FORWARDS;
045: _throwSessionExpiredException = DEFAULT_THROW_SESSION_EXPIRED_EXCEPTION;
046: _maxForwardsPerRequest = DEFAULT_MAX_FORWARDS_PER_REQUEST;
047: _maxNestingStackDepth = DEFAULT_MAX_NESTING_STACK_DEPTH;
048: _multipartHandler = DEFAULT_MULTIPART_HANDLER;
049: _preventCache = DEFAULT_PREVENT_CACHE;
050: }
051:
052: public PageFlowConfig(Boolean enableSelfNesting,
053: Boolean ensureSecureForwards,
054: Boolean throwSessionExpiredException,
055: Integer maxForwardsPerRequest,
056: Integer maxNestingStackDepth,
057: MultipartHandler multipartHandler,
058: PreventCache preventCache,
059: ModuleConfigLocatorConfig[] moduleConfigLocators) {
060:
061: /* initialize the defaults */
062: this ();
063:
064: if (enableSelfNesting != null)
065: _enableSelfNesting = enableSelfNesting.booleanValue();
066: if (ensureSecureForwards != null)
067: _ensureSecureForwards = ensureSecureForwards.booleanValue();
068: if (throwSessionExpiredException != null)
069: _throwSessionExpiredException = throwSessionExpiredException
070: .booleanValue();
071: if (maxForwardsPerRequest != null)
072: _maxForwardsPerRequest = maxForwardsPerRequest.intValue();
073: if (maxNestingStackDepth != null)
074: _maxNestingStackDepth = maxNestingStackDepth.intValue();
075: if (multipartHandler != null)
076: _multipartHandler = multipartHandler;
077: if (preventCache != null)
078: _preventCache = preventCache;
079:
080: _moduleConfigLocators = moduleConfigLocators;
081: }
082:
083: public boolean isEnableSelfNesting() {
084: return _enableSelfNesting;
085: }
086:
087: public boolean isEnsureSecureForwards() {
088: return _ensureSecureForwards;
089: }
090:
091: public boolean isThrowSessionExpiredException() {
092: return _throwSessionExpiredException;
093: }
094:
095: public int getMaxForwardsPerRequest() {
096: return _maxForwardsPerRequest;
097: }
098:
099: public int getMaxNestingStackDepth() {
100: return _maxNestingStackDepth;
101: }
102:
103: public MultipartHandler getMultipartHandler() {
104: return _multipartHandler;
105: }
106:
107: public PreventCache getPreventCache() {
108: return _preventCache;
109: }
110:
111: public ModuleConfigLocatorConfig[] getModuleConfigLocators() {
112: return _moduleConfigLocators;
113: }
114: }
|