Examples of AlertNotification


Examples of org.rhq.core.domain.alert.notification.AlertNotification

                @Override
                public void onDoubleClick(DoubleClickEvent event) {
                    ListGrid listGrid = (ListGrid) event.getSource();
                    ListGridRecord[] selectedRows = listGrid.getSelectedRecords();
                    if (selectedRows != null && selectedRows.length == 1) {
                        AlertNotification notif = (getDataSource()).copyValues(selectedRows[0]);
                        popupNotificationEditor(notif);
                    }
                }
            });

            addTableAction(MSG.common_button_add(), null, ButtonColor.BLUE, new AbstractTableAction() {
                @Override
                public void executeAction(ListGridRecord[] selection, Object actionValue) {
                    popupNotificationEditor(null);
                }
            });

            addTableAction(MSG.common_button_delete(), MSG.view_alert_definition_notification_editor_delete_confirm(),
                ButtonColor.RED, new AbstractTableAction(TableActionEnablement.ANY) {
                    @Override
                    public void executeAction(ListGridRecord[] selection, Object actionValue) {
                        for (ListGridRecord record : selection) {
                            AlertNotification notif = (getDataSource()).copyValues(record);
                            notifications.remove(notif);
                        }
                        table.refresh();
                    }
                });
View Full Code Here

Examples of org.rhq.core.domain.alert.notification.AlertNotification

        return null;
    }

    public String getAsString(FacesContext context, UIComponent component, Object notificationObject) {
        AlertNotification notification = (AlertNotification) notificationObject;

        return Integer.toString(notification.getId());
    }
View Full Code Here

Examples of org.rhq.modules.integrationTests.restApi.d.AlertNotification

            alertDefinition.setName("-x-test-definition");
            alertDefinition.setEnabled(false);
            alertDefinition.setPriority("LOW");
            alertDefinition.setDampeningCategory("NONE");

            AlertNotification notification = new AlertNotification("Invalid sender name");
            alertDefinition.getNotifications().add(notification);

            given()
                .header(acceptJson)
                .contentType(ContentType.JSON)
View Full Code Here

Examples of org.rhq.modules.integrationTests.restApi.d.AlertNotification

        int definitionId = createEmptyAlertDefinition(false);

        // Now add a condition
        try {

            AlertNotification notification = new AlertNotification("Direct Emails"); // short-name from server plugin descriptor
            notification.getConfig().put("emailAddress", "root@eruditorium.org");

            given()
                .header(acceptJson)
                .contentType(ContentType.JSON)
                .body(notification)
View Full Code Here

Examples of org.rhq.modules.integrationTests.restApi.d.AlertNotification

         assert discoveryDefinitionId !=-1 : "No discovery operation found";

        // Now add a condition
        try {

            AlertNotification notification = new AlertNotification("Resource Operations"); // short-name from server plugin descriptor
            notification.getConfig().put("selection-mode", "SELF");
            notification.getConfig().put("operation-definition-id", discoveryDefinitionId);
            notification.getExtraConfig().put("detailedDiscovery", false);

            given()
                .header(acceptJson)
                .contentType(ContentType.JSON)
                .body(notification)
                .pathParam("defId", definitionId)
                .log().everything()
            .expect()
                .statusCode(201)
                .log().everything()
            .when()
                .post("/alert/definition/{defId}/notifications");

            // Retrieve the definition with the added condition
            AlertDefinition updatedDefinition =
            given()
                .pathParam("id",definitionId)
                .queryParam("full",true)
            .expect()
                .statusCode(200)
                .log().everything()
            .when()
                .get("/alert/definition/{id}")
                .as(AlertDefinition.class);

            int size = updatedDefinition.getNotifications().size();
            assert size ==1 : "Did not find 1 notification, but " + size;
            AlertNotification newNotification = updatedDefinition.getNotifications().get(0);
            assert newNotification.getExtraConfig().size() == 1;
            assert (Boolean) newNotification.getExtraConfig().get("detailedDiscovery") == false;
        }

        finally {
            // delete the definition again
            cleanupDefinition(definitionId);
View Full Code Here

Examples of org.rhq.modules.integrationTests.restApi.d.AlertNotification

        int definitionId = createEmptyAlertDefinition(false);

        // Now add a notification
        try {

            AlertNotification notification = new AlertNotification("Direct Emails"); // short-name from server plugin descriptor
            notification.getConfig().put("emailAddress", "root@eruditorium.org");

            Integer nid =
            given()
                .header(acceptJson)
                .contentType(ContentType.JSON)
                .body(notification)
                .pathParam("defId",definitionId)
            .expect()
                .statusCode(201)
                .log().ifError()
            .when()
                .post("/alert/definition/{defId}/notifications")
            .getBody()
                .jsonPath().get("id");

            // Update the notification
            notification.getConfig().put("emailAddress", "root@eruditorium.org,enoch@root.com");
            given()
                .header(acceptJson)
                .contentType(ContentType.JSON)
                .body(notification)
                .pathParam("nid",nid)
View Full Code Here

Examples of org.rhq.modules.integrationTests.restApi.d.AlertNotification

        int definitionId = createEmptyAlertDefinition(false);

        // Now add a condition
        try {

            AlertNotification notification = new AlertNotification("Frobnitz"); // short-name from server plugin descriptor

            given()
                .header(acceptJson)
                .contentType(ContentType.JSON)
                .body(notification)
View Full Code Here

Examples of org.rhq.modules.integrationTests.restApi.d.AlertNotification

        int definitionId = createEmptyAlertDefinition(false);

        // Now add a condition
        try {

            AlertNotification notification = new AlertNotification("Direct Emails"); // short-name from server plugin descriptor
            notification.getConfig().put("emailAddress", "root@eruditorium.org");

            given()
                .header(acceptJson)
                .contentType(ContentType.JSON)
                .body(notification)
                .pathParam("defId",definitionId)
            .expect()
                .statusCode(201)
                .log().everything()
            .when()
                .post("/alert/definition/{defId}/notifications");

            // Retrieve the definition with the added condition
            AlertDefinition updatedDefinition =
            given()
                .pathParam("id",definitionId)
                .queryParam("full",true)
            .expect()
                .statusCode(200)
                .log().everything()
            .when()
                .get("/alert/definition/{id}")
                .as(AlertDefinition.class);

            int size = updatedDefinition.getNotifications().size();
            assert size ==1 : "Did not find 1 notifications, but " + size;

            AlertNotification secondNotification = new AlertNotification("System Roles");
            secondNotification.getConfig().put("roleId","|1]");
            given()
                .header(acceptJson)
                .contentType(ContentType.JSON)
                .body(secondNotification)
                .pathParam("defId",definitionId)
View Full Code Here

Examples of org.rhq.modules.integrationTests.restApi.d.AlertNotification

            AlertDefinition alertDefinition = new AlertDefinition();
            alertDefinition.setName("-x-test-full-definition");
            alertDefinition.setEnabled(false);
            alertDefinition.setPriority("HIGH");

            AlertNotification notification = new AlertNotification("Direct Emails");
            notification.getConfig().put("emailAddress","enoch@root.org");
            alertDefinition.getNotifications().add(notification);

            AlertCondition condition = new AlertCondition("AVAILABILITY", "AVAIL_GOES_DOWN");
            alertDefinition.getConditions().add(condition);
View Full Code Here

Examples of org.rhq.modules.integrationTests.restApi.d.AlertNotification

            AlertDefinition alertDefinition = new AlertDefinition();
            alertDefinition.setName("-x-test-full-definition");
            alertDefinition.setEnabled(false);
            alertDefinition.setPriority("HIGH");

            AlertNotification notification = new AlertNotification("Direct Emails");
            notification.getConfig().put("emailAddress","enoch@root.org");
            alertDefinition.getNotifications().add(notification);

            List<AlertCondition> conditions = alertDefinition.getConditions();

            AlertCondition condition = new AlertCondition("AVAILABILITY", "AVAIL_GOES_DOWN");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.