Package com.fasterxml.clustermate.client.ahc

Source Code of com.fasterxml.clustermate.client.ahc.AHCEntryListResult

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<T> extends ListCallResult<T>
{
    protected HttpResponseHeaders _headers;

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

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

    public AHCEntryListResult(ClusterServerNode server, int failCode) {
        super(server, failCode);
    }
   
    public static <T> AHCEntryListResult<T> notFound(ClusterServerNode server) {
        return new AHCEntryListResult<T>(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);
    }
}
TOP

Related Classes of com.fasterxml.clustermate.client.ahc.AHCEntryListResult

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.