Search in sources :

Example 26 with RemoteProxyException

use of cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException in project vcell by virtualcell.

the class ClientDocumentManager method delete.

/**
 * Insert the method's description here.
 * Creation date: (11/28/00 5:43:44 PM)
 * @param bioModelInfo cbit.vcell.biomodel.BioModelInfo
 */
public void delete(GeometryInfo geometryInfo) throws DataAccessException {
    try {
        // 
        // delete from database
        // 
        sessionManager.getUserMetaDbServer().deleteGeometry(geometryInfo.getVersion().getVersionKey());
        // 
        // delete Geometry from cache and GeometryInfo from geometryInfo list
        // 
        xmlHash.remove(geometryInfo.getVersion().getVersionKey());
        geoInfoHash.remove(geometryInfo.getVersion().getVersionKey());
        fireDatabaseDelete(new DatabaseEvent(this, DatabaseEvent.DELETE, geometryInfo, null));
    } catch (RemoteProxyException e) {
        handleRemoteProxyException(e);
        throw new DataAccessException(e.getMessage());
    }
}
Also used : DataAccessException(org.vcell.util.DataAccessException) RemoteProxyException(cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException)

Example 27 with RemoteProxyException

use of cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException in project vcell by virtualcell.

the class ClientDocumentManager method setGroupPrivate.

/**
 * Insert the method's description here.
 * Creation date: (11/28/00 5:43:44 PM)
 * @param bioModelInfo cbit.vcell.biomodel.BioModelInfo
 */
public BioModelInfo setGroupPrivate(BioModelInfo bioModelInfo) throws DataAccessException {
    try {
        // 
        // unpublish from database
        // 
        BioModelInfo newBioModelInfo = (BioModelInfo) setGroupPrivate0(bioModelInfo, VersionableType.BioModelMetaData, bioModelInfoHash);
        // 
        // delete BioModelMetaData from cache
        // 
        xmlHash.remove(bioModelInfo.getVersion().getVersionKey());
        fireDatabaseUpdate(new DatabaseEvent(this, DatabaseEvent.UPDATE, bioModelInfo, newBioModelInfo));
        return newBioModelInfo;
    } catch (RemoteProxyException e) {
        handleRemoteProxyException(e);
        throw new DataAccessException(e.getMessage());
    }
}
Also used : BioModelInfo(org.vcell.util.document.BioModelInfo) DataAccessException(org.vcell.util.DataAccessException) RemoteProxyException(cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException)

Example 28 with RemoteProxyException

use of cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException in project vcell by virtualcell.

the class ClientDocumentManager method delete.

/**
 * Insert the method's description here.
 * Creation date: (3/26/2001 11:26:16 PM)
 * @param bioModelInfo cbit.vcell.mathmodel.MathModelInfo
 */
public void delete(MathModelInfo mathModelInfo) throws DataAccessException {
    try {
        // MathModelMetaData mathModelMetaData = getMathModelMetaData(mathModelInfo);
        // 
        // delete from database
        // 
        sessionManager.getUserMetaDbServer().deleteMathModel(mathModelInfo.getVersion().getVersionKey());
        // 
        // delete MathModel from cache and MathModelInfo from mathModelInfo list
        // 
        xmlHash.remove(mathModelInfo.getVersion().getVersionKey());
        mathModelInfoHash.remove(mathModelInfo.getVersion().getVersionKey());
        fireDatabaseDelete(new DatabaseEvent(this, DatabaseEvent.DELETE, mathModelInfo, null));
    // //
    // // go through list of Simulations in the MathModelMetaData and remove unreferenced Simulations
    // //
    // Enumeration enumSim = mathModelMetaData.getSimulationInfos();
    // while (enumSim.hasMoreElements()){
    // SimulationInfo simInfo = (SimulationInfo)enumSim.nextElement();
    // if (isSimulationReferenced(simInfo)==false){
    // simInfoHash.remove(simInfo.getVersion().getVersionKey());
    // resultSetInfoHash.remove(simInfo.getVersion().getVersionKey());
    // fireDatabaseDelete(new DatabaseEvent(this, DatabaseEvent.DELETE, simInfo, null));
    // }
    // }
    } catch (RemoteProxyException e) {
        handleRemoteProxyException(e);
        throw new DataAccessException(e.getMessage());
    }
}
Also used : DataAccessException(org.vcell.util.DataAccessException) RemoteProxyException(cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException)

Example 29 with RemoteProxyException

use of cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException in project vcell by virtualcell.

the class ClientDocumentManager method getReactionStepAsModel.

/**
 * Insert the method's description here.
 * Creation date: (8/25/2003 5:10:41 PM)
 */
public Model getReactionStepAsModel(KeyValue reactionStepKey) throws DataAccessException {
    try {
        Model reactionModel = sessionManager.getUserMetaDbServer().getReactionStepAsModel(reactionStepKey);
        if (reactionModel != null) {
            try {
                reactionModel = (Model) BeanUtils.cloneSerializable(reactionModel);
                reactionModel.refreshDependencies();
            } catch (Exception e) {
                e.printStackTrace(System.out);
                throw new DataAccessException(e.getMessage());
            }
        }
        return reactionModel;
    } catch (RemoteProxyException e) {
        e.printStackTrace(System.out);
        throw new DataAccessException(e.getMessage());
    }
}
Also used : MathModel(cbit.vcell.mathmodel.MathModel) Model(cbit.vcell.model.Model) BioModel(cbit.vcell.biomodel.BioModel) PermissionException(org.vcell.util.PermissionException) ObjectNotFoundException(org.vcell.util.ObjectNotFoundException) XmlParseException(cbit.vcell.xml.XmlParseException) RemoteProxyException(cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException) DataAccessException(org.vcell.util.DataAccessException) ExpressionException(cbit.vcell.parser.ExpressionException) MathException(cbit.vcell.math.MathException) DataAccessException(org.vcell.util.DataAccessException) RemoteProxyException(cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException)

Example 30 with RemoteProxyException

use of cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException in project vcell by virtualcell.

the class ClientDocumentManager method save.

/**
 * Insert the method's description here.
 * Creation date: (10/28/00 12:08:30 AM)
 */
public BioModel save(BioModel bioModel, String[] independentSims) throws DataAccessException {
    try {
        String bioModelXML = null;
        try {
            bioModel.getVCMetaData().cleanupMetadata();
            bioModelXML = XmlHelper.bioModelToXML(bioModel);
        } catch (XmlParseException e) {
            e.printStackTrace(System.out);
            throw new DataAccessException(e.getMessage());
        }
        String savedBioModelXML = sessionManager.getUserMetaDbServer().saveBioModel(new BigString(bioModelXML), independentSims).toString();
        BioModel savedBioModel = getBioModelFromDatabaseXML(new XMLHolder<BioModel>(savedBioModelXML));
        KeyValue savedKey = savedBioModel.getVersion().getVersionKey();
        if (xmlHash.get(savedKey) == null) {
            xmlHash.put(savedKey, savedBioModelXML);
        }
        BioModelInfo savedBioModelInfo = new BioModelInfo(savedBioModel.getVersion(), savedBioModel.getModel().getKey(), savedBioModel.createBioModelChildSummary(), VCellSoftwareVersion.fromSystemProperty());
        bioModelInfoHash.put(savedKey, savedBioModelInfo);
        SimulationContext[] scArr = savedBioModel.getSimulationContexts();
        for (int i = 0; i < scArr.length; i++) {
            updateGeometryRelatedHashes(scArr[i].getGeometry());
        }
        // copy some transient info from the old model to the new one
        for (SimulationContext newsc : scArr) {
            SimulationContext oldsc = bioModel.getSimulationContext(newsc.getName());
            newsc.getTaskCallbackProcessor().initialize((oldsc.getTaskCallbackProcessor()));
            newsc.setMostRecentlyCreatedOutputSpec(oldsc.getMostRecentlyCreatedOutputSpec());
            newsc.setMd5hash(oldsc.getMd5hash());
        }
        fireDatabaseInsert(new DatabaseEvent(this, DatabaseEvent.INSERT, null, savedBioModelInfo));
        return savedBioModel;
    } catch (RemoteProxyException e) {
        e.printStackTrace(System.out);
        throw new DataAccessException(VCellErrorMessages.FAIL_SAVE_MESSAGE + "\n\n" + e.getMessage());
    }
}
Also used : KeyValue(org.vcell.util.document.KeyValue) BioModelInfo(org.vcell.util.document.BioModelInfo) BigString(org.vcell.util.BigString) XmlParseException(cbit.vcell.xml.XmlParseException) SimulationContext(cbit.vcell.mapping.SimulationContext) BigString(org.vcell.util.BigString) BioModel(cbit.vcell.biomodel.BioModel) DataAccessException(org.vcell.util.DataAccessException) RemoteProxyException(cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException)

Aggregations

RemoteProxyException (cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException)39 DataAccessException (org.vcell.util.DataAccessException)38 XmlParseException (cbit.vcell.xml.XmlParseException)9 BigString (org.vcell.util.BigString)8 KeyValue (org.vcell.util.document.KeyValue)8 BioModelInfo (org.vcell.util.document.BioModelInfo)7 MathModelInfo (org.vcell.util.document.MathModelInfo)7 VCImageInfo (cbit.image.VCImageInfo)6 GeometryInfo (cbit.vcell.geometry.GeometryInfo)5 BioModel (cbit.vcell.biomodel.BioModel)3 MathException (cbit.vcell.math.MathException)3 MathModel (cbit.vcell.mathmodel.MathModel)3 ExpressionException (cbit.vcell.parser.ExpressionException)3 ObjectNotFoundException (org.vcell.util.ObjectNotFoundException)3 PermissionException (org.vcell.util.PermissionException)3 GIFImage (cbit.image.GIFImage)2 VCImage (cbit.image.VCImage)2 Geometry (cbit.vcell.geometry.Geometry)2 SimulationContext (cbit.vcell.mapping.SimulationContext)2 SimulationStatus (cbit.vcell.server.SimulationStatus)2