1/*2 * Licensed to the Apache Software Foundation (ASF) under one or more3 * contributor license agreements. See the NOTICE file distributed with4 * this work for additional information regarding copyright ownership.5 * The ASF licenses this file to You under the Apache License, Version 2.06 * (the "License"); you may not use this file except in compliance with7 * the License. You may obtain a copy of the License at8 * 9 * http://www.apache.org/licenses/LICENSE-2.010 * 11 * Unless required by applicable law or agreed to in writing, software12 * distributed under the License is distributed on an "AS IS" BASIS,13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.14 * See the License for the specific language governing permissions and15 * limitations under the License.16 */1718packageorg.apache.jetspeed.cache.impl;
1920import net.sf.ehcache.Element;
2122import org.apache.jetspeed.cache.ContentCacheElement;
23import org.apache.jetspeed.cache.ContentCacheKey;
2425/***26 * Wrapper around actual cache element implementation27 * 28 * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>29 * @version $Id: $30 */31publicclassEhPortletContentCacheElementImpl implements ContentCacheElement
32 {
33 Element element;
34 ContentCacheKey cckey;
3536publicstaticfinal String KEY_SEPARATOR = "/";
3738publicEhPortletContentCacheElementImpl(Element element, ContentCacheKey cckey)
39 {
40this.element = element;
41this.cckey = cckey;
42 }
4344public Object getKey()
45 {
46return element.getObjectKey();
47 }
4849public Object getContent()
50 {
51return element.getObjectValue();
52 }
5354publicint getTimeToIdleSeconds()
55 {
56return element.getTimeToIdle();
57 }
5859publicint getTimeToLiveSeconds()
60 {
61return element.getTimeToLive();
62 }
6364publicboolean isEternal()
65 {
66return element.isEternal();
67 }
6869public Element getImplElement()
70 {
71return element;
72 }
7374publicvoid setEternal(boolean eternal)
75 {
76 element.setEternal(eternal);
77 }
7879publicvoid setTimeToIdleSeconds(int timeToIdle)
80 {
81 element.setTimeToIdle(timeToIdle);
82 }
8384publicvoid setTimeToLiveSeconds(int timeToLive)
85 {
86 element.setTimeToLive(timeToLive);
87 }
8889public ContentCacheKey getContentCacheKey()
90 {
91return cckey;
92 }
93 }