Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
6914 dpurdie 1
package com.erggroup.buildtool.ripple;
2
 
3
import com.erggroup.buildtool.utilities.XmlBuilder;
4
 
5
public class ReleaseConfig
6
{
7
	/**
8
	 * Identify the Release within release Manager
9
	 */
10
  private int mRtagId;
11
 
12
  /** Identify the build machine with the release
13
   *  It is globally unique
14
   * 
15
   */
16
  private int mRconId;
17
 
18
  /** Mode of the machine
19
   * 	M == Master
20
   *    S == Slave
21
   */
22
  private char mDaemonMode;
23
 
24
  /** The name of the machine as provided by the machine
25
   */
26
  private String mHostname;
27
 
28
  /** The buildfilter to be applied to the build
29
   */
30
  private String mBuildfilter;
31
 
32
  /** The machine type
33
   * 	ie solaris10_x86'
34
   */
35
  private String mMachtype;
36
 
37
  /** The machine class
38
   * 	ie: 'Solaris'
39
   */
40
  private String mMachclass;
41
 
42
  /**
43
   * Create a ReleaseConfig entry
44
   * 
45
   * @param rtagId      Release RTAG_ID
46
   * @param rconId      Release RCON_ID
47
   * @param daemonMode  Daemon Mode, M or S
48
   * @param hostname    Name of the Host Machine
49
   * @param buildfilter Machines buildfilter
50
   * @param machtype    MachType. ie linux_i386
51
   * @param machclass   Machine Class. ie: Linux
52
   */
53
  public ReleaseConfig(int rtagId, int rconId, char daemonMode, String hostname, String buildfilter, String machtype, String machclass)
54
  {
55
    mRtagId = rtagId;
56
    mRconId = rconId;
57
    mDaemonMode = daemonMode;
58
    mHostname = hostname;
59
    mBuildfilter = buildfilter;
60
    mMachtype = machtype;
61
    mMachclass = machclass;
62
  }
63
 
64
  /**accessor method
65
   */
66
  public int getRtagId()
67
  {
68
    return mRtagId;
69
  }
70
 
71
  /**accessor method
72
   */
73
  public int getRconId()
74
  {
75
    return mRconId;
76
  }
77
 
78
  /**accessor method
79
   */
80
  public char getDaemonMode()
81
  {
82
    return mDaemonMode;
83
  }
84
 
85
  /**
86
   * @return the mMachclass
87
   */
88
  public String getmMachclass() {
89
      return mMachclass;
90
  }
91
 
92
  /**
93
   * @return the mMachtype
94
   */
95
  public String getmMachtype() {
96
      return mMachtype;
97
  }
98
 
99
  public XmlBuilder getMachineEntry()
100
  {
101
	  XmlBuilder entry = new XmlBuilder("machine");
102
	  entry.addAttribute("name", mHostname);
103
	  entry.addAttribute("machtype", getmMachtype());
104
	  entry.addAttribute("machclass", getmMachclass());
105
 
106
      // Only if it is defined
107
      //    No entry will pick up machine's default filter
108
      if (mBuildfilter != null && mBuildfilter.length() > 0) {
109
    	  entry.addAttribute("buildfilter", mBuildfilter);
110
      }
111
 
112
      // Only indicate Master. Value not currently used
113
      if (mDaemonMode  == 'M') {
114
    	  entry.addAttribute("master", "M");
115
      }
116
 
117
      return entry;
118
  }
119
 
120
 
121
}