Author: [log in to unmask]
Date: Tue Nov 18 11:41:44 2014
New Revision: 1564
Log:
Add preliminary support for setting a tag to use. (This might need more work.)
Modified:
java/trunk/conditions/src/main/java/org/hps/conditions/database/DatabaseConditionsManager.java
Modified: java/trunk/conditions/src/main/java/org/hps/conditions/database/DatabaseConditionsManager.java
=============================================================================
--- java/trunk/conditions/src/main/java/org/hps/conditions/database/DatabaseConditionsManager.java (original)
+++ java/trunk/conditions/src/main/java/org/hps/conditions/database/DatabaseConditionsManager.java Tue Nov 18 11:41:44 2014
@@ -80,6 +80,7 @@
protected EcalDetectorSetup ecalLoader = new EcalDetectorSetup();
protected TestRunSvtDetectorSetup testRunSvtloader = new TestRunSvtDetectorSetup();
protected SvtDetectorSetup svtLoader = new SvtDetectorSetup();
+ protected String tag = null;
/**
* Default connection parameters which will use the SLAC database by default,
@@ -544,7 +545,11 @@
ConditionsRecordCollection foundConditionsRecords = new ConditionsRecordCollection();
for (ConditionsRecord record : runConditionsRecords.getObjects()) {
if (record.getName().equals(name)) {
- foundConditionsRecords.add(record);
+ if (tag == null || (tag != null && record.getTag().equals(tag))) {
+ foundConditionsRecords.add(record);
+ } else {
+ logger.info("rejected ConditionsRecord " + record.getRowId() + " because of non-matching tag " + record.getTag());
+ }
}
}
if (foundConditionsRecords.getObjects().size() > 0) {
@@ -578,6 +583,10 @@
public void setSvtName(String svtName) {
this.svtName = svtName;
+ }
+
+ public void setTag(String tag) {
+ this.tag = tag;
}
private void setupEcal() {
|