/---------------------------------------------------------------/
/* STANFORD UNIVERSITY NOTICES FOR SLAC SOFTWARE */
/* ON WHICH COPYRIGHT IS DISCLAIMED */
/* */
/* AUTHORSHIP */
/* This software was created by Yee-Ting Li, Stanford Linear */
/* Accelerator Center, Stanford University. */
/* */
/* ACKNOWLEDGEMENT OF SPONSORSHIP */
/* This software was produced by the Stanford Linear Accelerator */
/* Center, Stanford University, under Contract DE-AC03-76SFO0515 */
/* with the Department of Energy. */
/* */
/* GOVERNMENT DISCLAIMER OF LIABILITY */
/* Neither the United States nor the United States Department of */
/* Energy, nor any of their employees, makes any warranty, */
/* express or implied, or assumes any legal liability or */
/* responsibility for the accuracy, completeness, or usefulness */
/* of any data, apparatus, product, or process disclosed, or */
/* represents that its use would not infringe privately owned */
/* rights. */
/* */
/* STANFORD DISCLAIMER OF LIABILITY */
/* Stanford University makes no representations or warranties, */
/* express or implied, nor assumes any liability for the use of */
/* this software. */
/* */
/* STANFORD DISCLAIMER OF COPYRIGHT */
/* Stanford University, owner of the copyright, hereby disclaims */
/* its copyright and all other rights in this software. Hence, */
/* anyone may freely use it for any purpose without restriction. */
/* */
/* */
/* MAINTENANCE OF NOTICES */
/* In the interest of clarity regarding the origin and status of */
/* this SLAC software, this and all the preceding Stanford */
/* University notices are to remain affixed to any copy or */
/* derivative of this software made or distributed by the */
/* recipient and are to be affixed to any copy of software made */
/* or distributed by the recipient that contains a copy or */
/* derivative of this software. */
/* */
/* SLAC Software Notices, Set 4 (OTT.002a, 2004 FEB 03) */
/---------------------------------------------------------------/
/* TracerouteResponseGenerator.java
*
* Created on January 2, 2007, 1:49 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package org.perfsonar.service.measurementArchive.sqlType.fetch;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Date;
import org.ggf.ns.nmwg.base.v2_0.Data;
import org.ggf.ns.nmwg.tools.traceroute.v2_0.Datum;
import org.perfsonar.commons.auxiliary.AuxiliaryComponentManager;
import org.perfsonar.commons.auxiliary.ComponentNames;
import org.perfsonar.commons.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.service.commons.exceptions.SystemException;
/**
*
* @author Mohammad Asif
* Created on January 2, 2007, 1:49 PM
*/
public class TracerouteResponseGenerator extends ResponseGenerator {
/** Creates a new instance of TracerouteResponseGenerator */
public TracerouteResponseGenerator() throws SystemException
public Data getResponse(List resultList) throws Exception {
Data data = new Data();
for (int i = 0; i < resultList.size(); i++) {
Datum datum = new Datum();
Map resultMap = (Map) resultList.get;
Collection<String> kCollection = ((Map)resultList.get).keySet();
for (String column : kCollection) {
Object value = resultMap.get(column);
String className = value.getClass().getName();
String strValue = null;
if (className.equals("java.lang.Float"))
strValue = Float.toString((Float) value);
if (className.equals("java.lang.Double"))
strValue = Double.toString((Double) value);
else if (className.equals("java.lang.Integer"))
strValue = Integer.toString((Integer) value);
else if (className.equals("java.lang.Long"))
strValue = Long.toString((Long) value);
else if (className.equals("java.lang.Date"))
strValue = ((Date) value).toString();
else if (className.equals("java.lang.String"))
strValue = (String) value;
if (strValue != null)
}
data.addChild(datum);
}
return data;
}
public static void main (String [] arg )
}