Package org.graylog2.inputs.codecs

Examples of org.graylog2.inputs.codecs.GelfCodec$Config


            final String sessionId = token.getPrincipal().toString();
            response = api.get(UserResponse.class)
                    .path("/users/{0}", token.getUsername())
                    .session(sessionId)
                    .execute();
            final User user = userFactory.fromResponse(response, sessionId);

            UserService.setCurrent(user);
            user.setSubject(new Subject.Builder(SecurityUtils.getSecurityManager())
                    .principals(new SimplePrincipalCollection(user.getName(), "REST realm"))
                    .authenticated(true)
                    .buildSubject());
        } catch (IOException e) {
            throw new Graylog2ServerUnavailableException("Could not connect to Graylog2 Server.", e);
        } catch (APIException e) {
View Full Code Here


    public List<Alert> getAlertsSince(int since) throws APIException, IOException {
        List<Alert> alerts = Lists.newArrayList();

        for (AlertSummaryResponse alert : getAlertsInformation(since).alerts) {
            alerts.add(new Alert(alert));
        }

        return alerts;
    }
View Full Code Here

        }
        return subject;
    }

    public boolean setStartpage(Startpage startpage) {
        ChangeUserRequest cur = new ChangeUserRequest(this);

        if (startpage == null) {
            cur.startpage.type = null;
            cur.startpage.id = null;
        } else {
View Full Code Here

        addOutputs(streamId, outputs);
    }

    public void addOutputs(String streamId, Set<String> outputIds) throws APIException, IOException {
        AddOutputRequest request = new AddOutputRequest();
        request.outputs = outputIds;
        api.path(routes.StreamOutputResource().add(streamId)).expect(Http.Status.CREATED).body(request).execute();
    }
View Full Code Here

                        .path("/some/resource")
                        .unauthenticated()
                        .node(node)
                        .timeout(1, TimeUnit.SECONDS);
        stubHttpProvider.expectResponse(requestBuilder.prepareUrl(node), 200, "{}");
        final EmptyResponse response = requestBuilder.execute();

        Assert.assertNotNull(response);
        Assert.assertTrue(stubHttpProvider.isExpectationsFulfilled());
    }
View Full Code Here

    private NaturalDateTest(ApiClient api) {
        this.api = api;
    }

    public Map<String, String> test(String string) throws APIException, IOException {
        NaturalDateTestResponse r = api.get(NaturalDateTestResponse.class)
                .path("/tools/natural_date_tester")
                .queryParam("string", string)
                .execute();

        Map<String, String> result = Maps.newHashMap();
View Full Code Here

    private RegexTest(ApiClient api) {
        this.api = api;
    }

    public Map<String, Object> test(String regex, String string) throws IOException, APIException {
        RegexTestResponse r = api.get(RegexTestResponse.class)
                .path("/tools/regex_tester")
                .queryParam("regex", regex)
                .queryParam("string", string)
                .execute();
View Full Code Here

        final String userName = credString[0];
        final String password = credString[1];

        try {
            SessionCreateResponse session = sessionService.create(userName, password, request.remoteAddress());
            return userService.retrieveUserWithSessionId(userName, session.sessionId);
        } catch (IOException e) {
            log.error("Could not reach graylog2 server", e);
        } catch (APIException e) {
            log.error("Unauthorized to load user " + userName, e);
View Full Code Here

    private SplitAndIndexTest(ApiClient api) {
        this.api = api;
    }

    public Map<String, Object> test(String splitBy, int index, String string) throws IOException, APIException {
        SplitAndIndexTestResponse r = api.get(SplitAndIndexTestResponse.class)
                .path("/tools/split_and_index_tester")
                .queryParam("split_by", splitBy)
                .queryParam("index", index)
                .queryParam("string", string)
                .execute();
View Full Code Here

    private SubstringTest(ApiClient api) {
        this.api = api;
    }

    public Map<String, Object> test(int start, int end, String string) throws IOException, APIException {
        SubstringTestResponse r = api.get(SubstringTestResponse.class)
                .path("/tools/substring_tester")
                .queryParam("begin_index", start)
                .queryParam("end_index", end)
                .queryParam("string", string)
                .execute();
View Full Code Here

TOP

Related Classes of org.graylog2.inputs.codecs.GelfCodec$Config

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.