use of cbit.vcell.server.UserMetaDbServer in project vcell by virtualcell.
the class ClientDocumentManager method addUserToGroup0.
/**
* Insert the method's description here.
* Creation date: (11/28/00 5:43:44 PM)
* @param bioModelInfo cbit.vcell.biomodel.BioModelInfo
*/
private <T extends VersionInfo> T addUserToGroup0(VersionInfo versionInfo, VersionableType vType, Hashtable<KeyValue, T> vInfoHash, String userToAdd) throws RemoteProxyException, DataAccessException {
//
// unpublish from database
//
UserMetaDbServer dbServer = sessionManager.getUserMetaDbServer();
@SuppressWarnings("unchecked") T newVersionInfo = (T) dbServer.groupAddUser(vType, versionInfo.getVersion().getVersionKey(), userToAdd, false);
//
// replace versionInfo in hashTable
//
vInfoHash.remove(versionInfo.getVersion().getVersionKey());
vInfoHash.put(newVersionInfo.getVersion().getVersionKey(), newVersionInfo);
return newVersionInfo;
}
use of cbit.vcell.server.UserMetaDbServer in project vcell by virtualcell.
the class ClientDocumentManager method setGroupPublic0.
/**
* Insert the method's description here.
* Creation date: (11/28/00 5:43:44 PM)
* @param bioModelInfo cbit.vcell.biomodel.BioModelInfo
*/
private <T extends VersionInfo> T setGroupPublic0(VersionInfo versionInfo, VersionableType vType, Hashtable<KeyValue, T> vInfoHash) throws RemoteProxyException, DataAccessException {
//
// publish from database
//
UserMetaDbServer dbServer = sessionManager.getUserMetaDbServer();
@SuppressWarnings("unchecked") T newVersionInfo = (T) dbServer.groupSetPublic(vType, versionInfo.getVersion().getVersionKey());
//
// replace versionInfo in hashtable
//
vInfoHash.remove(versionInfo.getVersion().getVersionKey());
vInfoHash.put(newVersionInfo.getVersion().getVersionKey(), newVersionInfo);
return newVersionInfo;
}
use of cbit.vcell.server.UserMetaDbServer in project vcell by virtualcell.
the class ClientDocumentManager method removeUserFromGroup0.
/**
* Insert the method's description here.
* Creation date: (11/28/00 5:43:44 PM)
* @param bioModelInfo cbit.vcell.biomodel.BioModelInfo
*/
private <T extends VersionInfo> T removeUserFromGroup0(VersionInfo versionInfo, VersionableType vType, Hashtable<KeyValue, T> vInfoHash, String userToAdd) throws RemoteProxyException, DataAccessException {
//
// unpublish from database
//
UserMetaDbServer dbServer = sessionManager.getUserMetaDbServer();
@SuppressWarnings("unchecked") T newVersionInfo = (T) dbServer.groupRemoveUser(vType, versionInfo.getVersion().getVersionKey(), userToAdd, false);
//
// replace versionInfo in hashTable
//
vInfoHash.remove(versionInfo.getVersion().getVersionKey());
vInfoHash.put(newVersionInfo.getVersion().getVersionKey(), newVersionInfo);
return newVersionInfo;
}
use of cbit.vcell.server.UserMetaDbServer in project vcell by virtualcell.
the class LoginChecker method attemptLogin.
private static boolean attemptLogin(SiteInfo si, String user, String password) {
long start = 0;
try {
if (VERBOSE) {
start = System.currentTimeMillis();
}
String url = si.bootStrapUrl();
VCellBootstrap vcellBootstrap = (VCellBootstrap) java.rmi.Naming.lookup(url);
DigestedPassword dp = new UserLoginInfo.DigestedPassword(password);
UserLoginInfo uli = new UserLoginInfo(user, dp);
VCellConnection vcellConnection = vcellBootstrap.getVCellConnection(uli);
if (vcellConnection == null) {
if (VERBOSE) {
System.out.println("no connection on " + si + " in " + elapsed(start) + " seconds");
}
return false;
}
UserMetaDbServer dataServer = vcellConnection.getUserMetaDbServer();
@SuppressWarnings("unused") BioModelInfo[] bmi = dataServer.getBioModelInfos(true);
if (VERBOSE) {
System.out.println("success on " + si + " in " + elapsed(start) + " seconds");
}
return true;
} catch (MalformedURLException e) {
e.printStackTrace();
throw new Error("bad code");
} catch (Exception e) {
if (VERBOSE) {
System.out.println("failed in " + elapsed(start) + " seconds");
}
e.printStackTrace();
return false;
}
}
use of cbit.vcell.server.UserMetaDbServer in project vcell by virtualcell.
the class SBMLExportTest method getBiomodelByName.
static BioModel getBiomodelByName(VCellConnection vcn, String name) throws RemoteProxyException, DataAccessException, XmlParseException {
EscapedName eName = new EscapedName(name);
UserMetaDbServer dataServer = vcn.getUserMetaDbServer();
for (BioModelInfo bmi : dataServer.getBioModelInfos(false)) {
String mName = bmi.getVersion().getName();
if (eName.matches(mName)) {
KeyValue bioModelKey = bmi.getVersion().getVersionKey();
BigString bioModelXML = dataServer.getBioModelXML(bioModelKey);
BioModel bioModel = XmlHelper.XMLToBioModel(new XMLSource(bioModelXML.toString()));
return bioModel;
}
}
// if not found, list what's available
for (BioModelInfo bmi : dataServer.getBioModelInfos(false)) {
String mName = bmi.getVersion().getName();
System.out.println(mName);
}
return null;
}
Aggregations