LISTSERV mailing list manager LISTSERV 16.5

Help for HPS-SVN Archives


HPS-SVN Archives

HPS-SVN Archives


HPS-SVN@LISTSERV.SLAC.STANFORD.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

HPS-SVN Home

HPS-SVN Home

HPS-SVN  October 2014

HPS-SVN October 2014

Subject:

r1313 - /java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/svt/SvtConditionsConverter.java

From:

[log in to unmask]

Reply-To:

Notification of commits to the hps svn repository <[log in to unmask]>

Date:

Mon, 27 Oct 2014 18:35:14 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (87 lines)

Author: omoreno
Date: Mon Oct 27 11:35:12 2014
New Revision: 1313

Log:
Obtain the SVT channels collection before retrieving anything else from the database, otherwise it causes the conditions converter to crash.

Modified:
    java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/svt/SvtConditionsConverter.java

Modified: java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/svt/SvtConditionsConverter.java
 =============================================================================
--- java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/svt/SvtConditionsConverter.java	(original)
+++ java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/svt/SvtConditionsConverter.java	Mon Oct 27 11:35:12 2014
@@ -1,12 +1,9 @@
 package org.hps.conditions.svt;
 
-import static org.hps.conditions.TableConstants.SVT_DAQ_MAP;
-
+import org.lcsim.conditions.ConditionsManager;
 import org.hps.conditions.DatabaseConditionsManager;
-import org.hps.conditions.TableMetaData;
+import org.hps.conditions.svt.SvtChannel.SvtChannelCollection;
 import org.hps.conditions.svt.SvtDaqMapping.SvtDaqMappingCollection;
-
-import org.lcsim.conditions.ConditionsManager;
 
 /**
  * This class creates an {@link SvtConditions} object from the database, based on the
@@ -17,34 +14,32 @@
  */
 public final class SvtConditionsConverter extends AbstractSvtConditionsConverter<SvtConditions> {
 
-	private TableMetaData metaData = null; 
-	private String tableName = null; 
-
 	public SvtConditionsConverter(){
 		this.conditions = new SvtConditions();
 	}
 	
     /**
-     * Create and return the SVT conditions object.
+     * Create and return an {@link SvtConditions} object 
+     * 
      * @param manager The current conditions manager.
      * @param name The conditions key, which is ignored for now.
      */
+    @Override
     public SvtConditions getData(ConditionsManager manager, String name) {
-    	conditions = super.getData(manager, name);
     	
     	DatabaseConditionsManager dbConditionsManager = (DatabaseConditionsManager) manager;
-    	
-    	// Get the table name containing the SVT DAQ map from the database
-        // configuration.  If it doesn't exist, use the default value.
-        metaData = dbConditionsManager.findTableMetaData(SvtDaqMappingCollection.class);
-    	if(metaData != null){
-    		tableName = metaData.getTableName();
-    	} else { 
-    		tableName = SVT_DAQ_MAP; 
-    	}
-        // Get the DAQ map from the conditions database
-        SvtDaqMappingCollection daqMap = manager.getCachedConditions(SvtDaqMappingCollection.class, tableName).getCachedData();
+
+    	// Get the channel map from the conditions database
+        SvtChannelCollection channels = this.getCollection(SvtChannelCollection.class, dbConditionsManager); 
+
+        // Create the SVT conditions object to use to encapsulate SVT condition collections
+        conditions.setChannelMap(channels);
+       
+    	// Get the DAQ map from the conditions database
+    	SvtDaqMappingCollection daqMap= this.getCollection(SvtDaqMappingCollection.class, dbConditionsManager);
         conditions.setDaqMap(daqMap);
+        
+        conditions = super.getData(manager, name);
         
         return conditions;
     }
@@ -53,6 +48,7 @@
      * Get the type handled by this converter.
      * @return The type handled by this converter.
      */
+    @Override
     public Class<SvtConditions> getType() {
         return SvtConditions.class;
     }

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

November 2017
August 2017
July 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013

ATOM RSS1 RSS2



LISTSERV.SLAC.STANFORD.EDU

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager

Privacy Notice, Security Notice and Terms of Use