Package org.graylog2.restclient.models

Examples of org.graylog2.restclient.models.Stream


    @Test
    public void testSingleExecute() throws Exception {
        setupNodes(AddressNodeId.create("http://horst:12900"));

        // we only have one node configured here
        final Node node = serverNodes.any();
        api.setHttpClient(client);

        final ApiRequestBuilder<EmptyResponse> requestBuilder =
                api.get(EmptyResponse.class)
                        .path("/some/resource")
View Full Code Here


    public void testParallelExecution() throws Exception {
        setupNodes(AddressNodeId.create("http://horst1:12900"), AddressNodeId.create("http://horst2:12900"));

        final Collection<Node> nodes = serverNodes.all();
        final Iterator<Node> it = nodes.iterator();
        Node node1 = it.next();
        Node node2 = it.next();
        api.setHttpClient(client);

        final ApiRequestBuilder<EmptyResponse> requestBuilder = api.get(EmptyResponse.class).path("/some/resource");
        final URL url1 = requestBuilder.prepareUrl(node1);
        final URL url2 = requestBuilder.prepareUrl(node2);
View Full Code Here

        final ArrayList<Node> nodes = Lists.newArrayList();
        for (AddressNodeId n : nodeDesc) {
            NodeSummaryResponse r = new NodeSummaryResponse();
            r.transportAddress = n.address;
            r.id = n.nodeId;
            final Node node = factory.fromSummaryResponse(r);
            node.touch();
            nodes.add(node);
        }
        serverNodes.put(nodes);
    }
View Full Code Here

public class SearchRouteHelper {

    public static Call getRoute(UniversalSearch search,
                                Http.Request request,
                                int page) {
        SearchSort order = search.getOrder();
        return getRoute(search, request, page, order.getField(), order.getDirection().toString().toLowerCase());
    }
View Full Code Here

            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

        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

    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

    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

        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

            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

TOP

Related Classes of org.graylog2.restclient.models.Stream

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.