1 package org.apache.commons.jcs3.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.jcs3.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 }
60
61
62
63
64
65
66 public int getMaxKeySize()
67 {
68 return this.maxKeySize;
69 }
70
71
72
73
74
75
76 public void setMaxKeySize( final int maxKeySize )
77 {
78 this.maxKeySize = maxKeySize;
79 }
80
81
82
83
84
85
86 public int getOptimizeAtRemoveCount()
87 {
88 return this.optimizeAtRemoveCount;
89 }
90
91
92
93
94
95
96
97 public void setOptimizeAtRemoveCount( final int cnt )
98 {
99 this.optimizeAtRemoveCount = cnt;
100 }
101
102
103
104
105 public void setOptimizeOnShutdown( final boolean optimizeOnShutdown )
106 {
107 this.optimizeOnShutdown = optimizeOnShutdown;
108 }
109
110
111
112
113 public boolean isOptimizeOnShutdown()
114 {
115 return optimizeOnShutdown;
116 }
117
118
119
120
121 public void setClearDiskOnStartup( final boolean clearDiskOnStartup )
122 {
123 this.clearDiskOnStartup = clearDiskOnStartup;
124 }
125
126
127
128
129 public boolean isClearDiskOnStartup()
130 {
131 return clearDiskOnStartup;
132 }
133
134
135
136
137
138
139 @Override
140 public String toString()
141 {
142 final StringBuilder str = new StringBuilder();
143 str.append( "IndexedDiskCacheAttributes " );
144 str.append( "\n diskPath = " + super.getDiskPath() );
145 str.append( "\n maxPurgatorySize = " + super.getMaxPurgatorySize() );
146 str.append( "\n maxKeySize = " + maxKeySize );
147 str.append( "\n optimizeAtRemoveCount = " + optimizeAtRemoveCount );
148 str.append( "\n shutdownSpoolTimeLimit = " + super.getShutdownSpoolTimeLimit() );
149 str.append( "\n optimizeOnShutdown = " + optimizeOnShutdown );
150 str.append( "\n clearDiskOnStartup = " + clearDiskOnStartup );
151 return str.toString();
152 }
153 }