Search in sources :

Example 66 with DataAccessException

use of org.vcell.util.DataAccessException 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 67 with DataAccessException

use of org.vcell.util.DataAccessException in project vcell by virtualcell.

the class DataSetControllerImpl method getEmptyVtuMeshFiles.

public VtuFileContainer getEmptyVtuMeshFiles(ComsolSimFiles comsolSimFiles, VCDataIdentifier vcdataID, int timeIndex) throws DataAccessException {
    try {
        if (timeIndex > 0) {
            throw new RuntimeException("only time index 0 supported for comsol vtk mesh files");
        }
        ComsolVtkFileWriter comsolVTKFileWriter = new ComsolVtkFileWriter();
        File primaryDirectory = getPrimaryUserDir(vcdataID.getOwner(), false);
        VtuFileContainer vtuFiles = comsolVTKFileWriter.getEmptyVtuMeshFiles(comsolSimFiles, primaryDirectory);
        return vtuFiles;
    } catch (Exception e) {
        lg.error(e.getMessage(), e);
        throw new DataAccessException("failed to retrieve VTK files: " + e.getMessage(), e);
    }
}
Also used : ComsolVtkFileWriter(org.vcell.vis.mapping.comsol.ComsolVtkFileWriter) VtuFileContainer(org.vcell.vis.io.VtuFileContainer) 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 68 with DataAccessException

use of org.vcell.util.DataAccessException in project vcell by virtualcell.

the class DataSetControllerImpl method getFunction.

public AnnotatedFunction getFunction(OutputContext outputContext, VCDataIdentifier vcdID, String variableName) throws DataAccessException {
    try {
        VCData vcData = getVCData(vcdID);
        AnnotatedFunction annotatedFunction = vcData.getFunction(outputContext, variableName);
        checkFieldDataExists(annotatedFunction, vcdID.getOwner());
        return annotatedFunction;
    } catch (IOException e) {
        lg.error(e.getMessage(), e);
        throw new DataAccessException(e.getMessage());
    }
}
Also used : IOException(java.io.IOException) DataAccessException(org.vcell.util.DataAccessException) AnnotatedFunction(cbit.vcell.solver.AnnotatedFunction)

Example 69 with DataAccessException

use of org.vcell.util.DataAccessException in project vcell by virtualcell.

the class DataSetControllerImpl method getVtuMeshData.

public double[] getVtuMeshData(ChomboFiles chomboFiles, OutputContext outputContext, VCDataIdentifier vcdataID, VtuVarInfo var, double time) throws DataAccessException {
    try {
        double[] times = getDataSetTimes(vcdataID);
        int timeIndex = -1;
        for (int i = 0; i < times.length; i++) {
            if (times[i] == time) {
                timeIndex = i;
                break;
            }
        }
        if (timeIndex < 0) {
            throw new DataAccessException("data for dataset " + vcdataID + " not found at time " + time);
        }
        ChomboVtkFileWriter chomboVTKFileWriter = new ChomboVtkFileWriter();
        double[] vtuData = chomboVTKFileWriter.getVtuMeshData(chomboFiles, outputContext, getUserDataDirectory(vcdataID), time, var, timeIndex);
        return vtuData;
    } catch (Exception e) {
        lg.error(e.getMessage(), e);
        throw new DataAccessException("failed to retrieve VTK files: " + e.getMessage(), e);
    }
}
Also used : ChomboVtkFileWriter(org.vcell.vis.mapping.chombo.ChomboVtkFileWriter) DataAccessException(org.vcell.util.DataAccessException) 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)

Example 70 with DataAccessException

use of org.vcell.util.DataAccessException in project vcell by virtualcell.

the class DataSetControllerImpl method getVtuMeshData.

public double[] getVtuMeshData(ComsolSimFiles comsolSimFiles, OutputContext outputContext, VCDataIdentifier vcdataID, VtuVarInfo var, double time) throws DataAccessException {
    try {
        double[] times = getVtuTimes(comsolSimFiles, vcdataID);
        int timeIndex = -1;
        for (int i = 0; i < times.length; i++) {
            if (times[i] == time) {
                timeIndex = i;
                break;
            }
        }
        if (timeIndex < 0) {
            throw new DataAccessException("data for dataset " + vcdataID + " not found at time " + time);
        }
        ComsolVtkFileWriter comsolVTKFileWriter = new ComsolVtkFileWriter();
        double[] vtuData = comsolVTKFileWriter.getVtuMeshData(comsolSimFiles, outputContext, getUserDataDirectory(vcdataID), time, var, timeIndex);
        return vtuData;
    } catch (Exception e) {
        lg.error(e.getMessage(), e);
        throw new DataAccessException("failed to retrieve VTK files: " + e.getMessage(), e);
    }
}
Also used : ComsolVtkFileWriter(org.vcell.vis.mapping.comsol.ComsolVtkFileWriter) DataAccessException(org.vcell.util.DataAccessException) 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)

Aggregations

DataAccessException (org.vcell.util.DataAccessException)345 KeyValue (org.vcell.util.document.KeyValue)82 XmlParseException (cbit.vcell.xml.XmlParseException)80 ExpressionException (cbit.vcell.parser.ExpressionException)78 ObjectNotFoundException (org.vcell.util.ObjectNotFoundException)71 SQLException (java.sql.SQLException)67 IOException (java.io.IOException)60 MathException (cbit.vcell.math.MathException)59 RemoteProxyException (cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException)46 BigString (org.vcell.util.BigString)45 User (org.vcell.util.document.User)42 FileNotFoundException (java.io.FileNotFoundException)38 ResultSet (java.sql.ResultSet)38 PropertyVetoException (java.beans.PropertyVetoException)37 File (java.io.File)34 PermissionException (org.vcell.util.PermissionException)34 Statement (java.sql.Statement)33 ExpressionBindingException (cbit.vcell.parser.ExpressionBindingException)32 BioModelInfo (org.vcell.util.document.BioModelInfo)29 Vector (java.util.Vector)26