1 package org.apache.jcs.admin;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 /***
23 * Stores info on a cache element for the template
24 */
25 public class CacheElementInfo
26 {
27 /*** element key */
28 String key = null;
29
30 /*** is it eternal */
31 boolean eternal = false;
32
33 /*** when it was created */
34 String createTime = null;
35
36 /*** max life */
37 long maxLifeSeconds = -1;
38
39 /*** when it will expire */
40 long expiresInSeconds = -1;
41
42 /***
43 * @return a string representation of the key
44 */
45 public String getKey()
46 {
47 return this.key;
48 }
49
50 /***
51 * @return true if the item does not expire
52 */
53 public boolean isEternal()
54 {
55 return this.eternal;
56 }
57
58 /***
59 * @return the time the object was created
60 */
61 public String getCreateTime()
62 {
63 return this.createTime;
64 }
65
66 /***
67 * Ignored if isEternal
68 * @return the longest this object can live.
69 */
70 public long getMaxLifeSeconds()
71 {
72 return this.maxLifeSeconds;
73 }
74
75 /***
76 * Ignored if isEternal
77 * @return how many seconds until this object expires.
78 */
79 public long getExpiresInSeconds()
80 {
81 return this.expiresInSeconds;
82 }
83
84 /***
85 * @return string info on the item
86 */
87 public String toString()
88 {
89 StringBuffer buf = new StringBuffer();
90 buf.append( "\nCacheElementInfo " );
91 buf.append( "\n Key [" + getKey() + "]" );
92 buf.append( "\n Eternal [" + isEternal() + "]" );
93 buf.append( "\n CreateTime [" + getCreateTime() + "]" );
94 buf.append( "\n MaxLifeSeconds [" + getMaxLifeSeconds() + "]" );
95 buf.append( "\n ExpiresInSeconds [" + getExpiresInSeconds() + "]" );
96
97 return buf.toString();
98 }
99 }