Package org.rhq.core.domain.resource

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


    /*
     * Removed ExcludeDefaultInterceptors annotation to enable permission and session check by the container.
     */
    public Agent getAgentByResourceId(Subject subject, int resourceId) {
        Agent agent;

        try {
            //insert logged in check and view resources perm check as method called from GWT*Service
            if ((subject != null) && (!authorizationManager.hasGlobalPermission(subject, Permission.MANAGE_SETTINGS))) {
                throw new PermissionException("Can not get agent details - " + subject + " lacks "
View Full Code Here


    }

    @ExcludeDefaultInterceptors
    public Boolean pingAgentByResourceId(Subject subject, int resourceId) {
        Boolean pingResults = Boolean.FALSE;
        Agent agent;

        try {
            //insert call to method doing logged in check and view resources perm check as method calld from GWT*Service
            agent = getAgentByResourceId(subject, resourceId);

View Full Code Here

        return pingResults;
    }

    public String getRemoteEndpointWrapped() {
        // some browsers (firefox in particular) won't wrap unless you put breaks in the string
        Agent theAgent = getAgent();
        if (theAgent != null) {
            String remoteEndpoint = theAgent.getRemoteEndpoint();
            if (remoteEndpoint != null) {
                return remoteEndpoint.replaceAll("&", " &");
            } else {
                return "!no remote endpoint associated with this resource!";
            }
View Full Code Here

            try {
                AgentManagerLocal agentManager = getAgentManager();

                // see if the agent token is valid - note that we do not know if the token is coming
                // from the particular agent it is assigned to - for true security, SSL certs should be used
                Agent agent = agentManager.getAgentByAgentToken(security_token);
                if (agent == null) {
                    throw new NullPointerException();
                }

                TOKENS_CACHE.put(security_token, new Long(now));
View Full Code Here

                + " of type: " + resourceTypeId);
        }

        ResourceType resourceType = entityManager.find(ResourceType.class, resourceTypeId);
        Resource parentResource = entityManager.find(Resource.class, parentResourceId);
        Agent agent = parentResource.getAgent();

        // Check permissions first
        if (!authorizationManager
            .hasResourcePermission(user, Permission.CREATE_CHILD_RESOURCES, parentResource.getId())) {
            throw new PermissionException("User [" + user.getName()
View Full Code Here

    private CreateResourceHistory doCreatePackageBackedResource(Subject subject, Resource parentResource,
        ResourceType newResourceType, String newResourceName, Configuration pluginConfiguration,
        Configuration deploymentTimeConfiguration, PackageVersion packageVersion, Integer timeout) {

        Agent agent = parentResource.getAgent();

        // add the timeout to the deploymentTimeConfiguration
        if (deploymentTimeConfiguration != null) {
            if (timeout != null) {
                deploymentTimeConfiguration.put(new PropertySimple("userProvidedTimeoutMillis", timeout));
View Full Code Here

        if (LOG.isDebugEnabled()) {
            LOG.debug("Received call to delete resource: " + resourceId);
        }

        Resource resource = entityManager.find(Resource.class, resourceId);
        Agent agent = resource.getAgent();

        // Check permissions first
        if (!authorizationManager.hasResourcePermission(subject, Permission.DELETE_RESOURCE, resource.getId())) {
            throw new PermissionException("User [" + subject.getName()
                + "] does not have permission to delete resource [" + resource + "]");
View Full Code Here

     */
    public AgentClient getAgentClientForSchedule(MeasurementSchedule sched) {
        Resource pRes = sched.getResource();

        // Get agent and open a connection to it
        Agent agent = pRes.getAgent();
        AgentClient ac = agentManager.getAgentClient(agent);
        return ac;
    }
View Full Code Here

                Map<Agent, Set<ResourceMeasurementScheduleRequest>> agentUpdates = null;
                agentUpdates = new HashMap<Agent, Set<ResourceMeasurementScheduleRequest>>();

                // The number of Agents is manageable, so we can work with entities here
                for (Integer resourceId : reqMap.keySet()) {
                    Agent agent = agentManager.getAgentByResourceId(subjectManager.getOverlord(), resourceId);

                    // Ignore resources that are not actually associated with an agent. For example,
                    // those with an UNINVENTORIED status.
                    if (null == agent) {
                        if (log.isDebugEnabled()) {
View Full Code Here

                resourceRequest.addMeasurementScheduleRequest(requestData);
            }

            boolean markResources = false;
            try {
                Agent nextAgent = agentManager.getAgentByID(nextAgentId);
                AgentClient agentClient = agentManager.getAgentClient(nextAgent);

                boolean couldPing = agentClient.pingService(2000); // see if agent is up for sending
                if (couldPing) {
                    Set<ResourceMeasurementScheduleRequest> requestsToSend = new HashSet<ResourceMeasurementScheduleRequest>(
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.