Package org.graylog2.database.validators

Examples of org.graylog2.database.validators.FilledStringValidator


    }

    @Override
    public Map<String, Validator> getValidations() {
        final ImmutableMap.Builder<String, Validator> validations = ImmutableMap.builder();
        validations.put(MessageInput.FIELD_INPUT_ID, new FilledStringValidator());
        validations.put(MessageInput.FIELD_TITLE, new FilledStringValidator());
        validations.put(MessageInput.FIELD_TYPE, new FilledStringValidator());
        validations.put(MessageInput.FIELD_CONFIGURATION, new MapValidator());
        validations.put(MessageInput.FIELD_CREATOR_USER_ID, new FilledStringValidator());
        validations.put(MessageInput.FIELD_CREATED_AT, new DateValidator());
        validations.put(MessageInput.FIELD_CONTENT_PACK, new OptionalStringValidator());

        return validations.build();
    }
View Full Code Here


    @Override
    public Map<String, Validator> getEmbeddedValidations(String key) {
        if (key.equals(EMBEDDED_EXTRACTORS)) {
            final ImmutableMap.Builder<String, Validator> validations = ImmutableMap.builder();
            validations.put(Extractor.FIELD_ID, new FilledStringValidator());
            validations.put(Extractor.FIELD_TITLE, new FilledStringValidator());
            validations.put(Extractor.FIELD_TYPE, new FilledStringValidator());
            validations.put(Extractor.FIELD_CURSOR_STRATEGY, new FilledStringValidator());
            validations.put(Extractor.FIELD_TARGET_FIELD, new FilledStringValidator());
            validations.put(Extractor.FIELD_SOURCE_FIELD, new FilledStringValidator());
            validations.put(Extractor.FIELD_CREATOR_USER_ID, new FilledStringValidator());
            validations.put(Extractor.FIELD_EXTRACTOR_CONFIG, new MapValidator());
        }

        if (key.equals(EMBEDDED_STATIC_FIELDS)) {
            return ImmutableMap.<String, Validator>of(
                    FIELD_STATIC_FIELD_KEY, new FilledStringValidator(),
                    FIELD_STATIC_FIELD_VALUE, new FilledStringValidator());
        }

        return Collections.emptyMap();
    }
View Full Code Here

        return configuration;
    }

    public Map<String, Validator> getValidations() {
        return ImmutableMap.<String, Validator>of(
                FIELD_TITLE, new FilledStringValidator(),
                FIELD_TYPE, new FilledStringValidator(),
                FIELD_CREATOR_USER_ID, new FilledStringValidator(),
                FIELD_CONTENT_PACK, new OptionalStringValidator());
    }
View Full Code Here

    }

    @Override
    public Map<String, Validator> getValidations() {
        Map<String, Validator> validations = Maps.newHashMap();
        validations.put(USERNAME, new FilledStringValidator());
        validations.put(TOKEN, new FilledStringValidator());
        validations.put(NAME, new FilledStringValidator());
        return validations;
    }
View Full Code Here

        return result;
    }

    public Map<String, Validator> getValidations() {
        return ImmutableMap.<String, Validator>builder()
                .put(FIELD_TITLE, new FilledStringValidator())
                .put(FIELD_CREATOR_USER_ID, new FilledStringValidator())
                .put(FIELD_CREATED_AT, new DateValidator())
                .put(FIELD_CONTENT_PACK, new OptionalStringValidator())
                .build();
    }
View Full Code Here

    @Override
    public Map<String, Validator> getEmbeddedValidations(String key) {
        if (key.equals(EMBEDDED_ALERT_CONDITIONS)) {
            return ImmutableMap.of(
                    "id", new FilledStringValidator(),
                    "parameters", new MapValidator());
        }

        return Collections.emptyMap();
    }
View Full Code Here

    }

    public Map<String, Validator> getValidations() {
        final ImmutableMap.Builder<String, Validator> validators = ImmutableMap.builder();
        validators.put(FIELD_TYPE, new IntegerValidator());
        validators.put(FIELD_FIELD, new FilledStringValidator());
        validators.put(FIELD_STREAM_ID, new ObjectIdValidator());
        validators.put(FIELD_CONTENT_PACK, new OptionalStringValidator());

        if (!this.getType().equals(StreamRuleType.PRESENCE)) {
            validators.put(FIELD_VALUE, new FilledStringValidator());
        }

        return validators.build();
    }
View Full Code Here

    }

    public Map<String, Validator> getValidations() {
        return ImmutableMap.<String, Validator>builder()
                .put(USERNAME, new LimitedStringValidator(1, MAX_USERNAME_LENGTH))
                .put(PASSWORD, new FilledStringValidator())
                .put(EMAIL, new LimitedStringValidator(1, MAX_EMAIL_LENGTH))
                .put(FULL_NAME, new LimitedOptionalStringValidator(MAX_FULL_NAME_LENGTH))
                .put(PERMISSIONS, new ListValidator())
                .build();
    }
View Full Code Here

        inputData.put("creator_user_id", rir.creatorUserId);
        inputData.put("configuration", rir.configuration);
        inputData.put("created_at", Tools.iso8601());
        inputData.put("radio_id", rir.radioId);

        Input mongoInput = new InputImpl(inputData);

        // Write to database.
        String id;
        try {
            id = inputService.save(mongoInput);
View Full Code Here

            LOG.error("Radio <{}> not found.", radioId);
            throw new NotFoundException("Radio <" + radioId + "> not found.");
        }

        try {
            final Input input = inputService.findForThisRadioOrGlobal(radioId, inputId);
            if (!input.isGlobal())
                inputService.destroy(input);
        } catch (org.graylog2.database.NotFoundException e) {
            throw new NotFoundException(e);
        }
View Full Code Here

TOP

Related Classes of org.graylog2.database.validators.FilledStringValidator

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.