Package org.rhq.core.domain.resource.group

Examples of org.rhq.core.domain.resource.group.ResourceGroup


        group.setDescription(location);
        group.setMtime(System.currentTimeMillis());
    }

    private ResourceGroup getResourceGroupToBeModified(Subject subject, int groupId) {
        ResourceGroup group = entityManager.find(ResourceGroup.class, groupId);

        if (group == null) {
            throw new ResourceGroupNotFoundException(groupId);
        }
View Full Code Here


            .getSubject(), this.group, this.pluginConfigurations);
        return;
    }

    private ResourceGroup loadGroup() throws Exception {
        ResourceGroup group;
        try {
            group = EnterpriseFacesContextUtility.getResourceGroup();
        } catch (Exception e) {
            throw new Exception("No group is associated with this request ('groupId' request parameter is not set).");
        }
        if (group.getGroupCategory() != GroupCategory.COMPATIBLE) {
            throw new Exception("Group with id " + group.getId() + " is not a compatible group.");
        }
        return group;
    }
View Full Code Here

    private boolean recursive;

    private ResourceGroupManagerLocal resourceGroupManager = LookupUtil.getResourceGroupManager();

    public EditGroupGeneralPropertiesUIBean() {
        ResourceGroup resourceGroup = EnterpriseFacesContextUtility.getResourceGroup();

        this.name = resourceGroup.getName();
        this.description = resourceGroup.getDescription();
        this.recursive = resourceGroup.isRecursive();
    }
View Full Code Here

        return OUTCOME_SUCCESS;
    }

    public String update() {
        Subject subject = EnterpriseFacesContextUtility.getSubject();
        ResourceGroup resourceGroup = EnterpriseFacesContextUtility.getResourceGroup();

        resourceGroup.setName(this.name);
        resourceGroup.setDescription(this.description);
        resourceGroup.setRecursive(this.recursive);

        try {
            // pass null to let the method try to figure out the change
            this.resourceGroupManager.updateResourceGroup(subject, resourceGroup);
        } catch (ResourceGroupUpdateException rgue) {
View Full Code Here

    }

    public ConfigurationSet getConfigurationSet() {
        if (configurationSet == null) {
            Subject subject = EnterpriseFacesContextUtility.getSubject();
            ResourceGroup group = EnterpriseFacesContextUtility.getResourceGroup();
            int groupResourceConfigurationUpdateId = getGroupResourceConfigurationUpdateId();

            this.resourceConfigurations = this.configurationManager.getResourceConfigurationMapForGroupUpdate(
                getSubject(), groupResourceConfigurationUpdateId);
            this.configurationSet = GroupResourceConfigurationUtility.buildConfigurationSet(subject, group,
View Full Code Here

        }
        return;
    }

    private ResourceGroup loadGroup() throws Exception {
        ResourceGroup group;
        try {
            group = EnterpriseFacesContextUtility.getResourceGroup();
        } catch (Exception e) {
            throw new Exception("No group is associated with this request ('groupId' request parameter is not set).");
        }
        if (group.getGroupCategory() != GroupCategory.COMPATIBLE) {
            throw new Exception("Group with id " + group.getId() + " is not a compatible group.");
        }
        return group;
    }
View Full Code Here

    @Override
    public GroupOperationSchedule scheduleGroupOperation(Subject subject, int compatibleGroupId,
        int[] executionOrderResourceIds, boolean haltOnFailure, String operationName, Configuration parameters,
        Trigger trigger, String notes) throws SchedulerException {
        ResourceGroup group = getCompatibleGroupIfAuthorized(subject, compatibleGroupId);

        ensureControlPermission(subject, group);

        validateOperationNameAndParameters(group.getResourceType(), operationName, parameters);

        JobDataMap jobDataMap = new JobDataMap();
        jobDataMap.put(OperationJob.DATAMAP_STRING_OPERATION_NAME, operationName);
        putDisplayName(jobDataMap, group.getResourceType().getId(), operationName);

        if (parameters != null) {
            if (parameters.getId() == 0) {
                entityManager.persist(parameters);
            }

            jobDataMap.putAsString(OperationJob.DATAMAP_INT_PARAMETERS_ID, parameters.getId());
        }

        jobDataMap.putAsString(OperationJob.DATAMAP_INT_SUBJECT_ID, subject.getId());
        jobDataMap.putAsString(GroupOperationJob.DATAMAP_INT_GROUP_ID, group.getId());
        jobDataMap.putAsString(GroupOperationJob.DATAMAP_BOOL_HALT_ON_FAILURE, haltOnFailure);

        if ((executionOrderResourceIds != null) && (executionOrderResourceIds.length > 0)) {
            StringBuilder orderString = new StringBuilder();
            orderString.append(executionOrderResourceIds[0]);
View Full Code Here

    }

    @Override
    public void unscheduleGroupOperation(Subject subject, String jobId, int resourceGroupId) throws UnscheduleException {
        try {
            ResourceGroup group = resourceGroupManager.getResourceGroupById(subject, resourceGroupId,
                GroupCategory.COMPATIBLE);

            ensureControlPermission(subject, group);

            getCompatibleGroupIfAuthorized(subject, resourceGroupId); // just want to do this to check for permissions
View Full Code Here

        return operationSchedules;
    }

    @Override
    public List<GroupOperationSchedule> findScheduledGroupOperations(Subject subject, int groupId) throws Exception {
        ResourceGroup group = getCompatibleGroupIfAuthorized(subject, groupId);

        List<GroupOperationSchedule> operationSchedules = new ArrayList<GroupOperationSchedule>();

        String groupName = createJobGroupName(group);
        String[] jobNames = scheduler.getJobNames(groupName);
View Full Code Here

            int configId = jobDataMap.getIntFromString(OperationJob.DATAMAP_INT_PARAMETERS_ID);
            parameters = entityManager.find(Configuration.class, configId);
        }

        int groupId = jobDataMap.getIntFromString(GroupOperationJob.DATAMAP_INT_GROUP_ID);
        ResourceGroup group = getCompatibleGroupIfAuthorized(subject, groupId);

        List<Resource> executionOrder = null;

        if (jobDataMap.containsKey(GroupOperationJob.DATAMAP_INT_ARRAY_EXECUTION_ORDER)) {
            // if this property exists in the data map, we are assured that it has at least one ID in it
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.resource.group.ResourceGroup

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.