Package org.rhq.core.domain.operation

Examples of org.rhq.core.domain.operation.OperationDefinition


                                                Configuration parameters,
                                                Resource resource,
                                                ResourceType resourceType)
    {
        OperationHistory operationHistory = null;
        OperationDefinition operationDefinition = getOperationDefinition(operationName, resourceType);
        if (operationDefinition != null)
        {
            int id = jobNameId.incrementAndGet();
            String jobName = operationDefinition.getName() + "-" + id;
            operationHistory =
                    new ResourceOperationHistory(jobName,
                            "",
                            resource.getName(),
                            operationDefinition,
View Full Code Here


    }

    private static OperationDefinition getOperationDefinition(String operationName, ResourceType resourceType)
    {
        Set<OperationDefinition> operationDefinitions = resourceType.getOperationDefinitions();
        OperationDefinition operationDefinition = null;
        for (OperationDefinition definition : operationDefinitions)
        {
            if (definition.getName().equals(operationName))
            {
                operationDefinition = definition;
View Full Code Here

     */
    public String invokeOperation()
    {
        //this.facesMessages.clear();
        ResourceType resourceType = getResourceType();
        OperationDefinition operationDef = getOperationDefinition(resourceType, this.selectedOperationName);
        ConfigurationDefinition paramDef = operationDef.getParametersConfigurationDefinition();
        if (paramDef != null && !paramDef.getPropertyDefinitions().isEmpty() && this.selectedOperationParameters == null)
        {
            initSelectedOperationInfo();
            return "missingParams";
        }
        else
        {
            OperationHistory newOperationHistory = this.historyManager.addOperationHistory(operationDef.getName(),
                    this.selectedOperationParameters, this.currentResource, resourceType);
            // Null this out as soon as we're done with it, so it won't carry over to the next request.
            this.selectedOperationParameters = null;
            ResourceManager resourceManager = ResourceManagerFactory.resourceManager();
            String jobId = newOperationHistory.getJobId().toString();
            try
            {
                resourceManager.invokeOperation(this.currentResource, operationDef, newOperationHistory.getParameters(),
                        jobId);
                this.facesMessages.add("The #0 operation has been invoked. See the operation history below for the results once the operation has completed.",
                        operationDef.getDisplayName());
            }
            catch (RuntimeException e)
            {
                newOperationHistory.setStatus(OperationRequestStatus.FAILURE);
                newOperationHistory.setErrorMessage(e.toString());
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.operation.OperationDefinition

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.