Examples of AgentClient


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

    public void removeDownedAgent(String endpoint) {
        m_knownAgents.removeAgent(endpoint);

        // since we have been told the agent is down, clear its agent client from cache
        // and stop any messages currently being sent or queued to be sent to that agent
        AgentClient client;
        InvokerLocator locator;

        try {
            locator = new InvokerLocator(endpoint);
        } catch (MalformedURLException e) {
            // this should never happen - our endpoint URLs must always be valid
            throw new IllegalArgumentException(e);
        }

        synchronized (m_knownAgentClients) {
            client = m_knownAgentClients.remove(getEndpointKey(locator.getHost(), locator.getPort()));
        }

        if (client != null) {
            client.stopSending();
        }

        return;
    }
View Full Code Here

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

        Subject overlord = LookupUtil.getSubjectManager().getOverlord();

        PageList<Agent> agents = agentManager.findAgentsByCriteria(overlord, crit);

        for(Agent agent : agents) {
            AgentClient client = agentManager.getAgentClient(agent);
            client.updatePlugins();
        }
    }
View Full Code Here

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

        // the current avail type for the newly enabled resources.  If we can't contact the agent don't worry about
        // it; if it's down we'll get a full report when it comes up.
        AgentManagerLocal agentManager = LookupUtil.getAgentManager();
        for (Agent agent : internalizeJobValues((String) jobDataMap.get(AGENTS))) {
            try {
                AgentClient agentClient = agentManager.getAgentClient(agent);
                agentClient.getDiscoveryAgentService().requestFullAvailabilityReport();
            } catch (Throwable t) {
                if (log.isDebugEnabled()) {
                    log.debug("Failed to notify Agent ["
                        + agent
                        + "] of enabled resources. The agent is likely down. This is ok, the avails will be updated when the agent is restarted or prompt command 'avail --force is executed'.");
View Full Code Here

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

    @TransactionAttribute(REQUIRES_NEW)
    public void ackChangeSetInNewTransaction(Subject subject, final int resourceId, final Headers headers,
        final List<JPADriftFile> driftFilesToRequest) throws Exception {

        try {
            AgentClient agentClient = agentManager.getAgentClient(subjectManager.getOverlord(), resourceId);
            DriftAgentService service = agentClient.getDriftAgentService();

            service.ackChangeSet(resourceId, headers.getDriftDefinitionName());

            // send a message to the agent requesting the necessary JPADriftFile content. Note that the
            // driftFile status has been set to REQUESTED outside of this call.
View Full Code Here

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

        }

        String jobIdString = doomedHistory.getJobId().toString();
        int resourceId = doomedHistory.getResource().getId();
        CancelResults results = null;
        AgentClient agent = null;
        boolean canceled = false;

        try {
            agent = agentManager.getAgentClient(subjectManager.getOverlord(), resourceId);

            // since this method is usually called by the UI, we want to quickly determine if we can even talk to the agent
            if (agent.pingService(5000L)) {
                results = agent.getOperationAgentService().cancelOperation(jobIdString);

                InterruptedState interruptedState = results.getInterruptedState();

                switch (interruptedState) {
                case FINISHED: {
View Full Code Here

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

            requests.add(new MeasurementScheduleRequest(schedule));
        }

        Set<MeasurementData> result = null;
        try {
            AgentClient ac = agentClientManager.getAgentClient(agent);
            result = ac.getMeasurementAgentService(timeout).getRealTimeMeasurementValue(resourceId, requests);

        } catch (RuntimeException e) {
            if (e instanceof CannotConnectException //
                || (null != e.getCause() && (e.getCause() instanceof TimeoutException))) {
View Full Code Here

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

                for (MeasurementSchedule schedule : schedules) {
                    requests.add(new MeasurementScheduleRequest(schedule));
                    scheduleIdToResourceIdMap.put(schedule.getId(), resourceIdWithAgent.getResourceId());
                }

                AgentClient ac = agentClientManager.getAgentClient(resourceIdWithAgent.getAgent());
                Set<MeasurementData> newValues = ac.getMeasurementAgentService().getRealTimeMeasurementValue(
                    resourceIdWithAgent.getResourceId(), requests);
                values.addAll(newValues);

                // Add the resource id as a prefix of the name, because the name is not unique across different platforms
                for (MeasurementData value : newValues) {
View Full Code Here

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

        final ResourceConfigUpdateFixture fixture = newStructuredResourceConfigUpdateFixture();

        final ResourceConfigurationUpdate expectedUpdate = new ResourceConfigurationUpdate(fixture.resource,
            fixture.configuration, fixture.subject.getName());

        final AgentClient agentClient = context.mock(AgentClient.class);
        final ConfigurationAgentService configAgentService = context.mock(ConfigurationAgentService.class);

        final ConfigurationUpdateRequest expectedUpdateRequest = new ConfigurationUpdateRequest(expectedUpdate.getId(),
            expectedUpdate.getConfiguration(), expectedUpdate.getResource().getId());
View Full Code Here

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

        final ResourceConfigUpdateFixture fixture = newRawResourceConfigUpdateFixture();

        final ResourceConfigurationUpdate expectedUpdate = new ResourceConfigurationUpdate(fixture.resource,
            fixture.configuration, fixture.subject.getName());

        final AgentClient agentClient = context.mock(AgentClient.class);
        final ConfigurationAgentService configAgentService = context.mock(ConfigurationAgentService.class);

        final ConfigurationUpdateRequest expectedUpdateRequest = new ConfigurationUpdateRequest(expectedUpdate.getId(),
            expectedUpdate.getConfiguration(), expectedUpdate.getResource().getId());
View Full Code Here

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

        final ResourceConfigurationUpdate expectedUpdate = new ResourceConfigurationUpdate(fixture.resource,
            fixture.configuration, fixture.subject.getName());
        expectedUpdate.setId(-1);

        final AgentClient agentClient = context.mock(AgentClient.class);
        final ConfigurationAgentService configAgentService = context.mock(ConfigurationAgentService.class);

        final ConfigurationUpdateRequest expectedUpdateRequest = new ConfigurationUpdateRequest(expectedUpdate.getId(),
            expectedUpdate.getConfiguration(), expectedUpdate.getResource().getId());
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.