Package org.graylog2.database.validators

Examples of org.graylog2.database.validators.OptionalStringValidator


    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


    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

    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());
        }
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

                        new CacheLoader<String, Optional<MessageInput>>() {
                            @Override
                            public Optional<MessageInput> load(String key) throws Exception {
                                LOG.debug("Loading message input {}", key);
                                try {
                                    final Input input = inputService.find(key);
                                    return Optional.fromNullable(inputService.buildMessageInput(input));
                                } catch (NotFoundException | NoSuchInputTypeException e) {
                                    return Optional.absent();
                                }
                            }
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.debug("Version check reports current version: " + parsedResponse);

            if (reportedVersion.greaterMinor(ServerVersion.VERSION)) {
                LOG.debug("Reported version is higher than ours ({}). Writing notification.", ServerVersion.VERSION);

                Notification notification = notificationService.buildNow()
                        .addSeverity(Notification.Severity.NORMAL)
                        .addType(Notification.Type.OUTDATED_VERSION)
                        .addDetail("current_version", parsedResponse.toString());
                notificationService.publishIfFirst(notification);
            } else {
View Full Code Here

            final String osName = node.getJvm().getSystemProperties().get("os.name");
            if (null != osName && osName.startsWith("Windows")) {
                LOG.debug("Skipping open file limit check for Indexer node <{}> on Windows", node.getNode().getName());
            } else if (node.getProcess().getMaxFileDescriptors() < MINIMUM_OPEN_FILES_LIMIT) {
                // Write notification.
                final Notification notification = notificationService.buildNow()
                        .addType(Notification.Type.ES_OPEN_FILES)
                        .addSeverity(Notification.Severity.URGENT);

                if (notificationService.publishIfFirst(notification)) {
                    LOG.warn("Indexer node <{}> open file limit is too low: [{}]. Set it to at least {}.",
                            node.getNode().getName(),
                            node.getProcess().getMaxFileDescriptors(),
                            MINIMUM_OPEN_FILES_LIMIT);
                }
                allHigher = false;
            }
        }

        if (allHigher) {
            Notification notification = notificationService.build().addType(Notification.Type.ES_OPEN_FILES);
            notificationService.fixed(notification);
        }
    }
View Full Code Here

        for (final GarbageCollectorMXBean gc : garbageCollectors) {
            if (gc.getCollectionTime() >= gcWarningThresholdMillis) {
                LOG.warn("Last GC run with {} took longer than {}ms (count={}, time={}ms)",
                        gc.getName(), gcWarningThresholdMillis, gc.getCollectionCount(), gc.getCollectionTime());

                final Notification notification = notificationService.buildNow()
                        .addNode(nodeId.toString())
                        .addTimestamp(Tools.iso8601())
                        .addSeverity(Notification.Severity.URGENT)
                        .addType(Notification.Type.GC_TOO_LONG)
                        .addDetail("gc_name", gc.getName())
View Full Code Here

TOP

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

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.