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

org.gs4tr.gcc.restclient.GCConfig Maven / Gradle / Ivy

Go to download

GlobalLink Connect Cloud java is a library to connect your system to GlobalLink Connect Cloud REST API.

There is a newer version: 3.1.3
Show newest version
package org.gs4tr.gcc.restclient;

import java.util.HashMap;
import java.util.Map;

public class GCConfig {

    private String apiUrl;
    private String userName;
    private String password;
    private String connectorKey;
    private String userAgent;
    private GCProxyConfig proxyConfig;
    private Map customHeaders = new HashMap<>();

    private String bearerToken;

    public GCConfig() {

    }

    public GCConfig(String apiUrl, String userName, String password) {
	this.apiUrl = apiUrl;
	this.userName = userName;
	this.password = password;
    }

    public GCConfig(String apiUrl, String userName, String password, String connectorKey) {
	this(apiUrl, userName, password);
	this.connectorKey = connectorKey;
    }

    public GCConfig(String apiUrl, String userName, String password, String connectorKey, String userAgent) {
	this(apiUrl, userName, password, connectorKey);
	this.userAgent = userAgent;
    }

    public GCConfig(String apiUrl, String userName, String password, String connectorKey, String userAgent,
	    Map customHeaders) {
	this(apiUrl, userName, password, connectorKey, userAgent);
	this.customHeaders.putAll(customHeaders);
    }

    public String getApiUrl() {
	return apiUrl;
    }

    public void setApiUrl(String apiUrl) {
	this.apiUrl = apiUrl;
    }

    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 String getUserAgent() {
	return userAgent;
    }

    public void setUserAgent(String userAgent) {
	this.userAgent = userAgent;
    }

    public String getBearerToken() {
	return bearerToken;
    }

    public void setBearerToken(String bearerToken) {
	this.bearerToken = bearerToken;
    }

    public String getConnectorKey() {
	return connectorKey;
    }

    public void setConnectorKey(String connectorKey) {
	this.connectorKey = connectorKey;
    }

    public GCProxyConfig getProxyConfig() {
	return proxyConfig;
    }

    public void setProxyConfig(GCProxyConfig proxyConfig) {
	this.proxyConfig = proxyConfig;
    }

    public Map getCustomHeaders() {
	return customHeaders;
    }

    public void setCustomHeaders(Map customHeaders) {
	this.customHeaders = customHeaders;
    }

    public static Builder builder() {
	return new Builder();
    }

    public static class Builder {

	private String apiUrl;
	private String userName;
	private String password;
	private String connectorKey;
	private String userAgent;
	private Map customHeaders = new HashMap<>();

	private Builder() {
	}

	public Builder apiUrl(String apiUrl) {
	    this.apiUrl = apiUrl;
	    return this;
	}

	public Builder userName(String userName) {
	    this.userName = userName;
	    return this;
	}

	public Builder password(String password) {
	    this.password = password;
	    return this;
	}

	public Builder connectorKey(String connectorKey) {
	    this.connectorKey = connectorKey;
	    return this;
	}

	public Builder userAgent(String userAgent) {
	    this.userAgent = userAgent;
	    return this;
	}

	public Builder customHeader(String name, String value) {
	    customHeaders.put(name, value);
	    return this;
	}

	public Builder customHeaders(Map headers) {
	    customHeaders.putAll(headers);
	    return this;
	}

	public GCConfig build() {
	    return new GCConfig(apiUrl, userName, password, connectorKey, userAgent, customHeaders);
	}

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy