com.fasterxml.clustermate.client.jdk.JdkHttpEntryListResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of clustermate-client-jdk Show documentation
Show all versions of clustermate-client-jdk Show documentation
ClusterMate NetworkClient implementation built on default
JDK-provided HTTP client (HTTPUrlConnection)
package com.fasterxml.clustermate.client.jdk;
import java.net.HttpURLConnection;
import com.fasterxml.clustermate.api.ClusterMateConstants;
import com.fasterxml.clustermate.api.msg.ListResponse;
import com.fasterxml.clustermate.client.CallFailure;
import com.fasterxml.clustermate.client.call.ListCallResult;
public class JdkHttpEntryListResult extends ListCallResult
{
protected final HttpURLConnection _connection;
/*
/**********************************************************************
/* Construction, initialization
/**********************************************************************
*/
public JdkHttpEntryListResult(HttpURLConnection conn, ListResponse resp) {
super(resp);
_connection = conn;
}
public JdkHttpEntryListResult(CallFailure fail) {
super(fail);
_connection = null;
}
public JdkHttpEntryListResult(int failCode) {
super(failCode);
_connection = null;
}
public static JdkHttpEntryListResult notFound() {
return new JdkHttpEntryListResult(ClusterMateConstants.HTTP_STATUS_NOT_FOUND);
}
/*
/**********************************************************************
/* Accessors
/**********************************************************************
*/
@Override
public String getHeaderValue(String key)
{
if (_connection != null) {
return _connection.getHeaderField(key);
}
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy