Search in sources :

Example 1 with ValidatorMethod

use of com.github.joschi.jadconfig.ValidatorMethod in project graylog2-server by Graylog2.

the class ElasticsearchConfiguration method validateElasticsearchHomePath.

@ValidatorMethod
@SuppressWarnings("unused")
public void validateElasticsearchHomePath() throws ValidationException {
    if (getPathHome() != null) {
        final Path homePath = Paths.get(getPathHome());
        validateElasticsearchPath(homePath);
    }
}
Also used : Path(java.nio.file.Path) ValidatorMethod(com.github.joschi.jadconfig.ValidatorMethod)

Example 2 with ValidatorMethod

use of com.github.joschi.jadconfig.ValidatorMethod in project graylog2-server by Graylog2.

the class Configuration method validateNetworkInterfaces.

@ValidatorMethod
@SuppressWarnings("unused")
public void validateNetworkInterfaces() throws ValidationException {
    final URI restListenUri = getRestListenUri();
    final URI webListenUri = getWebListenUri();
    if (restListenUri.getPort() == webListenUri.getPort() && !restListenUri.getHost().equals(webListenUri.getHost()) && (WILDCARD_IP_ADDRESS.equals(restListenUri.getHost()) || WILDCARD_IP_ADDRESS.equals(webListenUri.getHost()))) {
        throw new ValidationException("Wildcard IP addresses cannot be used if the Graylog REST API and web interface listen on the same port.");
    }
}
Also used : ValidationException(com.github.joschi.jadconfig.ValidationException) Tools.normalizeURI(org.graylog2.plugin.Tools.normalizeURI) URI(java.net.URI) ValidatorMethod(com.github.joschi.jadconfig.ValidatorMethod)

Example 3 with ValidatorMethod

use of com.github.joschi.jadconfig.ValidatorMethod in project graylog2-server by Graylog2.

the class ElasticsearchConfiguration method validateElasticsearchDataPath.

@ValidatorMethod
@SuppressWarnings("unused")
public void validateElasticsearchDataPath() throws ValidationException {
    if (getPathData() != null) {
        final Path dataPath = Paths.get(getPathData());
        validateElasticsearchPath(dataPath);
    }
}
Also used : Path(java.nio.file.Path) ValidatorMethod(com.github.joschi.jadconfig.ValidatorMethod)

Aggregations

ValidatorMethod (com.github.joschi.jadconfig.ValidatorMethod)3 Path (java.nio.file.Path)2 ValidationException (com.github.joschi.jadconfig.ValidationException)1 URI (java.net.URI)1 Tools.normalizeURI (org.graylog2.plugin.Tools.normalizeURI)1