1 package org.apache.maven.continuum.release;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.maven.shared.release.ReleaseManagerListener;
23
24 import java.util.ArrayList;
25 import java.util.Collections;
26 import java.util.List;
27
28
29
30
31
32 public class DefaultReleaseManagerListener
33 implements ReleaseManagerListener, ContinuumReleaseManagerListener
34 {
35 private String goalName;
36
37 private List<String> completedPhases;
38
39 private String inProgress;
40
41 private List<String> phases;
42
43 private String error;
44
45 private int state;
46
47 private String username;
48
49 public void goalStart( String name, List phases )
50 {
51 state = LISTENING;
52 goalName = name;
53 this.phases = phases;
54 completedPhases = Collections.synchronizedList( new ArrayList<String>() );
55 inProgress = null;
56 }
57
58 public void phaseStart( String name )
59 {
60 inProgress = name;
61 }
62
63 public void phaseEnd()
64 {
65 completedPhases.add( inProgress );
66
67 inProgress = null;
68 }
69
70 public void phaseSkip( String name )
71 {
72 completedPhases.add( name );
73 }
74
75 public void goalEnd()
76 {
77 state = FINISHED;
78 }
79
80 public void error( String message )
81 {
82 error = message;
83 goalEnd();
84 }
85
86 public List<String> getCompletedPhases()
87 {
88 return completedPhases;
89 }
90
91 public String getInProgress()
92 {
93 return inProgress;
94 }
95
96 public List<String> getPhases()
97 {
98 return phases;
99 }
100
101 public String getGoalName()
102 {
103 return goalName;
104 }
105
106 public String getError()
107 {
108 return error;
109 }
110
111 public int getState()
112 {
113 return state;
114 }
115
116 public void setUsername( String username )
117 {
118 this.username = username;
119 }
120
121 public String getUsername()
122 {
123 return username;
124 }
125 }