001
014
015 package com.liferay.portlet;
016
017 import javax.portlet.CacheControl;
018 import javax.portlet.MimeResponse;
019
020
024 public class CacheControlImpl implements CacheControl {
025
026 public CacheControlImpl(
027 String eTag, int expirationTime, boolean publicScope,
028 boolean useCachedContent, MimeResponseImpl mimeResponseImpl) {
029
030 _eTag = eTag;
031 _expirationTime = expirationTime;
032 _publicScope = publicScope;
033 _useCachedContent = useCachedContent;
034 _mimeResponseImpl = mimeResponseImpl;
035 }
036
037 public String getETag() {
038 return _eTag;
039 }
040
041 public boolean isPublicScope() {
042 return _publicScope;
043 }
044
045 public int getExpirationTime() {
046 return _expirationTime;
047 }
048
049 public void setETag(String eTag) {
050 _eTag = eTag;
051
052 _mimeResponseImpl.setProperty(MimeResponse.ETAG, eTag);
053 }
054
055 public void setExpirationTime(int expirationTime) {
056 _expirationTime = expirationTime;
057
058 _mimeResponseImpl.setProperty(
059 MimeResponse.EXPIRATION_CACHE, String.valueOf(expirationTime));
060 }
061
062 public void setPublicScope(boolean publicScope) {
063 _publicScope = publicScope;
064
065 _mimeResponseImpl.setProperty(
066 MimeResponse.PUBLIC_SCOPE, String.valueOf(publicScope));
067 }
068
069 public void setUseCachedContent(boolean useCachedContent) {
070 _useCachedContent = useCachedContent;
071
072 _mimeResponseImpl.setProperty(
073 MimeResponse.USE_CACHED_CONTENT, String.valueOf(useCachedContent));
074 }
075
076 public boolean useCachedContent() {
077 return _useCachedContent;
078 }
079
080 private String _eTag;
081 private int _expirationTime;
082 private MimeResponseImpl _mimeResponseImpl;
083 private boolean _publicScope;
084 private boolean _useCachedContent;
085
086 }