Search in sources :

Example 36 with RemoteProxyException

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

the class ClientDocumentManager method reloadBioModelInfos.

/**
 * Insert the method's description here.
 * Creation date: (11/14/00 5:33:21 PM)
 * @return cbit.vcell.biomodel.BioModelInfo[]
 */
private void reloadBioModelInfos() throws DataAccessException {
    try {
        System.out.println("ClientDocumentManager.reloadBioModelInfos()");
        BioModelInfo[] bioModelInfos = sessionManager.getUserMetaDbServer().getBioModelInfos(true);
        if (bioModelInfos != null) {
            bioModelInfoHash.clear();
            for (int i = 0; i < bioModelInfos.length; i++) {
                bioModelInfoHash.put(bioModelInfos[i].getVersion().getVersionKey(), bioModelInfos[i]);
            }
        }
    } catch (RemoteProxyException e) {
        handleRemoteProxyException(e);
        throw new DataAccessException("RemoteProxyException: " + 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 37 with RemoteProxyException

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

the class ClientDocumentManager method saveAsNew.

/**
 * Insert the method's description here.
 * Creation date: (1/19/01 11:27:52 AM)
 */
public Geometry saveAsNew(Geometry geometry, java.lang.String newName) throws DataAccessException {
    try {
        String geometryXML = null;
        try {
            geometryXML = XmlHelper.geometryToXML(geometry);
        } catch (XmlParseException e) {
            e.printStackTrace(System.out);
            throw new DataAccessException(e.getMessage());
        }
        if (isChanged(geometry, geometryXML) == false) {
            System.out.println("<<<<<WARNING>>>>>>>ClientDocumentManger.save(Geometry), called on unchanged geometry");
            return geometry;
        }
        String savedGeometryXML = sessionManager.getUserMetaDbServer().saveGeometryAs(new BigString(geometryXML), newName).toString();
        Geometry savedGeometry = getGeometryFromDatabaseXML(savedGeometryXML);
        KeyValue savedKey = savedGeometry.getVersion().getVersionKey();
        if (xmlHash.get(savedKey) == null) {
            xmlHash.put(savedKey, savedGeometryXML);
        }
        updateGeometryRelatedHashes(savedGeometry);
        return savedGeometry;
    } catch (RemoteProxyException e) {
        e.printStackTrace(System.out);
        throw new DataAccessException(VCellErrorMessages.FAIL_SAVE_MESSAGE + "\n\n" + e.getMessage());
    }
}
Also used : Geometry(cbit.vcell.geometry.Geometry) KeyValue(org.vcell.util.document.KeyValue) BigString(org.vcell.util.BigString) XmlParseException(cbit.vcell.xml.XmlParseException) BigString(org.vcell.util.BigString) DataAccessException(org.vcell.util.DataAccessException) RemoteProxyException(cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException)

Example 38 with RemoteProxyException

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

the class ClientDocumentManager method preloadSimulationStatus.

/**
 * Insert the method's description here.
 * Creation date: (9/1/2004 12:33:16 PM)
 * @param simKeys cbit.sql.KeyValue[]
 */
private void preloadSimulationStatus(KeyValue[] simKeys) {
    boolean bNeedRefreshStatus = false;
    for (int i = 0; i < simKeys.length; i++) {
        if (!simulationStatusHash.containsKey(simKeys[i])) {
            bNeedRefreshStatus = true;
        }
    }
    if (bNeedRefreshStatus) {
        try {
            SimulationStatus[] simulationStatusArray = null;
            try {
                simulationStatusArray = sessionManager.getSimulationController().getSimulationStatus(simKeys);
            } catch (RemoteProxyException e) {
                handleRemoteProxyException(e);
                try {
                    simulationStatusArray = sessionManager.getSimulationController().getSimulationStatus(simKeys);
                } catch (RemoteProxyException e2) {
                    handleRemoteProxyException(e2);
                }
            }
            for (int i = 0; i < simKeys.length; i++) {
                SimulationStatus simulationStatus = null;
                for (int j = 0; simulationStatusArray != null && j < simulationStatusArray.length; j++) {
                    // these are server-supplied statuses, jobStatus array is not null
                    if (simulationStatusArray[j] != null && simulationStatusArray[j].getVCSimulationIdentifier().getSimulationKey().equals(simKeys[i])) {
                        simulationStatus = simulationStatusArray[j];
                    }
                }
                simulationStatusHash.put(simKeys[i], simulationStatus);
            }
        } catch (DataAccessException e) {
            e.printStackTrace(System.out);
        }
    }
}
Also used : SimulationStatus(cbit.vcell.server.SimulationStatus) DataAccessException(org.vcell.util.DataAccessException) RemoteProxyException(cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException)

Example 39 with RemoteProxyException

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

the class RemoteProxyVCellConnectionFactoryTest method test.

@Test
public void test() throws IOException {
    BiomodelRepresentation[] biomodelReps = apiClient.getBioModels(new BioModelsQuerySpec());
    assertNotNull(biomodelReps);
    VCInfoContainer vcInfoContainer = null;
    try {
        vcInfoContainer = vcConn.getUserMetaDbServer().getVCInfoContainer();
    } catch (DataAccessException | RemoteProxyException e) {
        e.printStackTrace();
        fail("exception");
    }
    assertNotNull(vcInfoContainer);
}
Also used : BiomodelRepresentation(org.vcell.api.common.BiomodelRepresentation) VCInfoContainer(org.vcell.util.document.VCInfoContainer) BioModelsQuerySpec(org.vcell.api.client.query.BioModelsQuerySpec) DataAccessException(org.vcell.util.DataAccessException) RemoteProxyException(cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException) Test(org.junit.Test)

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