try
{
validateInput(INPUT_METADATA_STRING);
// validateInput(INPUT_STEPBACK);
Dataset ds = new JSONDeserializer<Dataset>().deserialize(URLDecoder.decode((String) iterationData[0],"UTF-8"));
LOG.debug("CREATING METADATA PREPRO "+ds.getInstanceId());
ds.setStepbackId((String)iterationData[2]);
ds.setDatasetId(ds.getDatasetId()+UUID.randomUUID());
try{
ds.setUri((String) iterationData[1]);
}catch (Exception e)
{
}
String expression=getInsertDatasetExpression(ds);
this.executeInsert(expression);
if(ds.getTraceList()!=null && ds.getTraceList().size()>0)
{
String traceExpression="INSERT INTO trace (Station,Network,Channel,StartTime,EndTime,Samples,Frequency,DatasetID,TraceID) VALUES";
traceExpression=traceExpression+getInsertTraceExpression(ds, 0);
for (int j=1; j<ds.getTraceList().size();j++)
{
traceExpression=","+traceExpression+getInsertTraceExpression(ds, j);
}
traceExpression=traceExpression+";";
this.executeInsert(traceExpression);
}
mOutputBlockWriterDatasetId = getOutput(OUTPUT_ID);
if(mOutputBlockWriterDatasetId!=null){
LOG.debug("Producing Id "+ds.getDatasetId()+" for "+ds.getInstanceId());
mOutputBlockWriterDatasetId.write(ds.getDatasetId());
}
mOutputBlockWriterDatasetMetadata = getOutput(OUTPUT_METADATA);
if(mOutputBlockWriterDatasetMetadata!=null)
{
JSONSerializer serializer = new JSONSerializer();
mOutputBlockWriterDatasetMetadata.write(URLEncoder.encode(serializer.include("traceList").serialize(ds),"UTF-8"));
}
LOG.debug("CREATED METADATA PREPRO "+ds.getInstanceId());
}
catch (SQLException e)
{