001/*
002 * (C) Copyright 2006-2009 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     Nuxeo - initial API and implementation
018 *
019 * $Id$
020 */
021
022package org.nuxeo.ecm.platform.web.common.requestcontroller.service;
023
024/**
025 * Basic implementation of the {@link RequestFilterConfig} interface.
026 *
027 * @author tiry
028 */
029public class RequestFilterConfigImpl implements RequestFilterConfig {
030
031    private static final long serialVersionUID = 1L;
032
033    protected final boolean useTx;
034
035    protected final boolean useSync;
036
037    protected final boolean isPrivate;
038
039    protected final boolean useTxBuffered;
040
041    protected final boolean cached;
042
043    protected final String cacheTime;
044
045    public RequestFilterConfigImpl(boolean useSync, boolean useTx, boolean useTxBuffered, boolean cached,
046            boolean isPrivate, String cacheTime) {
047        this.useSync = useSync;
048        this.useTx = useTx;
049        this.useTxBuffered = useTxBuffered;
050        this.cached = cached;
051        this.isPrivate = isPrivate;
052        this.cacheTime = cacheTime;
053    }
054
055    @Override
056    public boolean needSynchronization() {
057        return useSync;
058    }
059
060    @Override
061    public boolean needTransaction() {
062        return useTx;
063    }
064
065    @Override
066    public boolean needTransactionBuffered() {
067        return useTxBuffered;
068    }
069
070    @Override
071    public boolean isCached() {
072        return cached;
073    }
074
075    @Override
076    public boolean isPrivate() {
077        return isPrivate;
078    }
079
080    @Override
081    public String getCacheTime() {
082        return cacheTime;
083    }
084
085}