Package org.rhq.enterprise.server.operation

Examples of org.rhq.enterprise.server.operation.OperationManagerLocal


        @Override
        public PageList<GroupOperationHistory> fetchPage(PageControl pc) {
            Subject subject = EnterpriseFacesContextUtility.getSubject();
            ResourceGroup requestGroup = EnterpriseFacesContextUtility.getResourceGroup();
            OperationManagerLocal manager = LookupUtil.getOperationManager();

            if (requestGroup == null) {
                requestGroup = resourceGroup; // request not associated with a resource - use the resource we used before
            } else {
                resourceGroup = requestGroup; // request switched the resource this UI bean is using
            }

            PageList<GroupOperationHistory> results;
            results = manager.findPendingGroupOperationHistories(subject, requestGroup.getId(), pc);
            return results;
        }
View Full Code Here


        return numUpdated;
    }

    private void updateAgent(Resource agent, Server server) {
        OperationManagerLocal operationMgr = LookupUtil.getOperationManager();
        SubjectManagerLocal subjectMgr = LookupUtil.getSubjectManager();

        Configuration params = new Configuration();
        params.put(new PropertySimple("server", server.getAddress()));

        ResourceOperationSchedule schedule = operationMgr.scheduleResourceOperation(subjectMgr.getOverlord(),
            agent.getId(), "switchToServer", 0, 0, 0, 0, params, "Cloud Plugin: syncing server endpoint address");

        if (log.isDebugEnabled()) {
            log.debug("Schedule address sync for agent [name: " + agent.getName() + "].");
            log.debug("Operation schedule is " + schedule);
View Full Code Here

                } else {
                    resourceTypeId = cond.getAlertDefinition().getResource().getResourceType().getId();
                }

                String operationName = cond.getName();
                OperationManagerLocal operationManager = LookupUtil.getOperationManager();

                OperationDefinition definition = operationManager.getOperationDefinitionByResourceTypeAndName(
                    resourceTypeId, operationName, false);
                textValue.append(definition.getDisplayName()).append(' ');
            } catch (Exception e) {
                textValue.append(cond.getName()).append(' ');
            }
View Full Code Here

     * actions for the passed-in resource.
     */
    public static List<OptionItem> getControlActions(Subject subject, Integer id, FormContext context) throws Exception {
        List<OptionItem> operations = new ArrayList<OptionItem>();

        OperationManagerLocal operationManager = LookupUtil.getOperationManager();
        List<OperationDefinition> operationDefinitions = null;

        // need to eager load the definitions so the check against getParametersConfigurationDefinition succeeds below

        if (context == FormContext.Type) {
            operationDefinitions = operationManager.findSupportedResourceTypeOperations(subject, id, true);
        } else if (context == FormContext.Group) {
            operationDefinitions = operationManager.findSupportedGroupOperations(subject, id, true);
        } else if (context == FormContext.Resource) {
            operationDefinitions = operationManager.findSupportedResourceOperations(subject, id, true);
        } else {
            throw new IllegalArgumentException("Unsupported form context: " + context);
        }

        for (OperationDefinition definition : operationDefinitions) {
View Full Code Here

            return forward;
        }

        String selectedOperation = operationsForm.getControlAction();

        OperationManagerLocal operationManager = LookupUtil.getOperationManager();
        AlertTemplateManagerLocal alertTemplateManager = LookupUtil.getAlertTemplateManager();
        AlertDefinitionManagerLocal alertDefinitionManager = LookupUtil.getAlertDefinitionManager();
        GroupAlertDefinitionManagerLocal groupAlertDefinitionManager = LookupUtil.getGroupAlertDefinitionManager();

        Subject subject = RequestUtils.getSubject(request);
        AlertDefinition alertDefinition = AlertDefUtil.getAlertDefinition(request);

        OperationDefinition operationDefinition = null;

        if (selectedOperation.equals(EventConstants.CONTROL_ACTION_NONE) == false) {
            Integer operationId = Integer.parseInt(selectedOperation);

            operationDefinition = operationManager.getOperationDefinition(subject, operationId);
        }

        try {
            if (context == FormContext.Type) {
                alertTemplateManager.updateAlertTemplate(subject, alertDefinition, false);
View Full Code Here

        defForm.setBaselines(baselines);
        request.setAttribute("baselines", baselines); // need to duplicate this for the JavaScript on the page

        List<OptionItem> controlActions = new ArrayList<OptionItem>();
        OperationManagerLocal operationManager = LookupUtil.getOperationManager();
        // do not need to eagerly load the definitions because only name and displayName are needed
        for (OperationDefinition action : operationManager.findSupportedResourceTypeOperations(subject, type.getId(),
            false)) {
            OptionItem actionItem = new OptionItem(action.getDisplayName(), action.getName());
            controlActions.add(actionItem);
        }
View Full Code Here

            OperationPortletPreferences operationPreferences = preferences.getOperationPortletPreferences();

            displayLastCompleted = operationPreferences.useLastCompleted;
            displayNextScheduled = operationPreferences.useNextScheduled;

            OperationManagerLocal manager = LookupUtil.getOperationManager();
            ResourceManagerLocal resourceManager = LookupUtil.getResourceManager();
           
            if (operationPreferences.useLastCompleted) {
                PageControl pageControl = new PageControl(0, operationPreferences.lastCompleted);
                pageControl.initDefaultOrderingField("ro.createdTime", PageOrdering.DESC);
                PageList<ResourceOperationLastCompletedComposite> lastCompletedResourceOps =
                    manager.findRecentlyCompletedResourceOperations(user.getSubject(), null, pageControl);

                disambiguatedLastCompletedResourceOps = DisambiguatedResourceListUtil.disambiguate(
                    resourceManager, lastCompletedResourceOps, RESOURCE_OPERATION_RESOURCE_ID_EXTRACTOR);
               
                pageControl = new PageControl(0, operationPreferences.lastCompleted);
                pageControl.initDefaultOrderingField("go.createdTime", PageOrdering.DESC);
                lastCompletedGroupOps = manager.findRecentlyCompletedGroupOperations(user.getSubject(), pageControl);
            }

            if (operationPreferences.useNextScheduled) {
                PageControl pageControl = new PageControl(0, operationPreferences.nextScheduled);
                PageList<ResourceOperationScheduleComposite> nextScheduledResourceOps =
                    manager.findCurrentlyScheduledResourceOperations(user.getSubject(),
                    pageControl);

                disambiguatedNextScheduledResourceOps = DisambiguatedResourceListUtil.disambiguate(
                    resourceManager, nextScheduledResourceOps, RESOURCE_OPERATION_SCHEDULE_RESOURCE_ID_EXTRACTOR);
               
                pageControl = new PageControl(0, operationPreferences.nextScheduled);
                nextScheduledGroupOps = manager.findCurrentlyScheduledGroupOperations(user.getSubject(), pageControl);
            }
        } catch (Exception e) {
            if (log.isDebugEnabled()) {
                log.debug("Dashboard Portlet [ControlActions] experienced an error: " + e.getMessage(), e);
            } else {
View Full Code Here

TOP

Related Classes of org.rhq.enterprise.server.operation.OperationManagerLocal

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.