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

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


        return criteria;
    }

    @Override
    protected void executeAdd(Record recordToAdd, final DSRequest request, final DSResponse response) {
        final GroupDefinition newGroupDefinition = copyValues(recordToAdd);
        final String name = newGroupDefinition.getName();

        GWTServiceLookup.getResourceGroupService().createGroupDefinition(newGroupDefinition,
            new AsyncCallback<GroupDefinition>() {
                @Override
                public void onFailure(Throwable caught) {
View Full Code Here


    }

    @Override
    protected void executeUpdate(Record editedRecord, Record oldRecord, final DSRequest request,
        final DSResponse response) {
        final GroupDefinition updatedGroupDefinition = copyValues(editedRecord);
        final String name = updatedGroupDefinition.getName();

        GWTServiceLookup.getResourceGroupService().updateGroupDefinition(updatedGroupDefinition,
            new AsyncCallback<Void>() {
                @Override
                public void onFailure(Throwable caught) {
View Full Code Here

            });
    }

    @Override
    public GroupDefinition copyValues(Record from) {
        GroupDefinition groupDefinition = new GroupDefinition();
        groupDefinition.setId(from.getAttributeAsInt("id"));
        groupDefinition.setName(from.getAttributeAsString("name"));
        groupDefinition.setDescription(from.getAttributeAsString("description"));
        groupDefinition.setExpression(from.getAttributeAsString("expression"));
        groupDefinition.setRecursive(from.getAttributeAsBoolean("recursive"));
        String recalcInt = from.getAttributeAsString("recalculationInterval");
        //groupDefinition.setRecalculationInterval((recalcInt != null) ? Long.parseLong(recalcInt) : 0L);
        // convert the recalculation interval from minutes to millis for db storage
        groupDefinition.setRecalculationInterval((recalcInt != null) ? Long.parseLong(recalcInt) * 60 * 1000 : 0L);
        // modifiedTime, createdTime, and lastCalculationTime are updated by GroupDefinitionManagerBean only
        // nextCalculationTime is a non-persistent, derived field

        return groupDefinition;
    }
View Full Code Here

                                    MSG.view_dynagroup_singleSaveFailure(String.valueOf(results.length)));
                            }

                        } else {
                            Record newRecord = results[0];
                            GroupDefinition newGroupDefinition = GroupDefinitionDataSource.getInstance().copyValues(
                                newRecord);
                            if (recalc) {
                                recalculate(dynaGroupChildrenView, newGroupDefinition.getId());
                            }
                            CoreGUI.goToView(basePath + "/" + newGroupDefinition.getId());
                        }
                    } else {
                        dynaGroupChildrenView.refresh();
                        if (recalc) {
                            recalculate(dynaGroupChildrenView, groupDefinitionId);
View Full Code Here

    private void lookupDetails(final int groupDefinitionId) {
        ResourceGroupDefinitionCriteria criteria = new ResourceGroupDefinitionCriteria();
        criteria.addFilterId(groupDefinitionId);

        if (groupDefinitionId == 0) {
            GroupDefinition newGroupDefinition = new GroupDefinition();
            setGroupDefinition(newGroupDefinition);
            switchToEditMode();
        } else {
            GWTServiceLookup.getResourceGroupService().findGroupDefinitionsByCriteria(criteria,
                new AsyncCallback<PageList<GroupDefinition>>() {
                    public void onFailure(Throwable caught) {
                        CoreGUI.getErrorHandler().handleError(
                            MSG.view_dynagroup_loadDefinitionFailure(String.valueOf(groupDefinitionId)), caught);

                        History.back();
                    }

                    public void onSuccess(PageList<GroupDefinition> result) {
                        if (result.size() == 0) {
                            CoreGUI.getErrorHandler().handleError(
                                MSG.view_dynagroup_loadDefinitionMissing(String.valueOf(groupDefinitionId)));
                            History.back();
                        } else {
                            GroupDefinition existingGroupDefinition = result.get(0);
                            setGroupDefinition(existingGroupDefinition);
                            switchToEditMode();
                        }
                    }
                });
View Full Code Here

TOP

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

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.