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);
}
}
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);
}
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());
}
}
}
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());
}
}
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());
}
}
Aggregations