Examples of Stream


Examples of org.graylog2.restclient.models.Stream

            case EMAIL_TRANSPORT_FAILED:
                return new EmailTransportFailedNotification(notification);
            case STREAM_PROCESSING_DISABLED:
                String streamTitle;
                try {
                    final Stream stream = streamService.get(notification.getDetail("stream_id").toString());
                    streamTitle = stream.getTitle();
                } catch (APIException | IOException e) {
                    streamTitle = "(Stream title unavailable)";
                }
                int faultCount = (int) notification.getDetail("fault_count");
                return new StreamProcessingDisabledNotification(notification, streamTitle, faultCount);
View Full Code Here

Examples of org.graylog2.restclient.models.Stream

        this.streamService = streamService;
        this.outputService = outputService;
    }

    public Result index(String streamId) throws IOException, APIException {
        final Stream stream = streamService.get(streamId);

        if (stream == null) {
            flash("error", "Stream <" + streamId + "> does not exit!");
            return redirect(routes.StreamsController.index());
        }

        List<Output> outputs = streamService.getOutputs(streamId);

        List<Output> otherOutputs = outputService.list();
        otherOutputs.removeAll(outputs);

        BreadcrumbList bc = new BreadcrumbList();
        bc.addCrumb("Streams", routes.StreamsController.index());
        bc.addCrumb("Outputs of " + stream.getTitle(), routes.StreamOutputsController.index(stream.getId()));

        return ok(views.html.streams.outputs.index.render(currentUser(),
                bc,
                outputs,
                otherOutputs,
View Full Code Here

Examples of org.graylog2.restclient.models.Stream

    public Result create(String streamId) throws APIException, IOException {
        if (!Permissions.isPermitted(RestPermissions.OUTPUTS_EDIT)) {
            return redirect(routes.StartpageController.redirect());
        }

        final Stream stream = streamService.get(streamId);

        if (stream == null) {
            flash("error", "Stream <" + streamId + "> does not exist!");
            return redirect(routes.StreamsController.index());
        }
View Full Code Here

Examples of org.graylog2.restclient.models.Stream

    public Result add(String streamId) throws IOException, APIException {
        final Form<AddOutputToStreamForm> form = form(AddOutputToStreamForm.class).bindFromRequest();
        final AddOutputToStreamForm request = form.get();
        String outputId = request.outputId;

        final Stream stream = streamService.get(streamId);

        if (stream == null) {
            flash("error", "Stream <" + streamId + "> does not exist!");
            return redirect(routes.StreamsController.index());
        }
View Full Code Here

Examples of org.graylog2.restclient.models.Stream

        flash("succes", "Output <" + output.getTitle() + "> has been added to Stream!");

        return redirect(routes.StreamOutputsController.index(streamId));
    }
    public Result remove(String streamId, String outputId) throws APIException, IOException {
        final Stream stream = streamService.get(streamId);

        if (stream == null) {
            flash("error", "Stream <" + streamId + "> does not exist!");
            return redirect(routes.StreamsController.index());
        }
View Full Code Here

Examples of org.graylog2.restclient.models.Stream

            List<Map<String, Object>> alerts = Lists.newArrayList();
            for (Alert alert : streamService.allowedAlertsSince(since)) {
                Map<String, Object> alertMap = Maps.newHashMap();

                Stream stream = streamService.get(alert.getStreamId());

                alertMap.put("id", alert.getId());
                alertMap.put("stream_id", alert.getStreamId());
                alertMap.put("stream_name", stream.getTitle());
                alertMap.put("condition_id", alert.getConditionId());
                alertMap.put("parameters", alert.getConditionParameters());
                alertMap.put("triggered_at", alert.getTriggeredAt().getMillis() / 1000);
                alertMap.put("description", alert.getDescription());
View Full Code Here

Examples of org.graylog2.restclient.models.Stream

        this.streamService = streamService;
        this.streamRuleService = streamRuleService;
    }

    public Result index(String streamId) {
        Stream stream;
        try {
            stream = streamService.get(streamId);
        } catch (APIException e) {
            String message = "Could not fetch stream rules. We expect HTTP 200, but got a HTTP " + e.getHttpCode() + ".";
            return status(504, views.html.errors.error.render(message, e, request()));
        } catch (IOException e) {
            return status(504, views.html.errors.error.render(ApiClient.ERROR_MSG_IO, e, request()));
        }

        return ok(views.html.streamrules.index.render(currentUser(), stream, stream.getStreamRules(), standardBreadcrumbs(stream)));
    }
View Full Code Here

Examples of org.graylog2.restclient.models.Stream

        return ok(views.html.streams.new_stream.render(currentUser()));
    }

    public Result edit(String streamId) {
        try {
            Stream stream = streamService.get(streamId);
            return ok(views.html.streams.edit.render(currentUser(), stream));
        } catch (IOException e) {
            return status(504, views.html.errors.error.render(ApiClient.ERROR_MSG_IO, e, request()));
        } catch (APIException e) {
            String message = "Could not fetch stream. We expected HTTP 200, but got a HTTP " + e.getHttpCode() + ".";
View Full Code Here

Examples of org.graylog2.restclient.models.Stream

                        String sortField, String sortOrder,
                        String fields,
                        int displayWidth) {
        SearchSort sort = buildSearchSort(sortField, sortOrder);

        Stream stream;
        try {
            stream = streamService.get(streamId);
        } catch (IOException e) {
            return status(504, views.html.errors.error.render(ApiClient.ERROR_MSG_IO, e, request()));
        } catch (APIException e) {
View Full Code Here

Examples of org.graylog2.restclient.models.Stream

    }

    public Result streamThroughput(String streamId) {
        try {
            Map<String, Object> result = Maps.newHashMap();
            final Stream stream = streamService.get(streamId);
            long throughput = stream.getThroughput();
            result.put("throughput", throughput);
            return ok(Json.toJson(result));
        } catch (APIException e) {
            return status(504, "Could not load stream " + streamId);
        } catch (IOException e) {
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.