Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.fasterxml.clustermate.service.sync;
  import java.util.*;
Simple response POJO used by sync end point; used both for failures (for which message is non-null) and successes (for which entries is non-null.

NOTE: only used for writing; on reading side we will use a "raw" approach.

 public class SyncListResponse<E extends StoredEntry<?>>
     extends ExtensibleType
Error message, if any
     public String message;

Highest timestamp observed during processing; may be higher than highest timestamp of entries returned to reflect skipped entries (or in some cases known "empty" time ranges)
     public long lastSeenTimestamp;

Hash code server calculates over cluster view information. Caller may pass it to optionally skip generation and inclusion of unchanged cluster information.
     public long clusterHash;

If server returns empty result list, it may also indicate that client may want to wait for specified amount of time before issuing a new request; this based on its knowledge of when more data can be available at earliest. Time is in milliseconds.
     public long clientWait;
Optionally included cluster view.
     public List<SyncListResponseEntryentries;
     public SyncListResponse() { }
     public SyncListResponse(String error) {  = error; }
     public SyncListResponse(List<E> rawEntries) {
          = new ArrayList<SyncListResponseEntry>(rawEntries.size());
         for (StoredEntry<?> e : rawEntries) {
     // NOTE: only to be used internally
     private SyncListResponse(boolean dummy) {
          = Collections.emptyList();
     public SyncListResponse(List<E> rawEntrieslong lastSeen,
             long clusterHashClusterStatusMessage clusterStatus)
          = lastSeen;
         this. = clusterStatus;
         this. = clusterHash;
     public static <E2 extends StoredEntry<?>> SyncListResponse<E2> emptyResponse() {
         return new SyncListResponse<E2>(false);
     public int size() {
         return ( == null) ? 0 : .size();
     public long lastSeen() {
         return ;
     public SyncListResponse<E> setLastSeenTimestamp(long l) {
          = l;
         return this;
          = s;
         return this;
    public SyncListResponse<E> setClusterHash(long h) {
         = h;
        return this;
    public SyncListResponse<E> setClientWait(long w) {
         = w;
        return this;
New to GrepCode? Check out our FAQ X