
mesosphere.dcos.client.DCOSAPIInterceptor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of marathon-client Show documentation
Show all versions of marathon-client Show documentation
A Java API client for Mesosphere's Marathon.
package mesosphere.dcos.client;
import java.util.Collection;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import mesosphere.client.common.HeaderUtils;
public class DCOSAPIInterceptor implements RequestInterceptor {
@Override
public void apply(RequestTemplate template) {
Collection apiSources = template.headers().get(HeaderUtils.API_SOURCE_HEADER);
if (apiSources == null || apiSources.isEmpty()) {
return;
}
if (apiSources.iterator().next().equals(HeaderUtils.MARATHON_API_SOURCE)) {
template.insert(0, "/marathon");
}
template.header(HeaderUtils.API_SOURCE_HEADER);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy