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

org.swisspush.gateleen.routing.RouterConfiguration Maven / Gradle / Ivy

There is a newer version: 2.1.12
Show newest version
package org.swisspush.gateleen.routing;

import org.swisspush.gateleen.routing.auth.OAuthConfiguration;
import org.swisspush.gateleen.routing.auth.OAuthId;

import java.util.Map;
import java.util.Optional;

/**
 * Container holding configuration values for the {@link Router}
 *
 * @author https://github.com/mcweba [Marc-Andre Weber]
 */
public class RouterConfiguration {

    private final Integer requestHopsLimit;
    private final Map oAuthConfigurations;

    public RouterConfiguration(Integer requestHopsLimit, Map oAuthConfigurations) {
        this.requestHopsLimit = requestHopsLimit;
        this.oAuthConfigurations = oAuthConfigurations;
    }

    public Integer requestHopsLimit() {
        return requestHopsLimit;
    }

    public Map oAuthConfigurations() {
        return oAuthConfigurations;
    }

    public Optional oAuthConfiguration(String id) {
        return Optional.ofNullable(oAuthConfigurations.get(OAuthId.of(id)));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy