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

io.github.yawenok.apns.http2.ApnsConfig Maven / Gradle / Ivy

package io.github.yawenok.apns.http2;

import io.github.yawenok.apns.http2.config.AuthConfig;
import io.github.yawenok.apns.http2.config.ProxyConfig;
import org.apache.commons.pool2.impl.GenericObjectPoolConfig;

public class ApnsConfig extends GenericObjectPoolConfig {
    private boolean sandbox = false;

    private AuthConfig authConfig;

    private ProxyConfig proxyConfig;

    public boolean isSandbox() {
        return sandbox;
    }

    /**
     * Setting up for APNs sandbox mode.
     *
     * @param sandbox
     * @return
     */
    public ApnsConfig setSandbox(final boolean sandbox) {
        this.sandbox = sandbox;
        return this;
    }

    public AuthConfig getAuthConfig() {
        return authConfig;
    }

    /**
     * Setting up for auth mode (using provider certificates or using provider authentication tokens).
     *
     * @param authConfig
     * @return
     */
    public ApnsConfig setAuthConfig(final AuthConfig authConfig) {
        this.authConfig = authConfig;
        return this;
    }

    public ProxyConfig getProxyConfig() {
        return proxyConfig;
    }

    /**
     * Setting up for proxy mode (Http, socks4, socks5).
     *
     * @param proxyConfig
     * @return
     */
    public ApnsConfig setProxyConfig(final ProxyConfig proxyConfig) {
        this.proxyConfig = proxyConfig;
        return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy