Search in sources :

Example 1 with SiteInfo

use of cbit.vcell.message.server.console.LoginChecker.SiteInfo in project vcell by virtualcell.

the class SBMLExportTest method getConnection.

static VCellConnection getConnection(String siteName, String user, String password) {
    Collection<SiteInfo> sites = LoginChecker.getSiteInfos(siteName);
    for (SiteInfo si : sites) {
        try {
            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);
            return vcellConnection;
        } catch (Exception e) {
            System.err.println(e.getMessage());
            continue;
        }
    }
    throw new RuntimeException("No connection for site " + siteName);
}
Also used : VCellConnection(cbit.vcell.server.VCellConnection) SiteInfo(cbit.vcell.message.server.console.LoginChecker.SiteInfo) VCellBootstrap(cbit.vcell.server.VCellBootstrap) BigString(org.vcell.util.BigString) DigestedPassword(org.vcell.util.document.UserLoginInfo.DigestedPassword) UserLoginInfo(org.vcell.util.document.UserLoginInfo) RemoteProxyException(cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException) IOException(java.io.IOException) DataAccessException(org.vcell.util.DataAccessException) SBMLException(org.sbml.jsbml.SBMLException) XMLStreamException(javax.xml.stream.XMLStreamException) XmlParseException(cbit.vcell.xml.XmlParseException)

Aggregations

RemoteProxyException (cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException)1 SiteInfo (cbit.vcell.message.server.console.LoginChecker.SiteInfo)1 VCellBootstrap (cbit.vcell.server.VCellBootstrap)1 VCellConnection (cbit.vcell.server.VCellConnection)1 XmlParseException (cbit.vcell.xml.XmlParseException)1 IOException (java.io.IOException)1 XMLStreamException (javax.xml.stream.XMLStreamException)1 SBMLException (org.sbml.jsbml.SBMLException)1 BigString (org.vcell.util.BigString)1 DataAccessException (org.vcell.util.DataAccessException)1 UserLoginInfo (org.vcell.util.document.UserLoginInfo)1 DigestedPassword (org.vcell.util.document.UserLoginInfo.DigestedPassword)1