Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.fasterxml.clustermate.service.servlet;
 
 
 
 
public class SyncPullServlet<K extends EntryKey, E extends StoredEntry<K>>
    extends ServletWithMetricsBase
    protected final SyncHandler<K,E> _syncHandler;
    // may need JSON writer for errors:
    protected final ObjectWriter _jsonWriter;
    protected final OperationMetrics _pullMetrics;
    
    public SyncPullServlet(SharedServiceStuff stuffClusterViewByServer clusterView,
            SyncHandler<K,E> h)
    {
        // null -> use servlet path base as-is
        super(stuffclusterViewnull);
         = h;
         = stuff.jsonWriter();
        final ServiceConfig serviceConfig = stuff.getServiceConfig();
        if (serviceConfig.metricsEnabled) {
             = OperationMetrics.forListingOperation(serviceConfig"syncPull");
        } else {
             = null;
        }
    }
    @Override
    public void fillOperationMetrics(AllOperationMetrics metrics) {
        metrics.SYNCPULL = ExternalOperationMetrics.create();
    }
    
    @Override
    public void handlePost(ServletServiceRequest requestServletServiceResponse response,
            OperationDiagnostics metadatathrows IOException
    {
        final OperationMetrics metrics = ;
        Context timer = (metrics == null) ? null : metrics.start();
        try {
            .pullEntries(requestresponserequest.getInputStream(), metadata);
            _addStdHeaders(response);
            response.writeOut();
        } finally {
            if (metrics != null) {
                metrics.finish(timermetadata);
           }
        }
    }
New to GrepCode? Check out our FAQ X