1 package org.apache.commons.jcs.auxiliary.disk.indexed;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.commons.jcs.auxiliary.disk.AbstractDiskCacheAttributes;
23
24
25
26
27 public class IndexedDiskCacheAttributes
28 extends AbstractDiskCacheAttributes
29 {
30
31 private static final long serialVersionUID = -2190863599358782950L;
32
33
34 private static final int DEFAULT_maxKeySize = 5000;
35
36
37 private int maxKeySize = DEFAULT_maxKeySize;
38
39
40 private int optimizeAtRemoveCount = -1;
41
42
43 public static final boolean DEFAULT_OPTIMIZE_ON_SHUTDOWN = true;
44
45
46 private boolean optimizeOnShutdown = DEFAULT_OPTIMIZE_ON_SHUTDOWN;
47
48
49 public static final boolean DEFAULT_CLEAR_DISK_ON_STARTUP = false;
50
51
52 private boolean clearDiskOnStartup = DEFAULT_CLEAR_DISK_ON_STARTUP;
53
54
55
56
57 public IndexedDiskCacheAttributes()
58 {
59 super();
60 }
61
62
63
64
65
66
67 public int getMaxKeySize()
68 {
69 return this.maxKeySize;
70 }
71
72
73
74
75
76
77 public void setMaxKeySize( int maxKeySize )
78 {
79 this.maxKeySize = maxKeySize;
80 }
81
82
83
84
85
86
87 public int getOptimizeAtRemoveCount()
88 {
89 return this.optimizeAtRemoveCount;
90 }
91
92
93
94
95
96
97
98 public void setOptimizeAtRemoveCount( int cnt )
99 {
100 this.optimizeAtRemoveCount = cnt;
101 }
102
103
104
105
106 public void setOptimizeOnShutdown( boolean optimizeOnShutdown )
107 {
108 this.optimizeOnShutdown = optimizeOnShutdown;
109 }
110
111
112
113
114 public boolean isOptimizeOnShutdown()
115 {
116 return optimizeOnShutdown;
117 }
118
119
120
121
122 public void setClearDiskOnStartup( boolean clearDiskOnStartup )
123 {
124 this.clearDiskOnStartup = clearDiskOnStartup;
125 }
126
127
128
129
130 public boolean isClearDiskOnStartup()
131 {
132 return clearDiskOnStartup;
133 }
134
135
136
137
138
139
140 @Override
141 public String toString()
142 {
143 StringBuilder str = new StringBuilder();
144 str.append( "IndexedDiskCacheAttributes " );
145 str.append( "\n diskPath = " + super.getDiskPath() );
146 str.append( "\n maxPurgatorySize = " + super.getMaxPurgatorySize() );
147 str.append( "\n maxKeySize = " + maxKeySize );
148 str.append( "\n optimizeAtRemoveCount = " + optimizeAtRemoveCount );
149 str.append( "\n shutdownSpoolTimeLimit = " + super.getShutdownSpoolTimeLimit() );
150 str.append( "\n optimizeOnShutdown = " + optimizeOnShutdown );
151 str.append( "\n clearDiskOnStartup = " + clearDiskOnStartup );
152 return str.toString();
153 }
154 }