001/*
002 * (C) Copyright 2006-2009 Nuxeo SAS (http://nuxeo.com/) and contributors.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser General Public License
006 * (LGPL) version 2.1 which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/lgpl.html
008 *
009 * This library is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012 * Lesser General Public License for more details.
013 *
014 * Contributors:
015 *     Nuxeo - initial API and implementation
016 *
017 * $Id$
018 */
019
020package org.nuxeo.ecm.platform.web.common.requestcontroller.service;
021
022/**
023 * Basic implementation of the {@link RequestFilterConfig} interface.
024 *
025 * @author tiry
026 */
027public class RequestFilterConfigImpl implements RequestFilterConfig {
028
029    private static final long serialVersionUID = 1L;
030
031    protected final boolean useTx;
032
033    protected final boolean useSync;
034
035    protected final boolean isPrivate;
036
037    protected final boolean useTxBuffered;
038
039    protected final boolean cached;
040
041    protected final String cacheTime;
042
043    public RequestFilterConfigImpl(boolean useSync, boolean useTx, boolean useTxBuffered, boolean cached,
044            boolean isPrivate, String cacheTime) {
045        this.useSync = useSync;
046        this.useTx = useTx;
047        this.useTxBuffered = useTxBuffered;
048        this.cached = cached;
049        this.isPrivate = isPrivate;
050        this.cacheTime = cacheTime;
051    }
052
053    public boolean needSynchronization() {
054        return useSync;
055    }
056
057    public boolean needTransaction() {
058        return useTx;
059    }
060
061    public boolean needTransactionBuffered() {
062        return useTxBuffered;
063    }
064
065    public boolean isCached() {
066        return cached;
067    }
068
069    public boolean isPrivate() {
070        return isPrivate;
071    }
072
073    public String getCacheTime() {
074        return cacheTime;
075    }
076
077}