Package org.rhq.enterprise.server.agentclient

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


    public TestServerCommunicationsService() {
    }

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

        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

    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

                + "] 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

        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

        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

        RetrievePackageBitsRequest transferRequest = new RetrievePackageBitsRequest(persistedRequest.getId(),
            resourceId, transferPackage);

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

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

        Agent agent = resource.getAgent();

        // Make call to agent
        List<DeployPackageStep> packageStepList;
        try {
            AgentClient agentClient = agentManager.getAgentClient(agent);
            ContentAgentService agentService = agentClient.getContentAgentService();
            packageStepList = agentService.translateInstallationSteps(resourceId, packageDetails);
        } catch (PluginContainerException e) {
            LOG.error("Error while sending deploy request to agent", e);

            // Throw so caller knows an error happened
View Full Code Here

                log.warn(msg);
                throw new CancelJobException(msg);
            }

            AgentManagerLocal agentManager = LookupUtil.getAgentManager();
            AgentClient agentClient = agentManager.getAgentClient(getOverlord(), resource.getId());

            agentClient.getOperationAgentService().invokeOperation(resourceHistory.getJobId().toString(),
                resource.getId(), schedule.getOperationName(), schedule.getParameters());
        } catch (Exception e) {
            // failed to even send to the agent, immediately mark the job as failed
            resourceHistory.setErrorMessage(ThrowableUtil.getStackAsString(e));
            operationManager.updateOperationHistory(s, resourceHistory);
View Full Code Here

TOP

Related Classes of org.rhq.enterprise.server.agentclient.AgentClient

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.