1 | // $Id: PoolManagerPoolModeMessage.java,v 1.2 2006-01-28 17:19:28 patrick Exp $ |
2 | |
3 | package diskCacheV111.vehicles; |
4 | |
5 | /** |
6 | * Basic class to handle pool modes in the poolManager framework |
7 | * |
8 | * @Author: patrick |
9 | * @Version: 1.2 |
10 | */ |
11 | public class PoolManagerPoolModeMessage extends PoolManagerMessage { |
12 | |
13 | private static final long serialVersionUID = 2092233339703855551L; |
14 | |
15 | public static final int READ = 0x10 ; |
16 | public static final int WRITE = 0x20 ; |
17 | public static final int UNDEFINED = 0 ; |
18 | private String _poolName = null ; |
19 | private int _poolMode = 0; |
20 | public PoolManagerPoolModeMessage(String poolName ){ |
21 | _poolName = poolName ; |
22 | setReplyRequired(true); |
23 | } |
24 | public PoolManagerPoolModeMessage(String poolName , int poolMode ){ |
25 | _poolName = poolName ; |
26 | _poolMode = poolMode ; |
27 | setReplyRequired(true); |
28 | } |
29 | public String getPoolName(){ return _poolName ; } |
30 | |
31 | public int getPoolMode(){ return _poolMode ; } |
32 | public void setPoolMode( int poolMode ){ _poolMode = poolMode ; } |
33 | public String toString(){ |
34 | StringBuffer sb = new StringBuffer() ; |
35 | sb.append("Pool=").append(_poolName).append(";Mode=") ; |
36 | if( _poolMode == 0 )sb.append("Undefined") ; |
37 | else{ |
38 | if( ( _poolMode & READ ) != 0 )sb.append("R") ; |
39 | if( ( _poolMode & WRITE ) != 0 )sb.append("W"); |
40 | } |
41 | return sb.toString(); |
42 | } |
43 | } |