All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.graylog2.plugin.lookup.LookupCacheConfiguration Maven / Gradle / Ivy

There is a newer version: 6.1.4
Show newest version
/*
 * Copyright (C) 2020 Graylog, Inc.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the Server Side Public License, version 1,
 * as published by MongoDB, Inc.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * Server Side Public License for more details.
 *
 * You should have received a copy of the Server Side Public License
 * along with this program. If not, see
 * .
 */
package org.graylog2.plugin.lookup;

import com.google.common.collect.Multimap;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;

import java.util.Optional;

@JsonTypeInfo(
        use = JsonTypeInfo.Id.NAME,
        include = JsonTypeInfo.As.PROPERTY,
        property = LookupCacheConfiguration.TYPE_FIELD,
        visible = true,
        defaultImpl = FallbackCacheConfig.class)
public interface LookupCacheConfiguration {
    String TYPE_FIELD = "type";

    @JsonProperty(TYPE_FIELD)
    String type();

    /**
     * 

Override this method to check for logical errors in the configuration, such as missing * files, or invalid combinations of options. Prefer validation annotations for simple * per-property validations rules, such as min/max values, non-empty strings etc.

* *

By default the configuration has no extra validation errors (i.e. the result of this * method is {@link Optional#empty()}.

* *

Returning failing validations here does not prevent saving the configuration!

* * @return optionally map of property name to error messages */ @JsonIgnore default Optional> validate() { return Optional.empty(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy