| 814 |
mhunt |
1 |
package com.erggroup.buildtool.daemon;
|
|
|
2 |
|
|
|
3 |
import com.erggroup.buildtool.ripple.ReleaseManager;
|
|
|
4 |
|
|
|
5 |
import org.apache.log4j.Logger;
|
|
|
6 |
|
|
|
7 |
/**Enumeration of supported run levels
|
|
|
8 |
*/
|
|
|
9 |
public class RunLevel
|
|
|
10 |
{
|
|
|
11 |
/**enumeration
|
|
|
12 |
* @attribute
|
|
|
13 |
*/
|
|
|
14 |
public static final RunLevel CANNOT_CONTINUE = new RunLevel( ReleaseManager.DB_CANNOT_CONTINUE );
|
|
|
15 |
|
|
|
16 |
/**enumeration
|
|
|
17 |
* @attribute
|
|
|
18 |
*/
|
|
|
19 |
public static final RunLevel PAUSED = new RunLevel( ReleaseManager.DB_PAUSED );
|
|
|
20 |
|
|
|
21 |
/**enumeration
|
|
|
22 |
* @attribute
|
|
|
23 |
*/
|
|
|
24 |
public static final RunLevel ACTIVE = new RunLevel( ReleaseManager.DB_ACTIVE );
|
|
|
25 |
|
|
|
26 |
/**enumeration
|
|
|
27 |
* @attribute
|
|
|
28 |
*/
|
|
|
29 |
public static final RunLevel IDLE = new RunLevel( ReleaseManager.DB_IDLE );
|
|
|
30 |
|
|
|
31 |
/**enumeration
|
|
|
32 |
* @attribute
|
|
|
33 |
*/
|
|
|
34 |
public static final RunLevel WAITING = new RunLevel( ReleaseManager.DB_WAITING );
|
|
|
35 |
|
| 886 |
mhunt |
36 |
/**enumeration
|
|
|
37 |
* @attribute
|
|
|
38 |
*/
|
|
|
39 |
public static final RunLevel PUBLISHING = new RunLevel( ReleaseManager.DB_PUBLISHING );
|
|
|
40 |
|
| 814 |
mhunt |
41 |
/**Logger
|
|
|
42 |
* @attribute
|
|
|
43 |
*/
|
|
|
44 |
private static final Logger mLogger = Logger.getLogger(RunLevel.class);
|
|
|
45 |
|
|
|
46 |
/**integer value
|
|
|
47 |
* @attribute
|
|
|
48 |
*/
|
|
|
49 |
private final int mLevel;
|
|
|
50 |
|
|
|
51 |
/**constructor
|
|
|
52 |
*/
|
|
|
53 |
private RunLevel(int level)
|
|
|
54 |
{
|
|
|
55 |
mLevel = level;
|
|
|
56 |
}
|
|
|
57 |
|
|
|
58 |
/**updates (advertises) the run level in the database
|
|
|
59 |
* refer to sequence diagrams
|
|
|
60 |
*/
|
|
|
61 |
public void persist(ReleaseManager releaseManager, int rcon_id) throws Exception
|
|
|
62 |
{
|
|
|
63 |
mLogger.debug("persist " + rcon_id + " " + mLevel);
|
| 882 |
mhunt |
64 |
releaseManager.updateCurrentRunLevel(rcon_id, mLevel, false);
|
| 814 |
mhunt |
65 |
}
|
| 882 |
mhunt |
66 |
|
|
|
67 |
/**inserts (advertises) the run level in the database
|
|
|
68 |
* refer to sequence diagrams
|
|
|
69 |
*/
|
|
|
70 |
public void persistNew(ReleaseManager releaseManager, int rcon_id) throws Exception
|
|
|
71 |
{
|
|
|
72 |
mLogger.debug("persistNew " + rcon_id + " " + mLevel);
|
|
|
73 |
releaseManager.updateCurrentRunLevel(rcon_id, mLevel, true);
|
|
|
74 |
}
|
| 814 |
mhunt |
75 |
}
|