Package org.rhq.core.domain.operation

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


        assert op.getDescription().equals(OP_DESC);
    }

    private void assertVersion2(ResourceType resourceType) {
        assert resourceType.getOperationDefinitions().size() == 1;
        OperationDefinition op = resourceType.getOperationDefinitions().iterator().next();
        assert op.getName().equals(NEW_OP_NAME);
        assert op.getTimeout().intValue() == NEW_OP_TIMEOUT;
        assert op.getDescription().equals(NEW_OP_DESC);
    }
View Full Code Here


        assertVersion2(resourceType);
    }

    private void assertVersion1(ResourceType resourceType) {
        assert resourceType.getOperationDefinitions().size() == 1;
        OperationDefinition op = resourceType.getOperationDefinitions().iterator().next();
        assert op.getName().equals(OP_NAME);
        assert op.getTimeout().intValue() == OP_TIMEOUT;
        assert op.getDescription().equals(OP_DESC);
    }
View Full Code Here

        assert op.getDescription().equals(OP_DESC);
    }

    private void assertVersion2(ResourceType resourceType) {
        assert resourceType.getOperationDefinitions().size() == 1;
        OperationDefinition op = resourceType.getOperationDefinitions().iterator().next();
        assert op.getName().equals(NEW_OP_NAME);
        assert op.getTimeout().intValue() == NEW_OP_TIMEOUT;
        assert op.getDescription().equals(NEW_OP_DESC);
    }
View Full Code Here

    private void assertVersion1(ResourceType resourceType) {
        PropertyGroupDefinition group;
        PropertyDefinition prop;
        ProcessScan processScan;
        OperationDefinition op;
        MeasurementDefinition metric;
        EventDefinition event;
        DriftDefinitionTemplate drift;
        BaseDirectory driftBasedir;
        ResourceTypeBundleConfiguration bundle;
        BundleDestinationBaseDirectory bundleBasedir;

        assert resourceType.getChildSubCategories() == null;

        assert resourceType.getPluginConfigurationDefinition().getGroupDefinitions().size() == 1;
        group = resourceType.getPluginConfigurationDefinition().getGroupDefinitions().get(0);
        assert group.getName().equals(PC_GROUP);
        assert group.isDefaultHidden() == PC_GROUP_HIDDEN;
        prop = resourceType.getPluginConfigurationDefinition().get(PC_PROP);
        assert prop != null;
        assert prop.getName().equals(PC_PROP);
        assert prop.isRequired() == PC_PROP_REQUIRED;
        assert prop.getPropertyGroupDefinition().getName().equals(PC_GROUP);

        assert resourceType.getProcessScans().size() == 1;
        processScan = resourceType.getProcessScans().iterator().next();
        assert processScan.getName().equals(PROCESS_SCAN_NAME);
        assert processScan.getQuery().equals(PROCESS_SCAN_QUERY);

        assert resourceType.getOperationDefinitions().size() == 1;
        op = resourceType.getOperationDefinitions().iterator().next();
        assert op.getName().equals(OP_NAME);
        assert op.getTimeout().intValue() == OP_TIMEOUT;
        assert op.getDescription().equals(OP_DESC);

        assert resourceType.getMetricDefinitions().size() == 2; // include built-in Availability metric
        metric = resourceType.getMetricDefinitions().iterator().next();
        assert metric.getName().equals(METRIC_PROP);
        assert metric.getDefaultInterval() == METRIC_DEFAULT_INTERVAL;
View Full Code Here

            Label title = new Label("<h4>" + MSG.view_operationHistoryDetails_parameters() + "</h4>");
            title.setHeight(27);
            parametersSection.addMember(title);

            OperationDefinition operationDefinition = operationHistory.getOperationDefinition();
            ConfigurationDefinition parametersConfigurationDefinition = operationDefinition
                .getParametersConfigurationDefinition();
            if (parametersConfigurationDefinition != null
                && !parametersConfigurationDefinition.getPropertyDefinitions().isEmpty()) {
                ConfigurationEditor editor = new ConfigurationEditor(parametersConfigurationDefinition,
                    operationHistory.getParameters());
View Full Code Here

        idItem.setValue(operationHistory.getId());
        items.add(idItem);

        StaticTextItem operationItem = new StaticTextItem(AbstractOperationHistoryDataSource.Field.OPERATION_NAME,
            MSG.view_operationHistoryDetails_operation());
        OperationDefinition operationDefinition = operationHistory.getOperationDefinition();
        operationItem.setValue(operationDefinition.getDisplayName());
        items.add(operationItem);

        StaticTextItem submittedItem = new StaticTextItem(AbstractOperationHistoryDataSource.Field.STARTED_TIME,
            MSG.view_operationHistoryDetails_dateSubmitted());
        if (operationHistory.getStartedTime() == 0) {
View Full Code Here

        assert resourceType.getParentResourceTypes().iterator().next().getName().equals("OuterServerB");
    }

    private void assertVersion1(ResourceType resourceType) {
        assert resourceType.getOperationDefinitions().size() == 1;
        OperationDefinition op = resourceType.getOperationDefinitions().iterator().next();
        assert op.getName().equals(OP_NAME);
        assert op.getTimeout().intValue() == OP_TIMEOUT;
        assert op.getDescription().equals(OP_DESC);
    }
View Full Code Here

        assert op.getDescription().equals(OP_DESC);
    }

    private void assertVersion2(ResourceType resourceType) {
        assert resourceType.getOperationDefinitions().size() == 1;
        OperationDefinition op = resourceType.getOperationDefinitions().iterator().next();
        assert op.getName().equals(NEW_OP_NAME);
        assert op.getTimeout().intValue() == NEW_OP_TIMEOUT;
        assert op.getDescription().equals(NEW_OP_DESC);
    }
View Full Code Here

        @ApiParam("Id of the definition to retrieve") @PathParam("id") int definitionId,
        @ApiParam("Id of a resource that supports this operation") @QueryParam("resourceId") Integer resourceId,
        @Context UriInfo uriInfo,
        @Context Request request) {

        OperationDefinition def;
        def = getFromCache(definitionId, OperationDefinition.class);
        if (def==null) {
            try {
                def = opsManager.getOperationDefinition(caller,definitionId);
                putToCache(definitionId,OperationDefinition.class,def);
            }
            catch (OperationDefinitionNotFoundException ode) {
                throw new StuffNotFoundException("Operation definition with id " + definitionId);
            }
        }

        EntityTag eTag = new EntityTag(Integer.toHexString(def.hashCode()));
        Response.ResponseBuilder builder = request.evaluatePreconditions(eTag);
        if (builder==null) {

            OperationDefinitionRest odr = new OperationDefinitionRest();
            odr.setId(def.getId());
            odr.setName(def.getName());

            copyParamsForDefinition(def, odr);

            builder=Response.ok(odr);
View Full Code Here

        catch (ResourceNotFoundException rnfe) {
            throw new StuffNotFoundException("resource with id " + resourceId);
        }


        OperationDefinition opDef;
        try {
            opDef = opsManager.getOperationDefinition(caller,definitionId);
        }
        catch (OperationDefinitionNotFoundException odnfe) {
            throw new StuffNotFoundException("Operation definition with id " + definitionId);
        }
        OperationRest operationRest = new OperationRest(resourceId,definitionId);
        operationRest.setId((int)System.currentTimeMillis()); // TODO better id (?)(we need one for pUT later on)
        operationRest.setReadyToSubmit(false);
        operationRest.setName(opDef.getName());
        ConfigurationDefinition paramDefinition = opDef.getParametersConfigurationDefinition();
        if (paramDefinition != null) {
            for (PropertyDefinition propDefs : paramDefinition.getNonGroupedProperties()) { // TODO extend to all properties ?
                operationRest.getParams().put(propDefs.getName(),"TODO"); // TODO type and value of the value
            }
        }
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.