Search in sources :

Example 1 with UserMetaDbServer

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;
}
Also used : UserMetaDbServer(cbit.vcell.server.UserMetaDbServer)

Example 2 with UserMetaDbServer

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;
}
Also used : UserMetaDbServer(cbit.vcell.server.UserMetaDbServer)

Example 3 with UserMetaDbServer

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;
}
Also used : UserMetaDbServer(cbit.vcell.server.UserMetaDbServer)

Example 4 with UserMetaDbServer

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;
    }
}
Also used : VCellConnection(cbit.vcell.server.VCellConnection) UserMetaDbServer(cbit.vcell.server.UserMetaDbServer) MalformedURLException(java.net.MalformedURLException) VCellBootstrap(cbit.vcell.server.VCellBootstrap) BioModelInfo(org.vcell.util.document.BioModelInfo) DigestedPassword(org.vcell.util.document.UserLoginInfo.DigestedPassword) MalformedURLException(java.net.MalformedURLException) UserLoginInfo(org.vcell.util.document.UserLoginInfo)

Example 5 with UserMetaDbServer

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;
}
Also used : UserMetaDbServer(cbit.vcell.server.UserMetaDbServer) KeyValue(org.vcell.util.document.KeyValue) BioModel(cbit.vcell.biomodel.BioModel) BioModelInfo(org.vcell.util.document.BioModelInfo) BigString(org.vcell.util.BigString) BigString(org.vcell.util.BigString) XMLSource(cbit.vcell.xml.XMLSource)

Aggregations

UserMetaDbServer (cbit.vcell.server.UserMetaDbServer)6 BioModelInfo (org.vcell.util.document.BioModelInfo)2 BioModel (cbit.vcell.biomodel.BioModel)1 VCellBootstrap (cbit.vcell.server.VCellBootstrap)1 VCellConnection (cbit.vcell.server.VCellConnection)1 XMLSource (cbit.vcell.xml.XMLSource)1 MalformedURLException (java.net.MalformedURLException)1 BigString (org.vcell.util.BigString)1 KeyValue (org.vcell.util.document.KeyValue)1 UserLoginInfo (org.vcell.util.document.UserLoginInfo)1 DigestedPassword (org.vcell.util.document.UserLoginInfo.DigestedPassword)1