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

denominator.dynect.SessionTarget Maven / Gradle / Ivy

There is a newer version: 4.7.1
Show newest version
package denominator.dynect;

import javax.inject.Inject;

import denominator.Provider;
import denominator.dynect.InvalidatableTokenProvider.Session;
import feign.Request;
import feign.RequestTemplate;
import feign.Target;

class SessionTarget implements Target {

    private final Provider provider;

    @Inject
    SessionTarget(Provider provider) {
        this.provider = provider;
    }

    @Override
    public Class type() {
        return Session.class;
    }

    @Override
    public String name() {
        return provider.name();
    }

    @Override
    public String url() {
        return provider.url();
    }

    @Override
    public Request apply(RequestTemplate input) {
        input.header("API-Version", "3.5.2");
        input.header("Content-Type", "application/json");
        input.insert(0, url());
        return input.request();
    }
};




© 2015 - 2024 Weber Informatics LLC | Privacy Policy