Package org.rhq.enterprise.clientapi

Examples of org.rhq.enterprise.clientapi.RemoteClient


    public void execute(ClientMain client) {
        client.setTransport(null);
        client.setHost(null);
        client.setPort(0);
        RemoteClient remoteClient = client.getRemoteClient();
        if (null != remoteClient) {
            remoteClient.logout();
        }
        // this call has the side effect of setting bindings for the new remote client and its subject       
        client.setRemoteClient(null);
        client.setSubject(null);
        client.setUser(null);
View Full Code Here


    public Subject execute(ClientMain client, String username, String password, String host, int port, String transport)
        throws Exception {

        //add call to different subsystem if it exists
        RemoteClient remoteClient;
        if ((subsystem != null) && (subsystem.trim().equalsIgnoreCase("WSREMOTEAPI"))) {
            remoteClient = new RemoteClient(transport, host, port, subsystem);
        } else {
            remoteClient = new RemoteClient(transport, host, port);
        }

        // in case transport was null, let the client tell us what it'll use
        client.setTransport(remoteClient.getTransport());
        client.setHost(host);
        client.setPort(port);
        client.setUser(username);
        client.setPass(password);

        Subject subject = remoteClient.login(username, password);

        String versionUpdate = remoteClient.getServerVersionUpdate();
        String version;
        //Conditionally check for and apply update/patch version details
        if ((versionUpdate != null) && (!versionUpdate.trim().isEmpty())) {
            version = remoteClient.getServerVersion() + " " + versionUpdate + " ("
                + remoteClient.getServerBuildNumber() + ")";
        } else {
            version = remoteClient.getServerVersion() + " (" + remoteClient.getServerBuildNumber() + ")";
        }

        client.getPrintWriter().println("Remote server version is: " + version);

        // this call has the side effect of setting bindings for the new remote client and its subject
View Full Code Here

            FileUtil.purge(tmpDir, true);
        }
    }
   
    public void canLocateScripts() throws Exception {
        RemoteClient client = Mockito.mock(RemoteClient.class);
       
        //this is akin to what the remote client actually returns as the remote URI
        URI remoteURI = new URI("socket://localhost:7080");
        Mockito.when(client.getRemoteURI()).thenReturn(remoteURI);
       
        URI real = tmpDir.toURI().resolve("downloads/script-modules/test-script.js");
       
        RhqDownloadsScriptSourceProvider provider = new RhqDownloadsScriptSourceProvider();
View Full Code Here

TOP

Related Classes of org.rhq.enterprise.clientapi.RemoteClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.