1 | // $Id: PoolManagerPoolUpMessage.java,v 1.8 2007-07-23 10:49:09 behrmann Exp $ |
2 | |
3 | package diskCacheV111.vehicles; |
4 | |
5 | import java.util.*; |
6 | import java.io.Serializable; |
7 | import diskCacheV111.pools.PoolCostInfo ; |
8 | import diskCacheV111.pools.PoolV2Mode; |
9 | |
10 | public class PoolManagerPoolUpMessage extends PoolManagerMessage { |
11 | |
12 | private final String _poolName ; |
13 | private final long _serialId ; |
14 | private final PoolCostInfo _poolCostInfo ; |
15 | private final PoolV2Mode _mode; |
16 | |
17 | private Map<String, String> _tagMap = null ; |
18 | private Set<String> _hsmInstances = null; |
19 | private String _message = ""; |
20 | private int _code = 0; |
21 | |
22 | |
23 | private static final long serialVersionUID = -8421133630068493665L; |
24 | |
25 | public PoolManagerPoolUpMessage(String poolName, long serialId, |
26 | PoolV2Mode mode) |
27 | { |
28 | this(poolName, serialId, mode, null); |
29 | } |
30 | |
31 | public PoolManagerPoolUpMessage(String poolName, long serialId, |
32 | PoolV2Mode mode, PoolCostInfo costInfo) |
33 | { |
34 | assert mode != null; |
35 | |
36 | _poolName = poolName; |
37 | _serialId = serialId; |
38 | _mode = mode; |
39 | _poolCostInfo = costInfo; |
40 | setReplyRequired(false); |
41 | } |
42 | |
43 | public PoolCostInfo getPoolCostInfo(){ return _poolCostInfo ; } |
44 | public String getPoolName(){ |
45 | return _poolName; |
46 | } |
47 | public long getSerialId(){ return _serialId ; } |
48 | public void setTagMap( Map<String, String> map ){ _tagMap = map ; } |
49 | public Map<String, String> getTagMap(){ return _tagMap ; } |
50 | |
51 | /** |
52 | * Sets the human readable status message of the pool. |
53 | */ |
54 | public void setMessage(String msg) |
55 | { |
56 | assert msg != null; |
57 | |
58 | _message = msg; |
59 | } |
60 | |
61 | /** |
62 | * Returns the human readable status message of the pool. May be |
63 | * null. |
64 | */ |
65 | public String getMessage() |
66 | { |
67 | return _message; |
68 | } |
69 | |
70 | /** |
71 | * Sets the machine interpretable status code of the pool. |
72 | */ |
73 | public void setCode(int code) |
74 | { |
75 | _code = code; |
76 | } |
77 | |
78 | /** |
79 | * Returns the machine interpretable status code of the |
80 | * pool. Returns 0 if the status code has not been set. |
81 | */ |
82 | public int getCode() |
83 | { |
84 | return _code; |
85 | } |
86 | |
87 | /** |
88 | * Returns the mode of the pool. The mode indicates which |
89 | * operations are currently supported by the pool. |
90 | */ |
91 | public PoolV2Mode getPoolMode() |
92 | { |
93 | return _mode; |
94 | } |
95 | |
96 | /** Returns the names of attached HSM instances. */ |
97 | public Set<String> getHsmInstances() |
98 | { |
99 | return _hsmInstances; |
100 | } |
101 | |
102 | /** |
103 | * Sets the set of names of attached HSM instances. |
104 | * |
105 | * @param value Set of HSM instance names. Must implement Serializable. |
106 | */ |
107 | public void setHsmInstances(Set<String> value) |
108 | { |
109 | assert value instanceof Serializable; |
110 | _hsmInstances = value; |
111 | } |
112 | } |