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

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

Go to download

Middleware library based on Vert.x to build advanced JSON/REST communication servers

The newest version!
package org.swisspush.gateleen.routing;

import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.regex.Pattern;

public class Rule {
    private String name;
    private String scheme;
    private String host;
    private String metricName;
    private int port;
    private String path;
    private int poolSize;
    private boolean keepAlive;
    private boolean expandOnBackend;
    private boolean storageExpand;
    private String urlPattern;
    private int timeout;
    private String username;
    private String password;
    private Map translateStatus = new LinkedHashMap<>();
    private int logExpiry;
    private String[] methods;
    private String[] profile;
    private Map staticHeaders = new HashMap<>();
    private String storage;

    public String getRuleIdentifier() {
        if(name != null){
            return name;
        }
        return urlPattern;
    }

    public String getName() { return name; }

    public void setName(String name) { this.name = name; }

    public String getScheme() {
        return scheme;
    }

    public void setScheme(String scheme) {
        this.scheme = scheme;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public String getMetricName() {
        return metricName;
    }

    public void setMetricName(String metricName) {
        this.metricName = metricName;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public int getPoolSize() {
        return poolSize;
    }

    public void setPoolSize(int poolSize) {
        this.poolSize = poolSize;
    }

    public boolean isKeepAlive() {
        return keepAlive;
    }

    public void setKeepAlive(boolean keepAlive) {
        this.keepAlive = keepAlive;
    }

    public boolean isExpandOnBackend() { return expandOnBackend; }

    public void setExpandOnBackend(boolean expandOnBackend) {
        this.expandOnBackend = expandOnBackend;
    }

    public boolean isStorageExpand() { return storageExpand; }

    public void setStorageExpand(boolean storageExpand) { this.storageExpand = storageExpand; }

    public String getUrlPattern() {
        return urlPattern;
    }

    public void setUrlPattern(String urlPattern) {
        this.urlPattern = urlPattern;
    }

    public int getTimeout() {
        return timeout;
    }

    public void setTimeout(int timeout) {
        this.timeout = timeout;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Map getTranslateStatus() {
        return translateStatus;
    }

    public void addTranslateStatus(Map translateStatus) {
        this.translateStatus.putAll(translateStatus);
    }

    public int getLogExpiry() {
        return logExpiry;
    }

    public void setLogExpiry(int logExpiry) {
        this.logExpiry = logExpiry;
    }

    public String[] getMethods() {
        return methods;
    }

    public void setMethods(String[] methods) {
        this.methods = Arrays.copyOf(methods, methods.length);
    }

    public String[] getProfile() {
        return profile;
    }

    public void setProfile(String[] profile) {
        this.profile = Arrays.copyOf(profile, profile.length);
    }

    public Map getStaticHeaders() {
        return staticHeaders;
    }

    public void addStaticHeaders(Map staticHeaders) {
        this.staticHeaders.putAll(staticHeaders);
    }

    public String getStorage() {
        return storage;
    }

    public void setStorage(String storage) {
        this.storage = storage;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy