Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.fasterxml.clustermate.jaxrs;
 
 
 import javax.ws.rs.*;
 
 
Resource that implements interface used by server-to-server synchronization functionality, for transferring data by the "anti-entropy" process.

For testing, try accessing: http://localhost:9090/v/sync/list/0?keyRangeStart=0&keyRangeLength=360 with browser.

@Path("/v/sync/")
public class SyncResource<K extends EntryKey, E extends StoredEntry<K>>
    protected final SyncHandler<K,E> _syncHandler;
    
    /*
    /**********************************************************************
    /* Life-cycle
    /**********************************************************************
     */
    
    public SyncResource(SyncHandler<K,E> h) {
         = h;
    }
        
    /*
    /**********************************************************************
    /* API, file listing
    /**********************************************************************
     */
    
    
End point clients use to find out metadata for entries this node has, starting with the given timestamp.
    @GET
    @Path("list")
    @Timed
    public Response listEntries(@Context UriInfo uriInfo, @Context HttpHeaders headers,
            @QueryParam("since"Long sinceL)
        throws StoreException
    {
        JaxrsHttpResponse response = new JaxrsHttpResponse();
        .listEntries(new JaxrsHttpRequest(uriInfoheaders"".),
                responsesinceLnull);
        return response.buildResponse();
    }
    
    /*
    /**********************************************************************
    /* API, direct content download
    /* (no (un)compression etc)
    /**********************************************************************
     */

    
Access endpoint used by others nodes to 'pull' data for entries they are missing. Note that request payload must be JSON; may change to Smile in future if need be.
    @POST
    @Path("pull")
    @Timed
    public Response pullEntries(@Context UriInfo uriInfo, @Context HttpHeaders headers,
            InputStream in)
        throws StoreException
    {
        JaxrsHttpResponse response = new JaxrsHttpResponse();
        .pullEntries(new JaxrsHttpRequest(uriInfoheaders"".), responsein,
                null);
        return response.buildResponse();
    }
New to GrepCode? Check out our FAQ X