Subversion Repositories DevTools

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
814 mhunt 1
package com.erggroup.buildtool.ripple;
2
 
3
import java.io.File;
4
 
908 mhunt 5
import java.sql.SQLException;
814 mhunt 6
import java.util.Iterator;
7
import java.util.Vector;
8
 
9
import org.apache.log4j.Logger;
10
 
908 mhunt 11
import com.erggroup.buildtool.smtp.Smtpsend;
12
 
814 mhunt 13
public class Package
14
{
4285 dpurdie 15
	/**
16
	 * name of package, must not contain spaces
17
	 * 
18
	 * @attribute
19
	 */
20
	String mName = new String();
814 mhunt 21
 
4285 dpurdie 22
	/**
23
	 * package scope
24
	 * 
25
	 * @attribute
26
	 */
27
	String mExtension = new String();
814 mhunt 28
 
4285 dpurdie 29
	/**
30
	 * instance identifier
31
	 * 
32
	 * @attribute
33
	 */
34
	String mVersion = new String();
814 mhunt 35
 
4285 dpurdie 36
	/**
37
	 * Version string as specified by the user. Used with a ripple type of 'F'
38
	 */
39
	String mFixedVersion = new String();
4212 dpurdie 40
 
4285 dpurdie 41
	/**
42
	 * unique identifier for daemon builds = mName + mExtension for escrow
43
	 * builds = mName + mVersion + mExtension
44
	 * 
45
	 * @attribute
46
	 */
47
	String mAlias = new String();
814 mhunt 48
 
4285 dpurdie 49
	/**
50
	 * Version Control System Tag
51
	 * 
52
	 * @attribute
53
	 */
54
	String mVcsTag = new String();
814 mhunt 55
 
4285 dpurdie 56
	/**
57
	 * build standards
58
	 * 
59
	 * @attribute
60
	 */
61
	Vector<BuildStandard> mBuildStandardCollection = new Vector<BuildStandard>();
814 mhunt 62
 
4285 dpurdie 63
	/**
64
	 * GBE_MACHTYPE used to build generic packages for this baseline only has
65
	 * meaning in the daemon build, not the escrow build accessed by
66
	 * BuildStandard::getPlatform, getBuildStandard
67
	 * 
68
	 * @attribute
69
	 */
70
	public static final String mGenericMachtype = System.getenv("GBE_MACHTYPE");
814 mhunt 71
 
4285 dpurdie 72
	/**
73
	 * build dependencies by package alias
74
	 * 
75
	 * @attribute
76
	 */
77
	Vector<String> mDependencyCollection = new Vector<String>();
814 mhunt 78
 
4285 dpurdie 79
	/**
80
	 * primary package version key pv_id in database
81
	 * 
82
	 * @attribute
83
	 */
84
	int mId;
814 mhunt 85
 
4285 dpurdie 86
	/**
87
	 * indication of the nature of change
88
	 * 
89
	 * @attribute
90
	 */
91
	Package.VersionNumberingStandard mChangeType = new VersionNumberingStandard();
814 mhunt 92
 
4285 dpurdie 93
	/**
94
	 * determines what field is rippled on a package version whose dependencies
95
	 * have changed
96
	 * 
97
	 * @attribute
98
	 */
99
	Package.VersionNumberingStandard mRippleField = new VersionNumberingStandard();
814 mhunt 100
 
4285 dpurdie 101
	/**
102
	 * interested owners
103
	 * 
104
	 * @attribute
105
	 */
106
	private Vector<String> mBuildFailureEmailCollection = new Vector<String>();
814 mhunt 107
 
4285 dpurdie 108
	/**
109
	 * when true will trigger unit tests as part of the package build phase in
110
	 * daemon mode
111
	 * 
112
	 * @attribute
113
	 */
114
	boolean mHasAutomatedUnitTests = false;
814 mhunt 115
 
4285 dpurdie 116
	/**
117
	 * when true, do not ripple this package through packages which are
118
	 * dependent upon it in daemon mode
119
	 * 
120
	 * @attribute
121
	 */
122
	boolean mAdvisoryRipple = false;
814 mhunt 123
 
4285 dpurdie 124
	/**
125
	 * determines the build file the package is built in, or not 1 Post Plan:
126
	 * buildfile - Result of planning 2 Post Plan: Future build requirement 3
127
	 * Post Plan: Package has no build requiremnt 0 not yet processed (initial
128
	 * value) -1 not reproducible -2 not reproducible on the build platforms
129
	 * configured for this release -3 do not ripple -4 directly dependent on
130
	 * package versions not in the baseline -5 indirectly dependent on package
131
	 * versions which are not reproducible because of -1, -2 (escrow), -3
132
	 * (daemon), -4, -6 -6 circular dependency
133
	 * 
134
	 * @attribute
135
	 */
136
	int mBuildFile = 0;
814 mhunt 137
 
4285 dpurdie 138
	/**
139
	 * build dependencies by package
140
	 * 
141
	 * @attribute
142
	 */
143
	Vector<Package> mPackageDependencyCollection = new Vector<Package>();
814 mhunt 144
 
4285 dpurdie 145
	/**
146
	 * used for escrow build purposes set true when a package has been processed
147
	 * 
148
	 * @attribute
149
	 */
150
	boolean mProcessed = false;
814 mhunt 151
 
4285 dpurdie 152
	/**
153
	 * set true for WIP package versions only used in daemon mode
154
	 * 
155
	 * @attribute
156
	 */
157
	boolean mDirectlyPlanned = false;
814 mhunt 158
 
4285 dpurdie 159
	/**
160
	 * set true when it is determined to be ripple built
161
	 * 
162
	 * @attribute
163
	 */
164
	boolean mIndirectlyPlanned = false;
814 mhunt 165
 
4285 dpurdie 166
	/**
167
	 * non zero instruction number when it is determined to be ripple built by
168
	 * force
169
	 * 
170
	 * @attribute
171
	 */
172
	int mForcedRippleInstruction = 0;
908 mhunt 173
 
4285 dpurdie 174
	/**
175
	 * non zero instruction number when it is determined to be test built
176
	 * 
177
	 * @attribute
178
	 */
179
	int mTestBuildInstruction = 0;
908 mhunt 180
 
4285 dpurdie 181
	/**
182
	 * test build email destination
183
	 * 
184
	 * @attribute
185
	 */
186
	String mTestBuildEmail;
908 mhunt 187
 
4285 dpurdie 188
	/**
189
	 * Version Control System Tag
190
	 * 
191
	 * @attribute
192
	 */
193
	String mTestBuildVcsTag = new String();
908 mhunt 194
 
4285 dpurdie 195
	/**
196
	 * build standards
197
	 * 
198
	 * @attribute
199
	 */
200
	Vector<BuildStandard> mTestBuildStandardCollection = new Vector<BuildStandard>();
908 mhunt 201
 
4285 dpurdie 202
	/**
203
	 * build dependencies by package alias
204
	 * 
205
	 * @attribute
206
	 */
207
	Vector<String> mTestBuildDependencyCollection = new Vector<String>();
908 mhunt 208
 
4285 dpurdie 209
	/**
210
	 * build dependencies by pv_id (-1 or not used for planned dependencies)
211
	 * 
212
	 * @attribute
213
	 */
214
	Vector<Integer> mDependencyIDCollection = new Vector<Integer>();
814 mhunt 215
 
4285 dpurdie 216
	/**
217
	 * unique pkg_id in the database used for querying package version existence
218
	 * in the database in daemon mode
219
	 * 
220
	 * @attribute
221
	 */
222
	int mPid;
814 mhunt 223
 
4285 dpurdie 224
	/**
225
	 * maximum major number supported for determining ripple number
226
	 * 
227
	 * @attribute
228
	 */
229
	int mMajorLimit;
874 mhunt 230
 
4285 dpurdie 231
	/**
232
	 * maximum minor number supported for determining ripple number
233
	 * 
234
	 * @attribute
235
	 */
236
	int mMinorLimit;
874 mhunt 237
 
4285 dpurdie 238
	/**
239
	 * maximum patch number supported for determining ripple number
240
	 * 
241
	 * @attribute
242
	 */
243
	int mPatchLimit;
874 mhunt 244
 
4285 dpurdie 245
	/**
246
	 * maximum build number number supported for determining ripple number
247
	 * 
248
	 * @attribute
249
	 */
250
	int mBuildLimit;
874 mhunt 251
 
4285 dpurdie 252
	/**
253
	 * Logger
254
	 * 
255
	 * @attribute
256
	 */
257
	private static final Logger mLogger = Logger.getLogger(Package.class);
814 mhunt 258
 
4285 dpurdie 259
	/**
260
	 * dpkg archive location
261
	 * 
262
	 * @attribute
263
	 */
264
	public static final String mGbeDpkg = System.getenv("GBE_DPKG");
814 mhunt 265
 
4285 dpurdie 266
	/**
267
	 * Exception message used upon detection an archive does not exist Seems
268
	 * this is a rare but transient and recoverable scenario
269
	 * 
270
	 * @attribute
271
	 */
272
	public static final String mRecoverable = "dpkg_archive does not exist, recovery will be attempted";
896 mhunt 273
 
4285 dpurdie 274
	/**
275
	 * true if the package exists in the package archive (dpkg_archive)
276
	 * 
277
	 * @attribute
278
	 */
279
	private boolean mArchivalExistence = true;
814 mhunt 280
 
4285 dpurdie 281
	/**
282
	 * when true will trigger source control interaction eg labelling
283
	 * 
284
	 * @attribute
285
	 */
286
	public boolean mRequiresSourceControlInteraction = true;
852 mhunt 287
 
4285 dpurdie 288
	/**
289
	 * when true has been checked for circular dependency
290
	 * 
291
	 * @attribute
292
	 */
293
	boolean mCheckedCircularDependency = false;
910 mhunt 294
 
4285 dpurdie 295
	/**
296
	 * when true has circular dependency
297
	 * 
298
	 * @attribute
299
	 */
300
	boolean mHasCircularDependency = false;
910 mhunt 301
 
4285 dpurdie 302
	/**
303
	 * constructor
304
	 */
305
	Package(int pv_id, String pkg_name, String v_ext, String alias, String pkg_vcs_tag, char change_type,
306
			char ripple_field, String pkg_version)
307
	{
308
		mLogger.debug("Package 1: pv_id " + pv_id + " pkg_name " + pkg_name + " v_ext " + v_ext + " alias " + alias
309
				+ " pkg_vcs_tag " + pkg_vcs_tag + " change_type " + change_type);
310
		mId = pv_id;
311
		mName = pkg_name;
312
		mVersion = "0.0.0000";
313
		mExtension = v_ext;
314
		mAlias = alias;
315
		mVcsTag = pkg_vcs_tag;
924 dpurdie 316
 
4285 dpurdie 317
		// Must not have any extension
318
		mFixedVersion = pkg_version;
319
		mFixedVersion = mFixedVersion.substring(0, mFixedVersion.length() - mExtension.length());
4212 dpurdie 320
 
4285 dpurdie 321
		if (change_type == 'M')
322
		{
323
			// a ripple_field of 'L' indicates this package has limited version
324
			// numbering
325
			mChangeType.setMajor(ripple_field == 'L' ? true : false);
326
		} else if (change_type == 'N')
327
		{
328
			mChangeType.setMinor(ripple_field == 'L' ? true : false);
329
		} else if (change_type == 'P')
330
		{
331
			mChangeType.setPatch(ripple_field == 'L' ? true : false);
332
		} else if (change_type == 'F')
333
		{
334
			mChangeType.setFixed();
335
		} else
336
		{
337
			mChangeType.setUnknown();
338
		}
339
	}
814 mhunt 340
 
4285 dpurdie 341
	/**
342
	 * constructor
343
	 */
344
	Package(int pv_id, String pkg_name, String pkg_version, String v_ext, String alias, String pkg_vcs_tag,
345
			char ripple_field)
346
	{
347
		mLogger.debug("Package 2: pv_id " + pv_id + " pkg_name " + pkg_name + " pkg_version " + pkg_version + " v_ext "
348
				+ v_ext + " alias " + alias + " pkg_vcs_tag " + pkg_vcs_tag + " ripple_field " + ripple_field);
349
		mId = pv_id;
350
		mName = pkg_name;
351
		mVersion = pkg_version;
352
		int endindex = mVersion.length() - v_ext.length();
924 dpurdie 353
 
4285 dpurdie 354
		if (endindex > 0)
355
		{
356
			mVersion = mVersion.substring(0, endindex);
357
		}
814 mhunt 358
 
4285 dpurdie 359
		mExtension = v_ext;
360
		mAlias = alias;
361
		mVcsTag = pkg_vcs_tag;
814 mhunt 362
 
4285 dpurdie 363
		// setBuild is the default
364
		if (ripple_field == 'M')
365
		{
366
			mRippleField.setMajor();
367
		} else if (ripple_field == 'm')
368
		{
369
			mRippleField.setMinor();
370
		} else if (ripple_field == 'p')
371
		{
372
			mRippleField.setPatch();
373
		} else if (ripple_field == 'L')
374
		{
375
			mRippleField.setLimit();
376
		}
377
	}
1320 dpurdie 378
 
4285 dpurdie 379
	/**
380
	 * constructor
381
	 */
382
	Package()
383
	{
384
		mLogger.debug("Package 3");
385
		mId = 0;
386
		mName = "null";
387
		mExtension = "null";
388
		mAlias = "null";
389
		mVcsTag = "null";
390
	}
1320 dpurdie 391
 
4285 dpurdie 392
	/**
393
	 * constructor for test build purposes
394
	 */
395
	Package(String pkg_name, String v_ext, String alias, String pkg_vcs_tag, int testBuildInstruction, String email)
396
	{
397
		mLogger.debug("Package 4: pkg_name " + pkg_name + " v_ext " + v_ext + " alias " + alias + " pkg_vcs_tag "
398
				+ pkg_vcs_tag);
399
		// don't need pv_id
400
		mId = -1;
401
		mName = pkg_name;
402
		// avoid interaction with real versions
403
		mVersion = "0.0.0000";
404
		mExtension = v_ext;
405
		mAlias = alias;
406
		mTestBuildInstruction = testBuildInstruction;
407
		mTestBuildEmail = email;
408
		mTestBuildVcsTag = pkg_vcs_tag;
1320 dpurdie 409
 
4285 dpurdie 410
	}
874 mhunt 411
 
4285 dpurdie 412
	/**
413
	 * constructor for unit test purposes
414
	 */
415
	public Package(ReleaseManager rm, String version, int majorLimit, int minorLimit, int patchLimit,
416
			int buildNumberLimit)
417
	{
418
		mId = -1;
419
		mRippleField.setLimit();
420
		mVersion = version;
421
		mMajorLimit = majorLimit;
422
		mMinorLimit = minorLimit;
423
		mPatchLimit = patchLimit;
424
		mBuildLimit = buildNumberLimit;
4280 dpurdie 425
 
4285 dpurdie 426
		if (version.endsWith(".cots"))
427
		{
428
			mExtension = ".cots";
429
			mVersion = version.substring(0, version.length() - 5);
430
			mChangeType.setMajor(false);
431
			mChangeType.setMinor(false);
432
			mChangeType.setPatch(true);
433
			mRippleField.setBuild();
434
		}
814 mhunt 435
 
4285 dpurdie 436
		try
437
		{
438
			mId = applyPV(rm, 0);
439
		} catch (Exception e)
440
		{
441
		}
442
	}
814 mhunt 443
 
4285 dpurdie 444
	/**
445
	 * accessor for unit test purposes
446
	 */
447
	public int getId()
448
	{
449
		return mId;
450
	}
814 mhunt 451
 
4285 dpurdie 452
	/**
453
	 * accessor for unit test purposes
454
	 */
455
	public String getVersion()
456
	{
457
		return mVersion;
458
	}
814 mhunt 459
 
4285 dpurdie 460
	/**
461
	 * returns true if mBuildStandardCollection is not empty
462
	 */
463
	boolean isReproducible()
464
	{
465
		mLogger.debug("isReproducible on Package " + mName);
466
		boolean retVal = false;
814 mhunt 467
 
4285 dpurdie 468
		if (mBuildStandardCollection.size() > 0)
469
		{
470
			retVal = true;
471
		}
814 mhunt 472
 
4285 dpurdie 473
		mLogger.info("isReproducible returned " + retVal);
474
		return retVal;
475
	}
814 mhunt 476
 
4285 dpurdie 477
	/**
478
	 * returns true if at least one of its BuildStandards has mWin32 or mGeneric
479
	 * true
480
	 */
481
	boolean isWin32Built()
482
	{
483
		mLogger.debug("isWin32Built on Package " + mName);
484
		boolean retVal = false;
485
		for (Iterator<BuildStandard> it = mBuildStandardCollection.iterator(); it.hasNext();)
486
		{
487
			BuildStandard buildStandard = it.next();
814 mhunt 488
 
4285 dpurdie 489
			if (buildStandard.getWin32() || buildStandard.getGeneric())
490
			{
491
				retVal = true;
492
				break;
493
			}
494
		}
814 mhunt 495
 
4285 dpurdie 496
		mLogger.info("isWin32Built returned " + retVal);
497
		return retVal;
498
	}
814 mhunt 499
 
4285 dpurdie 500
	/**
501
	 * returns true if at least one of its BuildStandards has mSolaris or
502
	 * mGeneric true
503
	 */
504
	boolean isSolarisBuilt()
505
	{
506
		mLogger.debug("isSolarisBuilt on Package " + mName);
507
		boolean retVal = false;
508
		for (Iterator<BuildStandard> it = mBuildStandardCollection.iterator(); it.hasNext();)
509
		{
510
			BuildStandard buildStandard = it.next();
814 mhunt 511
 
4285 dpurdie 512
			if (buildStandard.getSolaris() || buildStandard.getGeneric())
513
			{
514
				retVal = true;
515
				break;
516
			}
517
		}
814 mhunt 518
 
4285 dpurdie 519
		mLogger.info("isSolarisBuilt returned " + retVal);
520
		return retVal;
521
	}
814 mhunt 522
 
4285 dpurdie 523
	/**
524
	 * returns true if at least one of its BuildStandards has mLinux or mGeneric
525
	 * true
526
	 */
527
	boolean isLinuxBuilt()
528
	{
529
		mLogger.debug("isLinuxBuilt on Package " + mName);
530
		boolean retVal = false;
531
		for (Iterator<BuildStandard> it = mBuildStandardCollection.iterator(); it.hasNext();)
532
		{
533
			BuildStandard buildStandard = it.next();
908 mhunt 534
 
4285 dpurdie 535
			if (buildStandard.getLinux() || buildStandard.getGeneric())
536
			{
537
				retVal = true;
538
				break;
539
			}
540
		}
4212 dpurdie 541
 
4285 dpurdie 542
		mLogger.info("isLinuxBuilt returned " + retVal);
543
		return retVal;
544
	}
4212 dpurdie 545
 
4285 dpurdie 546
	/**
547
	 * returns true if at least one of its BuildStandards has mGeneric true
548
	 */
549
	boolean isGeneric()
550
	{
551
		mLogger.debug("isGeneric on Package " + mName);
552
		boolean retVal = false;
553
		for (Iterator<BuildStandard> it = mBuildStandardCollection.iterator(); it.hasNext();)
554
		{
555
			BuildStandard buildStandard = it.next();
4212 dpurdie 556
 
4285 dpurdie 557
			if (buildStandard.getGeneric())
558
			{
559
				retVal = true;
560
				break;
561
			}
562
		}
814 mhunt 563
 
4285 dpurdie 564
		mLogger.info("isGeneric returned " + retVal);
565
		return retVal;
566
	}
888 mhunt 567
 
4285 dpurdie 568
	/**
569
	 * applies the required version number change returns 0 on success 1 on
570
	 * cannot work with non standard versioning 2 on ripple field limitations
571
	 * prevent a ripple build 3 on Invalid Change Type
572
	 */
573
	int applyPV(ReleaseManager releaseManager, int rtag_id) throws Exception
574
	{
575
		mLogger.debug("applyPV on Package " + mName);
576
		//
577
		// Four scenarios, only applyPV for 3 of them
578
		// mDirectlyPlanned mIndirectlyPlanned mArchivalExistence mForcedRipple
579
		// Action
580
		// WIP/test build exists: true true don't care don't care applyPV
581
		// Package version is out of date: false true true don't care applyPV
582
		// Forced ripple: false true don't care > 0 applyPV
583
		// Package version does not exist: false true false = 0 do not applyPV
584
		//
585
		if (!mDirectlyPlanned && mIndirectlyPlanned && !mArchivalExistence && mForcedRippleInstruction == 0)
586
		{
587
			// the package has an mIndirectlyPlanned flag set true in daemon
588
			// mode because the package does not exist in an archive
589
			// do not apply a different package version
590
			mLogger.info("applyPV !mDirectlyPlanned && mIndirectlyPlanned && !mArchivalExistence && zero mForcedRippleInstruction on Package "
591
					+ mName);
592
			releaseManager.claimVersion(mPid, mVersion + mExtension, rtag_id);
593
			mLogger.info("applyPv returned 0");
594
			return 0;
595
		}
1320 dpurdie 596
 
4285 dpurdie 597
		// override - no longer doing a rebuild - version number change from
598
		// this point on
599
		if (mTestBuildInstruction == 0)
600
		{
601
			mRequiresSourceControlInteraction = true;
602
		}
814 mhunt 603
 
4285 dpurdie 604
		//
605
		// Detect invalid change type
606
		// Flagged when package instance is created
607
		//
608
		if (mChangeType.mUnknown)
609
		{
610
			mLogger.info("Package Vesrion specified on Package " + mName + "New Version:" + mVersion);
611
			mLogger.info("applyPv returned 3");
612
			return 3;
613
		}
888 mhunt 614
 
4285 dpurdie 615
		// If we are not calculating the new package version because the user
616
		// has fixed the version
617
		// of the package. We are given the new package version.
618
		if (mChangeType.mFixed)
619
		{
620
			// mVersion is already setup
814 mhunt 621
 
4285 dpurdie 622
			mVersion = mFixedVersion;
623
			mLogger.info("Package Vesrion specified on Package " + mName + "New Version:" + mVersion);
624
			releaseManager.claimVersion(mPid, mVersion + mExtension, rtag_id);
625
			mLogger.info("applyPv returned 0");
626
			return 0;
627
		}
814 mhunt 628
 
4285 dpurdie 629
		// We need to calculate the new version number
630
		//
631
		MutableInt major = new MutableInt();
632
		major.value = 0;
633
		MutableInt minor = new MutableInt();
634
		minor.value = 0;
635
		MutableInt patch = new MutableInt();
636
		patch.value = 1000;
814 mhunt 637
 
4285 dpurdie 638
		String field[] = mVersion.split("\\D");
639
		String nonStandardCotsVersion = "";
896 mhunt 640
 
4285 dpurdie 641
		if (field.length == 3)
642
		{
643
			major.value = Integer.parseInt(field[0]);
644
			minor.value = Integer.parseInt(field[1]);
645
			patch.value = Integer.parseInt(field[2]);
646
		} else
647
		{
648
			//
649
			// Can ripple a .cots package under very controlled conditions
650
			// Its ends with a .patchBuild field
651
			// Package is marked as ripple via build number
652
			// Change type of Major and Minor are not allowed
653
			//
654
			if (!mChangeType.mMajor && !mChangeType.mMinor && mRippleField.mBuild && mExtension.compareTo(".cots") == 0
655
					&& field.length > 0)
656
			{
657
				// DEVI 52782
658
				// allow and work with (ripple build) versions a.b.c.d....xxxx
659
				// where xxxx.length > 3
660
				String patchStr = field[field.length - 1];
661
				int patchLen = patchStr.length();
814 mhunt 662
 
4285 dpurdie 663
				// check patchStr is the last (at least 4) digits
664
				if (patchLen > 3
665
						&& mVersion.substring(mVersion.length() - patchLen, mVersion.length()).compareTo(patchStr) == 0)
666
				{
667
					patch.value = Integer.parseInt(patchStr);
668
					nonStandardCotsVersion = mVersion.substring(0, mVersion.length() - patchLen);
669
				}
670
			}
814 mhunt 671
 
4285 dpurdie 672
			if (nonStandardCotsVersion.length() == 0)
673
			{
674
				// cannot work with non standard versioning
675
				mLogger.error("applyPV cannot work with non standard versioning");
676
				mLogger.info("applyPv returned 1");
677
				return 1;
678
			}
679
		}
814 mhunt 680
 
4285 dpurdie 681
		if (nonStandardCotsVersion.length() == 0 && patch.value < 1000 && field[2].substring(0, 1).compareTo("0") != 0)
682
		{
683
			mLogger.info("applyPV accomodate old style mVersion of the form 1.0.1");
684
			patch.value = patch.value * 1000;
685
		}
814 mhunt 686
 
4285 dpurdie 687
		// mChangeType overrides mRippleField
688
		do
689
		{
690
			if (mChangeType.mMajor)
691
			{
692
				if (!incrementFieldsAccordingToLimits(4, major, minor, patch))
693
				{
694
					mLogger.info("applyPv returned 2");
695
					return 2;
696
				}
697
			} else if (mChangeType.mMinor)
698
			{
699
				if (!incrementFieldsAccordingToLimits(3, major, minor, patch))
700
				{
701
					mLogger.info("applyPv returned 2");
702
					return 2;
703
				}
704
			} else if (mChangeType.mPatch)
705
			{
706
				if (!incrementFieldsAccordingToLimits(2, major, minor, patch))
707
				{
708
					mLogger.info("applyPv returned 2");
709
					return 2;
710
				}
711
			} else
712
			{
713
				if (mRippleField.mMajor)
714
				{
715
					major.value++;
716
					mLogger.info("applyPV mRippleField.mMajor " + major.value);
717
					minor.value = 0;
718
					patch.value = 0;
719
				} else if (mRippleField.mMinor)
720
				{
721
					minor.value++;
722
					mLogger.info("applyPV mRippleField.mMinor " + minor.value);
723
					patch.value = 0;
724
				} else if (mRippleField.mPatch)
725
				{
726
					do
727
					{
728
						patch.value++;
729
					} while ((patch.value / 1000) * 1000 != patch.value);
730
					mLogger.info("applyPV mRippleField.mPatch " + patch.value);
731
				} else if (mRippleField.mBuild)
732
				{
733
					patch.value++;
734
					mLogger.info("applyPV mRippleField.mBuild " + patch.value);
735
				} else
736
				{
737
					if (!incrementFieldsAccordingToLimits(1, major, minor, patch))
738
					{
739
						mLogger.info("applyPv returned 2");
740
						return 2;
741
					}
742
				}
743
			}
814 mhunt 744
 
4285 dpurdie 745
			if (nonStandardCotsVersion.length() == 0)
746
			{
747
				mVersion = String.valueOf(major.value) + "." + String.valueOf(minor.value) + ".";
748
			} else
749
			{
750
				mVersion = nonStandardCotsVersion;
751
			}
866 mhunt 752
 
4285 dpurdie 753
			if (patch.value < 10)
754
			{
755
				mVersion += "000";
756
			} else if (patch.value < 100)
757
			{
758
				mVersion += "00";
759
			} else if (patch.value < 1000)
760
			{
761
				mVersion += "0";
762
			}
864 mhunt 763
 
4285 dpurdie 764
			mVersion += String.valueOf(patch.value);
765
		} while (exists(releaseManager, rtag_id));
908 mhunt 766
 
4285 dpurdie 767
		releaseManager.claimVersion(mPid, mVersion + mExtension, rtag_id);
768
		mLogger.info("applyPv returned 0");
769
		return 0;
770
	}
908 mhunt 771
 
4285 dpurdie 772
	/**
773
	 * increments fields according to mRippleField.mLimit if necessary will
774
	 * apply it to the field passed as follows 1 = build 2 = patch 3 = minor
775
	 * other = major returns true on success false on ripple field limitations
776
	 * prevent a ripple build
777
	 */
778
	private boolean incrementFieldsAccordingToLimits(int field, MutableInt major, MutableInt minor, MutableInt patch)
779
	{
780
		boolean retVal = true;
908 mhunt 781
 
4285 dpurdie 782
		if (!mChangeType.mLimit && !mRippleField.mLimit)
783
		{
784
			// simple case
785
			// no need to take field limits into consideration
786
			switch (field)
787
			{
788
			case 1:
789
				// unreachable
790
				// the only scenario involving build number manipulation
791
				// involves the mRippleField.mLimit being set
792
				retVal = false;
793
				break;
794
			case 2:
795
				do
796
				{
797
					patch.value++;
798
				} while ((patch.value / 1000) * 1000 != patch.value);
799
				mLogger.info("incrementFieldsAccordingToLimits patch " + patch.value);
800
				break;
801
			case 3:
802
				minor.value++;
803
				mLogger.info("incrementFieldsAccordingToLimits minor " + minor.value);
804
				patch.value = 0;
805
				break;
806
			default:
807
				major.value++;
808
				mLogger.info("incrementFieldsAccordingToLimits major " + major.value);
809
				minor.value = 0;
810
				patch.value = 0;
811
			}
812
		} else
813
		{
814
			// take field limits into consideration
815
			boolean changeOccurred = false;
816
			boolean incrementField = true;
908 mhunt 817
 
4285 dpurdie 818
			switch (field)
819
			{
820
			case 1:
821
				if (mBuildLimit != 0)
822
				{
823
					// increment or reset the patch build number
824
					int buildNumber = patch.value - (patch.value / 1000) * 1000;
908 mhunt 825
 
4285 dpurdie 826
					if (buildNumber < mBuildLimit)
827
					{
828
						// can increment the patch build number
829
						patch.value++;
830
						mLogger.info("incrementFieldsAccordingToLimits mRippleField.mLimit build number " + patch.value);
831
						changeOccurred = true;
832
						incrementField = false;
833
					} else
834
					{
835
						if (mPatchLimit == 0)
836
						{
837
							// reset the patch number and patch build number
838
							patch.value = 0;
839
						}
840
					}
841
				}
842
				// no break by design
843
			case 2:
844
				if (mPatchLimit != 0 && incrementField)
845
				{
846
					// increment or reset the patch number
847
					if ((patch.value / 1000) < mPatchLimit)
848
					{
849
						do
850
						{
851
							patch.value++;
852
						} while ((patch.value / 1000) * 1000 != patch.value);
908 mhunt 853
 
4285 dpurdie 854
						mLogger.info("incrementFieldsAccordingToLimits mRippleField.mLimit patch " + patch.value);
855
						changeOccurred = true;
856
						incrementField = false;
857
					} else
858
					{
859
						// reset the patch number and patch build number
860
						patch.value = 0;
861
					}
862
				}
863
				// no break by design
864
			case 3:
865
				if (mMinorLimit != 0 && incrementField)
866
				{
867
					// increment or reset the minor number
868
					if (minor.value < mMinorLimit)
869
					{
870
						minor.value++;
871
						patch.value = 0;
872
						mLogger.info("incrementFieldsAccordingToLimits mRippleField.mLimit minor " + minor.value);
873
						changeOccurred = true;
874
						incrementField = false;
875
					} else
876
					{
877
						// reset the minor number
878
						minor.value = 0;
879
					}
880
				}
881
				// no break by design
882
			default:
883
				if (mMajorLimit != 0 && incrementField)
884
				{
885
					// increment or reset the major number
886
					if (major.value < mMajorLimit)
887
					{
888
						// increment the major number
889
						changeOccurred = true;
890
						major.value++;
891
						minor.value = 0;
892
						patch.value = 0;
893
						mLogger.info("incrementFieldsAccordingToLimits mRippleField.mLimit major " + major.value);
894
					}
895
				}
896
			}
924 dpurdie 897
 
4285 dpurdie 898
			if (!changeOccurred)
899
			{
900
				// unable to increment a field due to field limitations
901
				mLogger.error("incrementFieldsAccordingToLimits ripple field limitations prevent a ripple build");
902
				mLogger.info("incrementFieldsAccordingToLimits returned false");
903
				retVal = false;
904
			}
905
		}
4280 dpurdie 906
 
4285 dpurdie 907
		return retVal;
908
	}
814 mhunt 909
 
4285 dpurdie 910
	/**
911
	 * returns true if the version exists in the dpkg_archive or release manager
912
	 * database claims the version in the release manager database
913
	 */
914
	private boolean exists(ReleaseManager releaseManager, int rtag_id) throws Exception
915
	{
916
		mLogger.debug("exists 1 on Package " + mName + " version " + mVersion + " extension " + mExtension);
917
		boolean retVal = false;
814 mhunt 918
 
4285 dpurdie 919
		if (!ReleaseManager.mUseDatabase)
920
		{
921
			mLogger.info("exists 1 !releaseManager.mUseDatabase");
922
		} else
923
		{
924
			retVal = exists();
814 mhunt 925
 
4285 dpurdie 926
			if (!retVal)
927
			{
928
				String pkg_version = new String(mVersion);
814 mhunt 929
 
4285 dpurdie 930
				if (mExtension.length() > 0)
931
				{
932
					pkg_version += mExtension;
933
				}
874 mhunt 934
 
4285 dpurdie 935
				retVal = releaseManager.queryPackageVersions(mPid, pkg_version);
936
			}
937
		}
4212 dpurdie 938
 
4285 dpurdie 939
		mLogger.info("exists 1 returned " + retVal);
940
		return retVal;
941
	}
4212 dpurdie 942
 
4285 dpurdie 943
	/**
944
	 * returns true if the required package archives (dpkg_archive) exist
945
	 * attempt to recover from their transient loss
946
	 */
947
	public static boolean recover()
948
	{
949
		mLogger.debug("recover");
950
		boolean retVal = false;
814 mhunt 951
 
4285 dpurdie 952
		String Release = mGbeDpkg;
953
		if (Release != null)
954
		{
955
			File dpkg = new File(mGbeDpkg);
814 mhunt 956
 
4285 dpurdie 957
			if (dpkg.exists())
958
			{
959
				retVal = true;
960
				mLogger.fatal("recover: dpkg_archive access has been restored");
961
			}
962
		}
814 mhunt 963
 
4285 dpurdie 964
		mLogger.info("recover returned " + retVal);
965
		return retVal;
966
	}
902 mhunt 967
 
4285 dpurdie 968
	/**
969
	 * returns true if the version exists in a package archive (dpkg_archive)
970
	 */
971
	boolean exists() throws Exception
972
	{
973
		mLogger.debug("exists 2 on Package " + mName);
974
		boolean retVal = false;
814 mhunt 975
 
4285 dpurdie 976
		String Release = mGbeDpkg;
977
		if (Release == null)
978
		{
979
			mLogger.fatal("exists 2 Release == null");
980
			throw new Exception("exists 2 Release == null");
981
		}
902 mhunt 982
 
4285 dpurdie 983
		File dpkg = new File(mGbeDpkg);
984
		if (!dpkg.exists())
985
		{
986
			mLogger.fatal("exists 2 " + mRecoverable);
987
			throw new Exception(mRecoverable);
988
		}
814 mhunt 989
 
4285 dpurdie 990
		String fs = System.getProperty("file.separator");
991
		String name = new String(Release);
992
		name += fs + mName + fs + mVersion + mExtension;
993
		File release = new File(name);
902 mhunt 994
 
4285 dpurdie 995
		if (release.exists())
996
		{
997
			mLogger.info("exists 2 release.exists()");
998
			retVal = true;
999
		}
874 mhunt 1000
 
4285 dpurdie 1001
		mArchivalExistence = retVal;
1002
		mLogger.info("exists 2 returned " + retVal);
1003
		return retVal;
1004
	}
4212 dpurdie 1005
 
4285 dpurdie 1006
	/**
1007
	 * returns email information
1008
	 */
1009
	String emailInfo(String lf)
1010
	{
1011
		String retVal = new String();
4212 dpurdie 1012
 
4285 dpurdie 1013
		for (Iterator<String> it = mBuildFailureEmailCollection.iterator(); it.hasNext();)
1014
		{
1015
			String email = it.next();
1016
			retVal += "  <owner email=\"" + email + "\"/>" + lf;
1017
		}
814 mhunt 1018
 
4285 dpurdie 1019
		return retVal;
1020
	}
1021
 
1022
	/**
1023
	 * returns email information
1024
	 */
1025
	String emailInfoNonAntTask()
1026
	{
1027
		String retVal = null;
1028
 
1029
		for (Iterator<String> it = mBuildFailureEmailCollection.iterator(); it.hasNext();)
1030
		{
1031
			String email = it.next();
1032
 
1033
			if (retVal == null)
1034
			{
1035
				retVal = new String();
1036
			} else
1037
			{
1038
				retVal += ",";
1039
			}
1040
			retVal += email;
1041
		}
1042
 
1043
		return retVal;
1044
	}
1045
 
1046
	/**
1047
	 * adds email to mBuildFailureEmailCollection if unique
1048
	 */
1049
	void addEmail(String email)
1050
	{
1051
		boolean alreadyExists = false;
1052
 
1053
		for (Iterator<String> it = mBuildFailureEmailCollection.iterator(); it.hasNext();)
1054
		{
1055
			String existingEmail = it.next();
1056
 
1057
			if (existingEmail.compareTo(email) == 0)
1058
			{
1059
				alreadyExists = true;
1060
				break;
1061
			}
1062
		}
1063
 
1064
		if (!alreadyExists)
1065
		{
1066
			mBuildFailureEmailCollection.add(email);
1067
		}
1068
	}
1069
 
1070
	/**
1071
	 * accessor method
1072
	 */
1073
	void setEmail()
1074
	{
1075
		mBuildFailureEmailCollection.clear();
1076
		addEmail(mTestBuildEmail);
1077
	}
1078
 
1079
	/**
1080
	 * accessor method
1081
	 */
1082
	void setDependencyCollection()
1083
	{
1084
		// does not worry about mPackageDendencyCollection by design
1085
		mDependencyCollection.clear();
1086
 
1087
		for (Iterator<String> it = mTestBuildDependencyCollection.iterator(); it.hasNext();)
1088
		{
1089
			String dependency = it.next();
1090
			mDependencyCollection.add(dependency);
1091
		}
1092
	}
1093
 
1094
	/**
1095
	 * accessor method
1096
	 */
1097
	void setBuildStandardCollection()
1098
	{
1099
		mBuildStandardCollection.clear();
1100
 
1101
		for (Iterator<BuildStandard> it = mTestBuildStandardCollection.iterator(); it.hasNext();)
1102
		{
1103
			BuildStandard buildStandard = it.next();
1104
			mBuildStandardCollection.add(buildStandard);
1105
		}
1106
	}
1107
 
1108
	/**
1109
	 * sends email notification and marks the instruction complete in the
1110
	 * database
1111
	 */
1112
	public void completeTestBuild(String mailServer, String mailSender, ReleaseManager releaseManager, String release,
1113
			boolean success) throws SQLException, Exception
1114
	{
1115
		mLogger.debug("completeTestBuild");
1116
 
1117
		if (mTestBuildInstruction == 0)
1118
		{
1119
			mLogger.fatal("completeTestBuild. Not Build Instruction");
1120
			return;
1121
		}
1122
		String subject = (success == true ? "TEST BUILD COMPLETED SUCCESSFULLY" : "TEST BUILD FAILED") + " on package "
1123
				+ mAlias;
1124
		String mailBody = "Test build issues are identified in preceding build failure email.<p>" + "Release: "
1125
				+ release + "<br>" + "Package: " + mAlias + "<br>" + "VcsTag: " + mVcsTag + "<br>"
1126
				+ "Build dependencies:<br>";
1127
		String indentString = "&nbsp;&nbsp;&nbsp;&nbsp;";
1128
 
1129
		for (Iterator<Package> it3 = mPackageDependencyCollection.iterator(); it3.hasNext();)
1130
		{
1131
			Package depend = it3.next();
1132
 
1133
			String dependsExtension = depend.mExtension;
1134
			String dependsVersion = depend.mVersion;
1135
 
1136
			if (dependsExtension.length() > 0)
1137
			{
1138
				dependsVersion += dependsExtension;
1139
			}
1140
			mailBody += indentString + "\'" + depend.mName + "\',\'" + dependsVersion + "\' <br>";
1141
		}
1142
 
1143
		mailBody += "<br>Build standards:<br>";
1144
 
1145
		for (Iterator<BuildStandard> it = mBuildStandardCollection.iterator(); it.hasNext();)
1146
		{
1147
			BuildStandard bs = it.next();
1148
 
1149
			String platform = bs.getPlatform(!ReleaseManager.mUseDatabase, false);
1150
 
1151
			if (platform.length() > 0)
1152
			{
1153
				mailBody += indentString + platform + ", ";
1154
			}
1155
 
1156
			String standard = bs.getBuildStandard(!ReleaseManager.mUseDatabase, false);
1157
 
1158
			if (standard.length() > 0)
1159
			{
1160
				mailBody += standard + "<br>";
1161
			}
1162
		}
1163
 
1164
		mailBody += "<p><hr>";
1165
		try
1166
		{
1167
			String target = emailInfoNonAntTask();
1168
			mLogger.fatal("completeTestBuildEmail Server: " + mailServer);
1169
			mLogger.fatal("completeTestBuildEmail Sender: " + mailSender);
1170
			mLogger.fatal("completeTestBuildEmail Target: " + target);
1171
 
1172
			Smtpsend.send(mailServer, 	// mailServer
1173
					mailSender, 		// source
1174
					target, 			// target
1175
					mailSender, 		// cc
1176
					null, 				// bcc
1177
					subject, 			// subject
1178
					mailBody, 			// body
1179
					null 				// attachment
1180
			);
1181
		} catch (Exception e)
1182
		{
1183
			mLogger.warn("Email Failure: completeTestBuild:" + e.getMessage());
1184
		}
1185
 
1186
		releaseManager.markDaemonInstCompletedConnect(mTestBuildInstruction);
1187
		mLogger.fatal("completeTest. Returning");
1188
	}
1189
 
1190
	/**
1191
	 * returns true if the package has a circular dependency
1192
	 */
1193
	public boolean hasCircularDependency(RippleEngine ripEng)
1194
	{
1195
		mLogger.debug("hasCircularDependency");
1196
		boolean retVal = detectCircularDependency(mAlias, ripEng);
1197
		mLogger.info("hasCircularDependency returned " + retVal);
1198
		return retVal;
1199
	}
1200
 
1201
	/**
1202
	 * returns true if the package has a circular dependency
1203
	 */
1204
	public boolean detectCircularDependency(String alias, RippleEngine ripEng)
1205
	{
1206
		mLogger.debug("detectCircularDependency");
1207
		boolean retVal = false;
1208
 
1209
		// if this package has yet to be checked for circular dependency
1210
		if (!mCheckedCircularDependency)
1211
		{
1212
			for (Iterator<String> it2 = mDependencyCollection.iterator(); it2.hasNext();)
1213
			{
1214
				String dependencyAlias = it2.next();
1215
 
1216
				// check its direct dependencies for an alias match
1217
				if (alias.compareTo(dependencyAlias) == 0)
1218
				{
1219
					retVal = true;
1220
					break;
1221
				}
1222
 
1223
				Package dependency = ripEng.findPackage(dependencyAlias);
1224
 
1225
				// check its indirect dependencies for an alias match
1226
				if (dependency.detectCircularDependency(alias, ripEng))
1227
				{
1228
					retVal = true;
1229
					break;
1230
				}
1231
			}
1232
			// mark the check complete
1233
			mCheckedCircularDependency = true;
1234
			// persist the circular dependency outcome
1235
			mHasCircularDependency = retVal;
1236
		} else
1237
		{
1238
			// return the persisted circular dependency outcome
1239
			retVal = mHasCircularDependency;
1240
		}
1241
		mLogger.info("detectCircularDependency 2 returned " + retVal);
1242
		return retVal;
1243
	}
1244
 
1245
	/**
1246
	 * entity class supporting the ERG version numbering standard:
1247
	 * <major>.<minor>.<patch/build> patch/build is at least a 4 digit number
1248
	 * whose last 3 digits represent the build
1249
	 */
1250
	public class VersionNumberingStandard
1251
	{
1252
		/**
1253
		 * in terms of the mChangeType Package field, when true indicates the
1254
		 * contract of the package has changed in a non backwardly compatible
1255
		 * manner in terms of the mRippleField Package field, when true indicates
1256
		 * the major version number will be incremented
1257
		 * 
1258
		 * @attribute
1259
		 */
1260
		private boolean mMajor = false;
1261
 
1262
		/**
1263
		 * in terms of the mChangeType Package field, when true indicates the
1264
		 * contract of the package has changed in a backwardly compatible manner
1265
		 * in terms of the mRippleField Package field, when true indicates the
1266
		 * minor version number will be incremented
1267
		 * 
1268
		 * @attribute
1269
		 */
1270
		private boolean mMinor = false;
1271
 
1272
		/**
1273
		 * in terms of the mChangeType Package field, when true indicates the
1274
		 * contract of the package has not changed, but the package has changed
1275
		 * internally in terms of the mRippleField Package field, when true
1276
		 * indicates the minor version number will be incremented
1277
		 * 
1278
		 * @attribute
1279
		 */
1280
		private boolean mPatch = false;
1281
 
1282
		/**
1283
		 * in terms of the mChangeType Package field, when true indicates the
1284
		 * package has not changed, its dependencies potentially have in terms
1285
		 * of the mRippleField Package field, when true indicates the build
1286
		 * number will be incremented
1287
		 * 
1288
		 * @attribute
1289
		 */
1290
		private boolean mBuild = true;
1291
 
1292
		/**
1293
		 * in terms of the mChangeType Package field, when true indicates the
1294
		 * major, minor, and patch number will be incremented according to field
1295
		 * limits in terms of the mRippleField Package field, when true indicates
1296
		 * the major, minor, patch and build number will be incremented
1297
		 * according to field limits
1298
		 * 
1299
		 * @attribute
1300
		 */
1301
		private boolean mLimit = false;
1302
 
1303
		/**
1304
		 * in terms of the mChangeType Package field, when true indicates the
1305
		 * package version number will not be rippled. The user will have fixed
1306
		 * the version number. This is only application to WIP packages
1307
		 * 
1308
		 * @attribute
1309
		 */
1310
		private boolean mFixed = false;
1311
 
1312
		/**
1313
		 * in terms of the mChangeType Package field, when true indicates the
1314
		 * method of rippling a package version number is not known.
1315
		 * 
1316
		 * @attribute
1317
		 */
1318
		private boolean mUnknown = false;
1319
 
1320
		/**
1321
		 * constructor
1322
		 */
1323
		private VersionNumberingStandard()
1324
		{
1325
			mLogger.debug("VersionNumberingStandard");
1326
		}
1327
 
1328
		/**
1329
		 * Reset all values to a known state
1330
		 * 
1331
		 */
1332
		void resetData()
1333
		{
1334
			mBuild = false;
1335
			mMajor = false;
1336
			mMinor = false;
1337
			mPatch = false;
1338
			mLimit = false;
1339
			mFixed = false;
1340
			mUnknown = false;
1341
		}
1342
 
1343
		/**
1344
		 * sets mBuild true, mMajor false, mMinor false, mPatch false, mLimit
1345
		 * false
1346
		 */
1347
		void setBuild()
1348
		{
1349
			mLogger.debug("setBuild");
1350
			resetData();
1351
			mBuild = true;
1352
		}
1353
 
1354
		/**
1355
		 * sets mBuild false, mMajor true, mMinor false, mPatch false, mLimit
1356
		 * false
1357
		 */
1358
		void setMajor()
1359
		{
1360
			mLogger.debug("setMajor");
1361
			resetData();
1362
			mMajor = true;
1363
		}
1364
 
1365
		/**
1366
		 * sets mBuild false, mMajor true, mMinor false, mPatch false, mLimit
1367
		 * limit
1368
		 */
1369
		void setMajor(boolean limit)
1370
		{
1371
			mLogger.debug("setMajor " + limit);
1372
			resetData();
1373
			mMajor = true;
1374
			mLimit = limit;
1375
		}
1376
 
1377
		/**
1378
		 * sets mBuild false, mMajor false, mMinor true, mPatch false, mLimit
1379
		 * false
1380
		 */
1381
		void setMinor()
1382
		{
1383
			mLogger.debug("setMinor");
1384
			resetData();
1385
			mMinor = true;
1386
		}
1387
 
1388
		/**
1389
		 * sets mBuild false, mMajor false, mMinor true, mPatch false, mLimit
1390
		 * limit
1391
		 */
1392
		void setMinor(boolean limit)
1393
		{
1394
			mLogger.debug("setMinor " + limit);
1395
			resetData();
1396
			mMinor = true;
1397
			mLimit = limit;
1398
		}
1399
 
1400
		/**
1401
		 * sets mBuild false, mMajor false, mMinor false, mPatch true, mLimit
1402
		 * false
1403
		 */
1404
		void setPatch()
1405
		{
1406
			mLogger.debug("setPatch");
1407
			resetData();
1408
			mPatch = true;
1409
		}
1410
 
1411
		/**
1412
		 * sets mBuild false, mMajor false, mMinor false, mPatch true, mLimit
1413
		 * limit
1414
		 */
1415
		void setPatch(boolean limit)
1416
		{
1417
			mLogger.debug("setPatch");
1418
			resetData();
1419
			mPatch = true;
1420
			mLimit = limit;
1421
		}
1422
 
1423
		/**
1424
		 * sets mBuild false, mMajor false, mMinor false, mPatch false, mLimit
1425
		 * true
1426
		 */
1427
		void setLimit()
1428
		{
1429
			mLogger.debug("setPatch");
1430
			resetData();
1431
			mLimit = true;
1432
		}
1433
 
1434
		/**
1435
		 * sets parameters to indicate that the change type is Fixed. The
1436
		 * version number is set by the user and a ripple will not be calculated
1437
		 */
1438
		void setFixed()
1439
		{
1440
			mLogger.debug("setFixed");
1441
			resetData();
1442
			mFixed = true;
1443
		}
1444
 
1445
		/**
1446
		 * Sets parameters to indicate that the change type is not known
1447
		 * 
1448
		 */
1449
		void setUnknown()
1450
		{
1451
			resetData();
1452
			mUnknown = true;
1453
		}
1454
 
1455
	}
1456
 
814 mhunt 1457
}