Search in sources :

Example 1 with RemoteProxyException

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

the class RemoteRegistrationService method sendLostPassword.

@Override
public void sendLostPassword(String userid) throws DataAccessException, RemoteProxyException {
    // e.g. vcell.serverhost=vcellapi.cam.uchc.edu:8080
    String serverHost = PropertyLoader.getRequiredProperty(PropertyLoader.vcellServerHost);
    String[] parts = serverHost.split(":");
    String host = parts[0];
    int port = Integer.parseInt(parts[1]);
    boolean bIgnoreCertProblems = false;
    boolean bIgnoreHostMismatch = false;
    VCellApiClient apiClient;
    try {
        apiClient = new VCellApiClient(host, port, bIgnoreCertProblems, bIgnoreHostMismatch);
    } catch (KeyManagementException | NoSuchAlgorithmException | KeyStoreException e) {
        e.printStackTrace();
        throw new RemoteProxyException("failure in send lost password request: " + e.getMessage(), e);
    }
    try {
        apiClient.sendLostPassword(userid);
    } catch (Exception e) {
        e.printStackTrace();
        throw new RemoteProxyException("failed to request lost password: " + e.getMessage(), e);
    }
}
Also used : NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) KeyStoreException(java.security.KeyStoreException) VCellApiClient(org.vcell.api.client.VCellApiClient) KeyManagementException(java.security.KeyManagementException) RemoteProxyException(cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException) IOException(java.io.IOException) KeyManagementException(java.security.KeyManagementException) KeyStoreException(java.security.KeyStoreException) DataAccessException(org.vcell.util.DataAccessException) UseridIDExistsException(org.vcell.util.UseridIDExistsException) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) RemoteProxyException(cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException)

Example 2 with RemoteProxyException

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

the class RemoteRegistrationService method insertUserInfo.

@Override
public UserInfo insertUserInfo(UserInfo newUserInfo, boolean bUpdate) throws RemoteProxyException, DataAccessException, UseridIDExistsException {
    // e.g. vcell.serverhost=vcellapi.cam.uchc.edu:8080
    String serverHost = PropertyLoader.getRequiredProperty(PropertyLoader.vcellServerHost);
    String[] parts = serverHost.split(":");
    String host = parts[0];
    int port = Integer.parseInt(parts[1]);
    boolean bIgnoreCertProblems = false;
    boolean bIgnoreHostMismatch = false;
    VCellApiClient apiClient;
    try {
        apiClient = new VCellApiClient(host, port, bIgnoreCertProblems, bIgnoreHostMismatch);
    } catch (KeyManagementException | NoSuchAlgorithmException | KeyStoreException e) {
        e.printStackTrace();
        throw new RemoteProxyException("failure inserting user: " + e.getMessage(), e);
    }
    org.vcell.api.common.UserInfo apiUserInfo;
    try {
        apiUserInfo = apiClient.insertUserInfo(newUserInfo.getApiUserInfo());
    } catch (IOException e) {
        e.printStackTrace();
        throw new RemoteProxyException("failed to insert user: " + e.getMessage(), e);
    }
    return UserInfo.fromApiUserInfo(apiUserInfo);
}
Also used : NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) KeyStoreException(java.security.KeyStoreException) IOException(java.io.IOException) VCellApiClient(org.vcell.api.client.VCellApiClient) KeyManagementException(java.security.KeyManagementException) RemoteProxyException(cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException)

Example 3 with RemoteProxyException

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

the class ClientDocumentManager method replacePreferences.

/**
 * This method was created in VisualAge.
 * @return void
 * @param key KeyValue
 * @exception org.vcell.util.DataAccessException The exception description.
 * @exception RemoteProxyException The exception description.
 */
public void replacePreferences(Preference[] argPreferences) throws DataAccessException {
    if (argPreferences == null) {
        throw new IllegalArgumentException("preferences were null");
    }
    System.out.println("ClientDocumentManager.replacePreferences()");
    if (!Compare.isEqual(argPreferences, getPreferences())) {
        try {
            sessionManager.getUserMetaDbServer().replacePreferences(argPreferences);
            preferences = argPreferences;
        } 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 4 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 MathModel saveAsNew(MathModel mathModel, java.lang.String newName, String[] independentSims) throws DataAccessException {
    try {
        String mathModelXML = null;
        try {
            mathModelXML = XmlHelper.mathModelToXML(mathModel);
        } catch (XmlParseException e) {
            e.printStackTrace(System.out);
            throw new DataAccessException(e.getMessage());
        }
        // System.out.println(mathModelXML);
        String savedMathModelXML = sessionManager.getUserMetaDbServer().saveMathModelAs(new BigString(mathModelXML), newName, independentSims).toString();
        MathModel savedMathModel = getMathModelFromDatabaseXML(new XMLHolder<MathModel>(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 5 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 GeometryInfo addUserToGroup(GeometryInfo geometryInfo, String userToAdd) throws DataAccessException {
    try {
        // 
        // publish from database
        // 
        GeometryInfo newGeometryInfo = (GeometryInfo) addUserToGroup0(geometryInfo, VersionableType.Geometry, geoInfoHash, userToAdd);
        // //
        // // delete Geometry from cache
        // //
        // xmlHash.remove(geometryInfo.getVersion().getVersionKey());
        // //
        // // delete any MathModelMetaData's that use this GeometryInfo from cache
        // //
        // MathModelInfo referencedMathModelInfos[] = getMathModelReferences(geometryInfo);
        // for (int i = 0; i < referencedMathModelInfos.length; i++){
        // xmlHash.remove(referencedMathModelInfos[i].getVersion().getVersionKey());
        // }
        // //
        // // delete any BioModelMetaData's that use this GeometryInfo from cache
        // //
        // BioModelInfo referencedBioModelInfos[] = getBioModelReferences(geometryInfo);
        // for (int i = 0; i < referencedBioModelInfos.length; i++){
        // xmlHash.remove(referencedBioModelInfos[i].getVersion().getVersionKey());
        // }
        fireDatabaseUpdate(new DatabaseEvent(this, DatabaseEvent.UPDATE, geometryInfo, newGeometryInfo));
        return newGeometryInfo;
    } catch (RemoteProxyException e) {
        handleRemoteProxyException(e);
        throw new DataAccessException(e.getMessage());
    }
}
Also used : GeometryInfo(cbit.vcell.geometry.GeometryInfo) 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