Package org.rhq.core.domain.resource

Examples of org.rhq.core.domain.resource.Agent


     * @return A Resource ready to use
     */
    private Resource setupResource() {
        String tuid = "" + new Random().nextInt();
        String prefix = this.getClass().getSimpleName() + "_" + tuid + "_";
        theAgent = new Agent(prefix + "agent", "localhost" + tuid, 1234, "", "randomToken" + tuid);
        em.persist(theAgent);

        theResourceType = new ResourceType(prefix + "type", prefix + "plugin", ResourceCategory.PLATFORM, null);
        em.persist(theResourceType);

View Full Code Here


        agentMgr = LookupUtil.getAgentManager();

        TopologyManagerLocal topMgr = LookupUtil.getTopologyManager();
        Server svr = topMgr.findServersByCriteria(subjectMgr.getOverlord(), new ServerCriteria()).get(0);

        agent = new Agent();
        agent.setAddress("kachny");
        agent.setAgentToken("1234");
        agent.setName("kachny");
        agent.setPort(1234);
        agent.setRemoteEndpoint("kachny");
View Full Code Here

        /*
         * this is informational debugging only - do NOT change the status bits here
         */
        if (log.isDebugEnabled()) {
            Agent agent = agentManager.getAgentByResourceId(LookupUtil.getSubjectManager().getOverlord(), resourceId);
            log.debug("Marking status, agent[id=" + agent.getId() + ", status=" + agent.getStatus()
                + "] for resource[id=" + resourceId + "]");

            log.debug("Agents updated: " + agentsUpdated);
        }
    }
View Full Code Here

        /*
         * this is informational debugging only - do NOT change the status bits here
         */
        if (log.isDebugEnabled()) {
            AlertDefinition definition = entityManager.find(AlertDefinition.class, alertDefinitionId);
            Agent agent = agentManager.getAgentByResourceId(LookupUtil.getSubjectManager().getOverlord(), definition
                .getResource().getId());
            log.debug("Marking status, agent[id=" + agent.getId() + ", status=" + agent.getStatus()
                + "] for alertDefinition[id=" + alertDefinitionId + "]");

            log.debug("Agents updated: " + agentsUpdated);
        }
    }
View Full Code Here

        /*
         * this is informational debugging only - do NOT change the status bits here
         */
        if (log.isDebugEnabled()) {
            MeasurementBaseline baseline = entityManager.find(MeasurementBaseline.class, baselineId);
            Agent agent = baseline.getSchedule().getResource().getAgent();
            log.debug("Marking status, agent[id=" + agent.getId() + ", status=" + agent.getStatus()
                + "] for measurementBaseline[id=" + baselineId + "]");
        }
    }
View Full Code Here

        /*
         * this is informational debugging only - do NOT change the status bits here
         */
        if (log.isDebugEnabled()) {
            Agent agent = entityManager.find(Agent.class, agentId);
            log.debug("Marking status, agent[id=" + agent.getId() + ", status=" + agent.getStatus() + "]");
        }
    }
View Full Code Here

                // that occurs as a result of a user deleting a plugin. DiscoveryBossBean
                // already logs a message about the stale types that can be useful for
                // debugging; so, we just need to propagate the exception to the agent.
                throw e;
            } catch (InvalidInventoryReportException e) {
                Agent agent = report.getAgent();
                if (log.isDebugEnabled()) {
                    log.error("Received invalid inventory report from agent [" + agent + "]", e);
                } else {
                    /*
                     * this is expected when the platform is uninventoried, because the agent often has in-flight reports
View Full Code Here

        query.executeUpdate();

        // Audit each changed affinity group assignment (is this too verbose?)
        String auditString = group.getName() + " <-- ";
        for (Integer agentId : agentIdsList) {
            Agent agent = entityManager.find(Agent.class, agentId);
            partitionEventManager.auditPartitionEvent(subject, PartitionEventType.AGENT_AFFINITY_GROUP_ASSIGN,
                auditString + agent.getName());

        }
        // Now, request a cloud repartitioning due to the affinity group changes
        partitionEventManager.cloudPartitionEventRequest(subject, PartitionEventType.AFFINITY_GROUP_CHANGE, group
            .getName());
View Full Code Here

        query.executeUpdate();

        // Audit each changed affinity group assignment (is this too verbose?)
        for (Integer agentId : agentIdsList) {
            Agent agent = entityManager.find(Agent.class, agentId);
            partitionEventManager.auditPartitionEvent(subject, PartitionEventType.AGENT_AFFINITY_GROUP_REMOVE, agent
                .getName());

        }
        // Now, request a cloud repartitioning due to the affinity group changes
        partitionEventManager.cloudPartitionEventRequest(subject, PartitionEventType.AFFINITY_GROUP_CHANGE,
View Full Code Here

        if (eventType.isCloudPartitionEvent() || (null == agentName)) {
            throw new IllegalArgumentException("Invalid agent partition event or no agent specified for event type: "
                + eventType);
        }

        Agent agent = agentManager.getAgentByName(agentName);

        if (null == agent) {
            throw new IllegalArgumentException("Can not perform partition event, agent not found with name: "
                + agentName);
        }

        PartitionEvent partitionEvent = new PartitionEvent(subject.getName(), eventType, eventDetail,
            PartitionEvent.ExecutionStatus.IMMEDIATE);
        partitionEventManager.createPartitionEvent(subject, partitionEvent);

        return failoverListManager.getForSingleAgent(partitionEvent, agent.getName());
    }
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.resource.Agent

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.