Examples of AgentClient


Examples of halfpipe.consul.client.AgentClient

        if (!consulProperties.isEnabled())
            return;

        ApplicationProperties appProps = context.getBean(ApplicationProperties.class);
        ServerProperties serverProperties = context.getBean(ServerProperties.class);
        AgentClient agentClient = context.getBean(AgentClient.class);

        Service service = new Service();
        service.setName(appProps.getId());
        Integer port = serverProperties.getPort();
        if (port == null) {
View Full Code Here

Examples of org.apache.sshd.agent.AgentClient

            // the native library is not available, so these tests should be skipped
            authSocket = null;
        }
        assumeThat(authSocket, notNullValue());

        SshAgent client = new AgentClient(authSocket);
        List<SshAgent.Pair<PublicKey, String>> keys = client.getIdentities();
        assertNotNull(keys);
        assertEquals(0, keys.size());

        KeyPair[] k = new FileKeyPairProvider(new String[] { "src/test/resources/hostkey.pem"}).loadKeys();
        client.addIdentity(k[0], "");
        keys = client.getIdentities();
        assertNotNull(keys);
        assertEquals(1, keys.size());

        client.removeIdentity(k[0].getPublic());
        keys = client.getIdentities();
        assertNotNull(keys);
        assertEquals(0, keys.size());

        client.removeAllIdentities();

        client.close();

        agent.close();
    }
View Full Code Here

Examples of org.apache.sshd.agent.unix.AgentClient

            // the native library is not available, so these tests should be skipped
            authSocket = null;
        }
        assumeThat(authSocket, notNullValue());

        SshAgent client = new AgentClient(authSocket);
        List<SshAgent.Pair<PublicKey, String>> keys = client.getIdentities();
        assertNotNull(keys);
        assertEquals(0, keys.size());

        KeyPair k = Utils.createTestHostKeyProvider().loadKey(KeyPairProvider.SSH_RSA);
        client.addIdentity(k, "");
        keys = client.getIdentities();
        assertNotNull(keys);
        assertEquals(1, keys.size());

        client.removeIdentity(k.getPublic());
        keys = client.getIdentities();
        assertNotNull(keys);
        assertEquals(0, keys.size());

        client.removeAllIdentities();

        client.close();

        agent.close();
    }
View Full Code Here

Examples of org.rhq.enterprise.server.agentclient.AgentClient

        private boolean isTested = false;
        private List<String> failures = new ArrayList<String>();

        @Override
        public AgentClient getKnownAgentClient(Agent agent) {
            AgentClient testClient = new MeasurementScheduleTestAgentClient(agent, this);
            agentClients.put(agent, testClient);

            return testClient;
        }
View Full Code Here

Examples of org.rhq.enterprise.server.agentclient.AgentClient

    public TestServerCommunicationsService() {
    }

    public AgentClient getKnownAgentClient(Agent agent) {
        AgentClient testClient = new TestAgentClient(agent, this);
        agentClients.put(agent, testClient);
        return testClient;
    }
View Full Code Here

Examples of org.rhq.enterprise.server.agentclient.AgentClient

        updatePluginsCalled = false;

        agentServiceContainer = prepareForTestAgents(new TestServerCommunicationsService() {
            @Override
            public AgentClient getKnownAgentClient(Agent agent) {
                AgentClient ret = new TestAgentClient(agent, this) {
                    @Override
                    public void updatePlugins() {
                        updatePluginsCalled = true;
                        pluginUpdateProgressWaiter.countDown();
                        try {
View Full Code Here

Examples of org.rhq.enterprise.server.agentclient.AgentClient

    private Configuration getLiveResourceConfiguration(Resource resource, boolean pingAgentFirst, boolean fromStructured) {
        Configuration liveConfig = null;

        try {
            Agent agent = resource.getAgent();
            AgentClient agentClient = this.agentManager.getAgentClient(agent);

            boolean agentPingedSuccessfully = false;
            // Getting live configuration is mostly for the UI's benefit - as such, do not hang
            // for a long time in the event the agent is down or can't be reached.  Let's make the UI
            // responsive even in the case of an agent down by pinging it quickly to verify the agent is up.
            if (pingAgentFirst) {
                agentPingedSuccessfully = agentClient.pingService(5000L);
            }

            if (!pingAgentFirst || agentPingedSuccessfully) {
                liveConfig = agentClient.getConfigurationAgentService().loadResourceConfiguration(resource.getId());
                if (liveConfig == null) {
                    // This should really never occur - the PC should never return a null, always at least an empty config.
                    LOG.debug("ConfigurationAgentService.loadResourceConfiguration() returned a null Configuration.");
                    liveConfig = new Configuration();
                }
View Full Code Here

Examples of org.rhq.enterprise.server.agentclient.AgentClient

                + "] does not have permission to view resource configuration for [" + resource + "]");
        }

        try {
            Agent agent = resource.getAgent();
            AgentClient agentClient = this.agentManager.getAgentClient(agent);
            ConfigurationAgentService configService = agentClient.getConfigurationAgentService();

            return configService.merge(configuration, resourceId, fromStructured);
        } catch (PluginContainerException e) {
            LOG.error("An error occurred while trying to translate the configuration.", e);
            return null;
View Full Code Here

Examples of org.rhq.enterprise.server.agentclient.AgentClient

        DeployPackagesRequest transferRequest = new DeployPackagesRequest(persistedRequest.getId(), resourceId,
            packages);

        // Make call to agent
        try {
            AgentClient agentClient = agentManager.getAgentClient(agent);
            ContentAgentService agentService = agentClient.getContentAgentService();
            agentService.deployPackages(transferRequest);
        } catch (RuntimeException e) {
            LOG.error("Error while sending deploy request to agent", e);

            // Update the request with the failure
View Full Code Here

Examples of org.rhq.enterprise.server.agentclient.AgentClient

        DeletePackagesRequest transferRequest = new DeletePackagesRequest(persistedRequest.getId(), resourceId,
            transferPackages);

        // Make call to agent
        try {
            AgentClient agentClient = agentManager.getAgentClient(agent);
            ContentAgentService agentService = agentClient.getContentAgentService();
            agentService.deletePackages(transferRequest);
        } catch (RuntimeException e) {
            LOG.error("Error while sending deploy request to agent", e);

            // Update the request with the failure
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.