Search in sources :

Example 6 with RemoteProxyException

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

the class ClientDocumentManager method initAllDatabaseInfos.

/**
 * Insert the method's description here.
 * Creation date: (9/25/2003 7:45:19 AM)
 * @return cbit.vcell.modeldb.VCInfoContainer
 */
public synchronized void initAllDatabaseInfos() throws DataAccessException {
    clear();
    VCInfoContainer vcInfoContainer = null;
    try {
        System.out.println("ClientDocumentManager.initAllDatabaseInfos()");
        long time1 = System.currentTimeMillis();
        // 
        // gets BioModelMetaDatas, MathModelMetaDatas, all VersionInfos, and ResultSetInfos
        // 
        vcInfoContainer = sessionManager.getUserMetaDbServer().getVCInfoContainer();
        PerformanceMonitorEvent pme = new PerformanceMonitorEvent(this, getUser(), new PerformanceData("ClientDocumentManager.initAllDatabaseInfos()", MessageEvent.LOGON_STAT, new PerformanceDataEntry[] { new PerformanceDataEntry("remote call duration", Double.toString(((double) System.currentTimeMillis() - time1) / 1000.0)) }));
    } catch (RemoteProxyException e) {
        handleRemoteProxyException(e);
        throw new DataAccessException("RemoteProxyException: " + e.getMessage());
    }
    // 
    // BioModelInfos
    // 
    {
        bioModelInfoHash.clear();
        BioModelInfo[] bioModelInfos = vcInfoContainer.getBioModelInfos();
        if (bioModelInfos != null) {
            for (int i = 0; i < bioModelInfos.length; i++) {
                bioModelInfoHash.put(bioModelInfos[i].getVersion().getVersionKey(), bioModelInfos[i]);
            }
        }
    }
    // 
    // Geometries
    // 
    {
        geoInfoHash.clear();
        GeometryInfo[] geometryInfos = vcInfoContainer.getGeometryInfos();
        if (geometryInfos != null) {
            for (int i = 0; i < geometryInfos.length; i++) {
                geoInfoHash.put(geometryInfos[i].getVersion().getVersionKey(), geometryInfos[i]);
            }
        }
    }
    // 
    // MathModelInfos
    // 
    {
        mathModelInfoHash.clear();
        MathModelInfo[] mathModelInfos = vcInfoContainer.getMathModelInfos();
        if (mathModelInfos != null) {
            for (int i = 0; i < mathModelInfos.length; i++) {
                mathModelInfoHash.put(mathModelInfos[i].getVersion().getVersionKey(), mathModelInfos[i]);
            }
        }
    }
    // 
    // VCImageInfos
    // 
    {
        imgInfoHash.clear();
        VCImageInfo[] vcImageInfos = vcInfoContainer.getVCImageInfos();
        if (vcImageInfos != null) {
            for (int i = 0; i < vcImageInfos.length; i++) {
                imgInfoHash.put(vcImageInfos[i].getVersion().getVersionKey(), vcImageInfos[i]);
            }
        }
    }
    fireDatabaseRefresh(new DatabaseEvent(this, DatabaseEvent.REFRESH, null, null));
}
Also used : VCInfoContainer(org.vcell.util.document.VCInfoContainer) PerformanceData(cbit.rmi.event.PerformanceData) PerformanceMonitorEvent(cbit.rmi.event.PerformanceMonitorEvent) PerformanceDataEntry(cbit.rmi.event.PerformanceDataEntry) DataAccessException(org.vcell.util.DataAccessException) RemoteProxyException(cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException)

Example 7 with RemoteProxyException

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

the class ClientDocumentManager method removeUserFromGroup.

/**
 * Insert the method's description here.
 * Creation date: (11/28/00 5:43:44 PM)
 * @param bioModelInfo cbit.vcell.biomodel.BioModelInfo
 */
public BioModelInfo removeUserFromGroup(BioModelInfo bioModelInfo, String userToRemove) throws DataAccessException {
    try {
        // 
        // publish from database
        // 
        BioModelInfo newBioModelInfo = (BioModelInfo) removeUserFromGroup0(bioModelInfo, VersionableType.BioModelMetaData, bioModelInfoHash, userToRemove);
        // 
        // 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 8 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 MathModel save(MathModel mathModel, String[] independentSims) throws DataAccessException {
    try {
        String mathModelXML = null;
        try {
            mathModelXML = XmlHelper.mathModelToXML(mathModel);
            if (LG.isInfoEnabled()) {
                LG.info(XmlUtil.beautify(mathModelXML));
            }
        } catch (XmlParseException e) {
            e.printStackTrace(System.out);
            throw new DataAccessException(e.getMessage());
        }
        String savedMathModelXML = sessionManager.getUserMetaDbServer().saveMathModel(new BigString(mathModelXML), independentSims).toString();
        MathModel savedMathModel = getMathModelFromDatabaseXML(new XMLHolder<MathModel>(savedMathModelXML));
        if (LG.isInfoEnabled()) {
            LG.info(XmlUtil.beautify(savedMathModelXML));
        }
        KeyValue savedKey = savedMathModel.getVersion().getVersionKey();
        if (xmlHash.get(savedKey) == null) {
            xmlHash.put(savedKey, savedMathModelXML);
        }
        MathModelInfo savedMathModelInfo = new MathModelInfo(savedMathModel.getVersion(), savedMathModel.getMathDescription().getKey(), savedMathModel.createMathModelChildSummary(), VCellSoftwareVersion.fromSystemProperty());
        mathModelInfoHash.put(savedKey, savedMathModelInfo);
        updateGeometryRelatedHashes(savedMathModel.getMathDescription().getGeometry());
        fireDatabaseInsert(new DatabaseEvent(this, DatabaseEvent.INSERT, null, savedMathModelInfo));
        return savedMathModel;
    } catch (RemoteProxyException e) {
        e.printStackTrace(System.out);
        throw new DataAccessException(VCellErrorMessages.FAIL_SAVE_MESSAGE + "\n\n" + e.getMessage());
    }
}
Also used : MathModel(cbit.vcell.mathmodel.MathModel) KeyValue(org.vcell.util.document.KeyValue) BigString(org.vcell.util.BigString) XmlParseException(cbit.vcell.xml.XmlParseException) MathModelInfo(org.vcell.util.document.MathModelInfo) BigString(org.vcell.util.BigString) DataAccessException(org.vcell.util.DataAccessException) RemoteProxyException(cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException)

Example 9 with RemoteProxyException

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

the class ClientDocumentManager method addUserToGroup.

/**
 * Insert the method's description here.
 * Creation date: (11/28/00 5:43:44 PM)
 * @param bioModelInfo cbit.vcell.biomodel.BioModelInfo
 */
public VCImageInfo addUserToGroup(VCImageInfo imageInfo, String userToAdd) throws DataAccessException {
    try {
        // 
        // publish from database
        // 
        VCImageInfo newImageInfo = (VCImageInfo) addUserToGroup0(imageInfo, VersionableType.VCImage, imgInfoHash, userToAdd);
        // 
        // delete Image from cache
        // 
        xmlHash.remove(imageInfo.getVersion().getVersionKey());
        fireDatabaseUpdate(new DatabaseEvent(this, DatabaseEvent.UPDATE, imageInfo, newImageInfo));
        return newImageInfo;
    } catch (RemoteProxyException e) {
        handleRemoteProxyException(e);
        throw new DataAccessException(e.getMessage());
    }
}
Also used : VCImageInfo(cbit.image.VCImageInfo) DataAccessException(org.vcell.util.DataAccessException) RemoteProxyException(cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException)

Example 10 with RemoteProxyException

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

the class ClientDocumentManager method removeUserFromGroup.

/**
 * Insert the method's description here.
 * Creation date: (11/28/00 5:43:44 PM)
 * @param bioModelInfo cbit.vcell.biomodel.BioModelInfo
 */
public MathModelInfo removeUserFromGroup(MathModelInfo mathModelInfo, String userToRemove) throws DataAccessException {
    try {
        // 
        // publish from database
        // 
        MathModelInfo newMathModelInfo = (MathModelInfo) removeUserFromGroup0(mathModelInfo, VersionableType.MathModelMetaData, mathModelInfoHash, userToRemove);
        // 
        // delete MathModelMetaData from cache
        // 
        xmlHash.remove(mathModelInfo.getVersion().getVersionKey());
        fireDatabaseUpdate(new DatabaseEvent(this, DatabaseEvent.UPDATE, mathModelInfo, newMathModelInfo));
        return newMathModelInfo;
    } catch (RemoteProxyException e) {
        handleRemoteProxyException(e);
        throw new DataAccessException(e.getMessage());
    }
}
Also used : MathModelInfo(org.vcell.util.document.MathModelInfo) 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