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 public boolean needSynchronization() { 056 return useSync; 057 } 058 059 public boolean needTransaction() { 060 return useTx; 061 } 062 063 public boolean needTransactionBuffered() { 064 return useTxBuffered; 065 } 066 067 public boolean isCached() { 068 return cached; 069 } 070 071 public boolean isPrivate() { 072 return isPrivate; 073 } 074 075 public String getCacheTime() { 076 return cacheTime; 077 } 078 079}