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

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

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

import java.util.List;

import com.fasterxml.clustermate.api.ClusterMateConstants;
import com.fasterxml.clustermate.api.msg.ListResponse;
import com.fasterxml.clustermate.client.CallFailure;
import com.fasterxml.storemate.shared.StorableKey;

public abstract class ListCallResult
    extends CallResult
{
    protected final List _items;
    
    protected final StorableKey _lastSeen;

    /*
    /**********************************************************************
    /* Construction, initialization
    /**********************************************************************
     */
    
    public ListCallResult(ListResponse resp)
    {
        super(ClusterMateConstants.HTTP_STATUS_OK);
        _items = resp.items;
        _lastSeen = resp.lastSeen;
    }

    public ListCallResult(CallFailure fail)
    {
        super(fail);
        _items = null;
        _lastSeen = null;
    }

    public ListCallResult(int statusCode)
    {
        super(statusCode);
        _items = null;
        _lastSeen = null;
    }
    
    /*
    /**********************************************************************
    /* CallResult impl
    /**********************************************************************
     */

    @Override
    public abstract String getHeaderValue(String key);
    
    /*
    /**********************************************************************
    /* Extended API
    /**********************************************************************
     */
    
    public List getItems() { return _items; }

    public StorableKey getLastSeen() { return _lastSeen; }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy