1 package org.apache.commons.jcs.auxiliary.disk.block;
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
28
29 public class BlockDiskCacheAttributes
30 extends AbstractDiskCacheAttributes
31 {
32
33 private static final long serialVersionUID = 6568840097657265989L;
34
35
36 private int blockSizeBytes;
37
38
39 private static final int DEFAULT_MAX_KEY_SIZE = 5000;
40
41
42 private int maxKeySize = DEFAULT_MAX_KEY_SIZE;
43
44
45 private static final long DEFAULT_KEY_PERSISTENCE_INTERVAL_SECONDS = 5 * 60;
46
47
48 private long keyPersistenceIntervalSeconds = DEFAULT_KEY_PERSISTENCE_INTERVAL_SECONDS;
49
50
51
52
53
54
55 public void setBlockSizeBytes( int blockSizeBytes )
56 {
57 this.blockSizeBytes = blockSizeBytes;
58 }
59
60
61
62
63 public int getBlockSizeBytes()
64 {
65 return blockSizeBytes;
66 }
67
68
69
70
71 public void setMaxKeySize( int maxKeySize )
72 {
73 this.maxKeySize = maxKeySize;
74 }
75
76
77
78
79 public int getMaxKeySize()
80 {
81 return maxKeySize;
82 }
83
84
85
86
87 public void setKeyPersistenceIntervalSeconds( long keyPersistenceIntervalSeconds )
88 {
89 this.keyPersistenceIntervalSeconds = keyPersistenceIntervalSeconds;
90 }
91
92
93
94
95 public long getKeyPersistenceIntervalSeconds()
96 {
97 return keyPersistenceIntervalSeconds;
98 }
99
100
101
102
103
104
105 @Override
106 public String toString()
107 {
108 StringBuilder str = new StringBuilder();
109 str.append( "\nBlockDiskAttributes " );
110 str.append( "\n DiskPath [" + this.getDiskPath() + "]" );
111 str.append( "\n MaxKeySize [" + this.getMaxKeySize() + "]" );
112 str.append( "\n MaxPurgatorySize [" + this.getMaxPurgatorySize() + "]" );
113 str.append( "\n BlockSizeBytes [" + this.getBlockSizeBytes() + "]" );
114 str.append( "\n KeyPersistenceIntervalSeconds [" + this.getKeyPersistenceIntervalSeconds() + "]" );
115 str.append( "\n DiskLimitType [" + this.getDiskLimitType() + "]" );
116 return str.toString();
117 }
118 }