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