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

com.fasterxml.clustermate.client.jdk.JdkHttpEntryListResult Maven / Gradle / Ivy

Go to download

ClusterMate NetworkClient implementation built on default JDK-provided HTTP client (HTTPUrlConnection)

There is a newer version: 0.10.5
Show newest version
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