Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.fasterxml.clustermate.client.operation;
  
  
Intermediate base class for read operations (GET, HEAD, List). Note that definitions of failed() and succeeded() refer to success of operation itself, but do NOT necessarily mean that content was found: it is possible for operation to succeed but content not to be found (not to exist).
 
 public class ReadOperationResult<T extends ReadOperationResult<T>>
     extends OperationResultImpl<T>
 {
    
Server that successfully delivered content, if any
 
     protected ClusterServerNode _server;

    
List of nodes that do not have entry for specified key.
 
     protected LinkedList<ClusterServerNode_serversWithoutEntry = null;
 
     /*
     /**********************************************************************
     /* Life-cycle
     /**********************************************************************
      */
 
     protected ReadOperationResult(OperationConfig config) {
         super(config);
     }

    
Method called to indicate that the requested entry was missing from specified server; will return either a new response object, or this response modified with additional information.

Parameters:
server Server that was missing requested entry
 
     @SuppressWarnings("unchecked")
     public T withMissing(ClusterServerNode server)
     {
         if ( == null) {
              = new LinkedList<ClusterServerNode>();
         }
         .add(server);
         return (T) this;
     }
     
     /*
     /**********************************************************************
     /* Partial API implementation
     /**********************************************************************
      */
     
     @Override
     public int getSuccessCount() {
         if ( != null ||  != null) {
             return 1;
         }
         return 0;
     }
 
     @Override
     public boolean succeededMinimally() {
         return getSuccessCount() > 0;
     }
 
     @Override
     public boolean succeededOptimally() {
         return getSuccessCount() > 0;
     }
 
     @Override
     public boolean succeededMaximally() {
         return getSuccessCount() > 0;
     }
 
     @Override
     protected void _addExtraInfo(StringBuilder sb) {
         sb.append(", missing: ").append(getMissingCount());
     }
     
     /*
     /**********************************************************************
     /* Extended API
     /**********************************************************************
      */
 
     public boolean failed() { return getSuccessCount() == 0; }
     public boolean succeeded() { return getSuccessCount() > 0; }
 
     public boolean entryFound() { return  != null; }
     
     public int getMissingCount() {
        return ( == null) ? 0 : .size();
    }
        return ;
    }
New to GrepCode? Check out our FAQ X