Search in sources :

Example 6 with ClientServerInfo

use of cbit.vcell.client.server.ClientServerInfo in project vcell by virtualcell.

the class ClientTester method mainInit.

/**
 * This method was created in VisualAge.
 * @return VCellConnection
 * @param args java.lang.String[]
 */
public static cbit.vcell.client.server.ClientServerManager mainInit(String[] args, String programName, Frame mainWindow) throws Exception {
    ClientServerInfo csInfo = null;
    if (args.length == 3) {
        if (args[0].equalsIgnoreCase("-local")) {
            csInfo = ClientServerInfo.createLocalServerInfo(args[1], new UserLoginInfo.DigestedPassword(args[2]));
        }
    } else if (args.length == 4) {
        csInfo = ClientServerInfo.createRemoteServerInfo(args[0], Integer.parseInt(args[1]), args[2], new UserLoginInfo.DigestedPassword(args[3]));
    } else {
        System.err.println("usage: " + programName + " -local userid password");
        // System.err.println("usage: " + programName + " -jms userid password");
        System.err.println("usage: " + programName + " apihost apiport userid password");
        throw new Exception("cannot connect");
    }
    VCellGuiInteractiveContextDefaultProvider defaultRequester = new VCellGuiInteractiveContextDefaultProvider();
    ClientServerManager clientServerManager = new ClientServerManager(csInfo, defaultRequester);
    clientServerManager.connect(null);
    return clientServerManager;
}
Also used : ClientServerManager(cbit.vcell.client.server.ClientServerManager) VCellGuiInteractiveContextDefaultProvider(cbit.vcell.client.VCellGuiInteractiveContextDefaultProvider) ClientServerInfo(cbit.vcell.client.server.ClientServerInfo) UserLoginInfo(org.vcell.util.document.UserLoginInfo)

Example 7 with ClientServerInfo

use of cbit.vcell.client.server.ClientServerInfo in project vcell by virtualcell.

the class ClientTester method mainInit.

/**
 * This method was created in VisualAge.
 * @return VCellConnection
 * @param args java.lang.String[]
 */
public static cbit.vcell.client.server.ClientServerManager mainInit(String[] args, String programName) throws Exception {
    ClientServerInfo csInfo = null;
    if (args.length == 3) {
        if (args[0].equalsIgnoreCase("-local")) {
            csInfo = ClientServerInfo.createLocalServerInfo(args[1], new UserLoginInfo.DigestedPassword(args[2]));
        }
    } else if (args.length == 4) {
        csInfo = ClientServerInfo.createRemoteServerInfo(args[0], Integer.parseInt(args[1]), args[2], new UserLoginInfo.DigestedPassword(args[3]));
    } else {
        System.err.println("usage: " + programName + " -local userid password");
        // System.err.println("usage: " + programName + " -jms userid password");
        System.err.println("usage: " + programName + " apihost apiport userid password");
        throw new Exception("cannot connect");
    }
    VCellGuiInteractiveContextDefaultProvider defaultRequester = new VCellGuiInteractiveContextDefaultProvider();
    ClientServerManager clientServerManager = new ClientServerManager(csInfo, defaultRequester);
    clientServerManager.connect(null);
    return clientServerManager;
}
Also used : ClientServerManager(cbit.vcell.client.server.ClientServerManager) VCellGuiInteractiveContextDefaultProvider(cbit.vcell.client.VCellGuiInteractiveContextDefaultProvider) ClientServerInfo(cbit.vcell.client.server.ClientServerInfo) UserLoginInfo(org.vcell.util.document.UserLoginInfo)

Example 8 with ClientServerInfo

use of cbit.vcell.client.server.ClientServerInfo in project vcell by virtualcell.

the class TestMissingSimData method startClient.

private static void startClient(VCSimulationIdentifier vcSimulationIdentifier, UserLoginInfo userLoginInfo) throws Exception {
    ClientServerInfo clientServerInfo = ClientServerInfo.createRemoteServerInfo("vcellapi.cam.uchc.edu", 8080, userLoginInfo.getUserName(), userLoginInfo.getDigestedPassword());
    VCellClient vCellClient = VCellClient.startClient(null, clientServerInfo);
    while (vCellClient.getClientServerManager() == null || vCellClient.getClientServerManager().getConnectionStatus() == null || vCellClient.getClientServerManager().getConnectionStatus().getStatus() != ConnectionStatus.CONNECTED) {
        Thread.sleep(1000);
        System.out.println("trying connect");
    }
    BigString simXML = vCellClient.getClientServerManager().getUserMetaDbServer().getSimulationXML(vcSimulationIdentifier.getSimulationKey());
    Simulation sim = XmlHelper.XMLToSim(simXML.toString());
    vCellClient.getClientServerManager().getJobManager().startSimulation(vcSimulationIdentifier, sim.getScanCount());
    SimulationStatusPersistent simulationStatus = null;
    while (true) {
        simulationStatus = vCellClient.getClientServerManager().getUserMetaDbServer().getSimulationStatus(vcSimulationIdentifier.getSimulationKey());
        System.out.println(simulationStatus);
        if (simulationStatus.isCompleted() || simulationStatus.isFailed()) {
            break;
        }
        Thread.sleep(1000);
    // MessageEvent[] messageEvents = vcellConnection.getMessageEvents();
    // for (int i = 0; messageEvents != null && i < messageEvents.length; i++) {
    // System.out.println(messageEvents[i]);
    // }
    }
}
Also used : Simulation(cbit.vcell.solver.Simulation) VCellClient(cbit.vcell.client.VCellClient) ClientServerInfo(cbit.vcell.client.server.ClientServerInfo) SimulationStatusPersistent(cbit.vcell.server.SimulationStatusPersistent) BigString(org.vcell.util.BigString)

Aggregations

ClientServerInfo (cbit.vcell.client.server.ClientServerInfo)8 ClientServerManager (cbit.vcell.client.server.ClientServerManager)4 DigestedPassword (org.vcell.util.document.UserLoginInfo.DigestedPassword)3 VCellGuiInteractiveContextDefaultProvider (cbit.vcell.client.VCellGuiInteractiveContextDefaultProvider)2 InteractiveContextDefaultProvider (cbit.vcell.client.server.ClientServerManager.InteractiveContextDefaultProvider)2 ConnectionStatus (cbit.vcell.client.server.ConnectionStatus)2 AsynchClientTask (cbit.vcell.client.task.AsynchClientTask)2 Hashtable (java.util.Hashtable)2 UserCancelException (org.vcell.util.UserCancelException)2 UserLoginInfo (org.vcell.util.document.UserLoginInfo)2 DocumentWindowManager (cbit.vcell.client.DocumentWindowManager)1 VCellClient (cbit.vcell.client.VCellClient)1 VCellClientDataServiceImpl (cbit.vcell.client.data.VCellClientDataServiceImpl)1 DocumentWindow (cbit.vcell.client.desktop.DocumentWindow)1 NetworkProxyPreferences (cbit.vcell.client.desktop.NetworkProxyPreferences)1 BioModelsNetModelInfo (cbit.vcell.client.desktop.biomodel.BioModelsNetModelInfo)1 VCellClientDataService (cbit.vcell.client.pyvcellproxy.VCellClientDataService)1 InteractiveContext (cbit.vcell.client.server.ClientServerManager.InteractiveContext)1 BioModelNode (cbit.vcell.desktop.BioModelNode)1 LoginDelegate (cbit.vcell.desktop.LoginDelegate)1