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

com.fasterxml.clustermate.client.ahc.AHCEntryListResult Maven / Gradle / Ivy

Go to download

Almost complete ClusterMate NetworkClient implementation built on Async HTTP Client

The newest version!
package com.fasterxml.clustermate.client.ahc;

import com.ning.http.client.HttpResponseHeaders;

import com.fasterxml.clustermate.api.ClusterMateConstants;
import com.fasterxml.clustermate.api.msg.ListResponse;
import com.fasterxml.clustermate.client.ClusterServerNode;
import com.fasterxml.clustermate.client.call.CallFailure;
import com.fasterxml.clustermate.client.call.ListCallResult;

public class AHCEntryListResult extends ListCallResult
{
    protected HttpResponseHeaders _headers;

    /*
    /**********************************************************************
    /* Construction, initialization
    /**********************************************************************
     */
    
    public AHCEntryListResult(ClusterServerNode server, ListResponse resp) {
        super(server, resp);
    }

    public AHCEntryListResult(CallFailure fail) {
        super(fail);
    }

    public AHCEntryListResult(ClusterServerNode server, int failCode) {
        super(server, failCode);
    }
    
    public static  AHCEntryListResult notFound(ClusterServerNode server) {
        return new AHCEntryListResult(server, ClusterMateConstants.HTTP_STATUS_NOT_FOUND);
    }

    public void setHeaders(HttpResponseHeaders h) {
        _headers = h;
    }

    /*
    /**********************************************************************
    /* Accessors
    /**********************************************************************
     */

    @Override
    public String getHeaderValue(String key)
    {
        HttpResponseHeaders h = _headers;
        return (h == null) ? null : h.getHeaders().getFirstValue(key);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy