Search in sources :

Example 1 with VCDataJobID

use of org.vcell.util.document.VCDataJobID in project vcell by virtualcell.

the class DataSetControllerImpl method doDataOperation.

public DataOperationResults doDataOperation(DataOperation dataOperation) throws DataAccessException {
    VCDataJobID vcDataJobID = null;
    try {
        if (dataOperation instanceof DataOperation.DataProcessingOutputTimeSeriesOP) {
            vcDataJobID = ((DataOperation.DataProcessingOutputTimeSeriesOP) dataOperation).getTimeSeriesJobSpec().getVcDataJobID();
        }
        if (!(getVCData(dataOperation.getVCDataIdentifier()) instanceof SimulationData)) {
            return null;
        }
        File dataProcessingOutputFileHDF5 = ((SimulationData) getVCData(dataOperation.getVCDataIdentifier())).getDataProcessingOutputSourceFileHDF5();
        DataOperationResults dataOperationResults = getDataProcessingOutput(dataOperation, dataProcessingOutputFileHDF5);
        if (vcDataJobID != null) {
            fireDataJobEventIfNecessary(vcDataJobID, MessageEvent.DATA_COMPLETE, dataOperation.getVCDataIdentifier(), new Double(0), ((DataOperationResults.DataProcessingOutputTimeSeriesValues) dataOperationResults).getTimeSeriesJobResults(), null);
        }
        return dataOperationResults;
    } catch (Exception e) {
        if (vcDataJobID != null) {
            fireDataJobEventIfNecessary(vcDataJobID, MessageEvent.DATA_FAILURE, dataOperation.getVCDataIdentifier(), new Double(0), null, e);
        }
        if (e instanceof DataAccessException) {
            throw (DataAccessException) e;
        } else {
            throw new DataAccessException("Datasetcontrollerimpl.doDataOperation error: " + e.getMessage(), e);
        }
    }
}
Also used : DataProcessingOutputTimeSeriesOP(cbit.vcell.simdata.DataOperation.DataProcessingOutputTimeSeriesOP) VCDataJobID(org.vcell.util.document.VCDataJobID) ZipFile(org.apache.commons.compress.archivers.zip.ZipFile) File(java.io.File) ObjectNotFoundException(org.vcell.util.ObjectNotFoundException) XmlParseException(cbit.vcell.xml.XmlParseException) IOException(java.io.IOException) DataAccessException(org.vcell.util.DataAccessException) DivideByZeroException(cbit.vcell.parser.DivideByZeroException) CacheException(org.vcell.util.CacheException) ExpressionBindingException(cbit.vcell.parser.ExpressionBindingException) FileNotFoundException(java.io.FileNotFoundException) ExpressionException(cbit.vcell.parser.ExpressionException) MathException(cbit.vcell.math.MathException) DataAccessException(org.vcell.util.DataAccessException)

Example 2 with VCDataJobID

use of org.vcell.util.document.VCDataJobID in project vcell by virtualcell.

the class DataJobEvent method fromJsonRep.

public static DataJobEvent fromJsonRep(Object eventSource, DataJobEventRepresentation eventRep) {
    Double progress = eventRep.progress;
    User owner = new User(eventRep.username, new KeyValue(eventRep.userkey));
    VCDataJobID dataJobID = new VCDataJobID(eventRep.jobid, owner, eventRep.isBackgroundTask);
    int eventType = eventRep.eventType;
    KeyValue dataKey = new KeyValue(eventRep.dataKey);
    String dataIdString = eventRep.dataIdString;
    DataJobEvent dataJobEvent = new DataJobEvent(dataJobID, eventType, dataKey, dataIdString, progress);
    return dataJobEvent;
}
Also used : User(org.vcell.util.document.User) KeyValue(org.vcell.util.document.KeyValue) VCDataJobID(org.vcell.util.document.VCDataJobID)

Aggregations

VCDataJobID (org.vcell.util.document.VCDataJobID)2 MathException (cbit.vcell.math.MathException)1 DivideByZeroException (cbit.vcell.parser.DivideByZeroException)1 ExpressionBindingException (cbit.vcell.parser.ExpressionBindingException)1 ExpressionException (cbit.vcell.parser.ExpressionException)1 DataProcessingOutputTimeSeriesOP (cbit.vcell.simdata.DataOperation.DataProcessingOutputTimeSeriesOP)1 XmlParseException (cbit.vcell.xml.XmlParseException)1 File (java.io.File)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 ZipFile (org.apache.commons.compress.archivers.zip.ZipFile)1 CacheException (org.vcell.util.CacheException)1 DataAccessException (org.vcell.util.DataAccessException)1 ObjectNotFoundException (org.vcell.util.ObjectNotFoundException)1 KeyValue (org.vcell.util.document.KeyValue)1 User (org.vcell.util.document.User)1