001/* 002 * Copyright 2002-2012 the original author or authors. 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 * https://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 017package org.springframework.mock.web.portlet; 018 019import javax.portlet.CacheControl; 020 021/** 022 * Mock implementation of the {@link javax.portlet.CacheControl} interface. 023 * 024 * @author Juergen Hoeller 025 * @since 3.0 026 */ 027public class MockCacheControl implements CacheControl { 028 029 private int expirationTime = 0; 030 031 private boolean publicScope = false; 032 033 private String etag; 034 035 private boolean useCachedContent = false; 036 037 038 @Override 039 public int getExpirationTime() { 040 return this.expirationTime; 041 } 042 043 @Override 044 public void setExpirationTime(int time) { 045 this.expirationTime = time; 046 } 047 048 @Override 049 public boolean isPublicScope() { 050 return this.publicScope; 051 } 052 053 @Override 054 public void setPublicScope(boolean publicScope) { 055 this.publicScope = publicScope; 056 } 057 058 @Override 059 public String getETag() { 060 return this.etag; 061 } 062 063 @Override 064 public void setETag(String token) { 065 this.etag = token; 066 } 067 068 @Override 069 public boolean useCachedContent() { 070 return this.useCachedContent; 071 } 072 073 @Override 074 public void setUseCachedContent(boolean useCachedContent) { 075 this.useCachedContent = useCachedContent; 076 } 077 078}