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

com.fasterxml.clustermate.client.call.HeadCallResult Maven / Gradle / Ivy

There is a newer version: 0.10.5
Show newest version
package com.fasterxml.clustermate.client.call;

import com.fasterxml.clustermate.client.ClusterServerNode;

public abstract class HeadCallResult
    extends CallResult
{
    protected final long _contentLength;

    /*
    /**********************************************************************
    /* Construction, initialization
    /**********************************************************************
     */
    
    protected HeadCallResult(ClusterServerNode server, long contentLength) {
        super(server);
        _contentLength = contentLength;
    }

    protected HeadCallResult(ClusterServerNode server, int status, long contentLength) {
        super(server, status);
        _contentLength = contentLength;
    }

    protected HeadCallResult(CallFailure fail) {
        super(fail);
        _contentLength = -1;
    }

    /*
    /**********************************************************************
    /* CallResult impl
    /**********************************************************************
     */

    @Override
    public abstract String getHeaderValue(String key);

    /*
    /**********************************************************************
    /* Extended API
    /**********************************************************************
     */
    
    public long getContentLength() { return _contentLength; }
    public boolean hasContentLength() { return _contentLength >= 0L; }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy