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