com.netflix.config
Class PollResult

java.lang.Object
  extended by com.netflix.config.PollResult

public class PollResult
extends java.lang.Object

This class represents result from a poll of configuration source. The result may be the complete content of the configuration source, or an incremental one.


Method Summary
static PollResult createFull(java.util.Map<java.lang.String,java.lang.Object> complete)
          Create a full result that represents the complete content of the configuration source.
static PollResult createIncremental(java.util.Map<java.lang.String,java.lang.Object> added, java.util.Map<java.lang.String,java.lang.Object> changed, java.util.Map<java.lang.String,java.lang.Object> deleted, java.lang.Object checkPoint)
          Create a result that represents incremental changes from the configuration source.
 java.util.Map<java.lang.String,java.lang.Object> getAdded()
           
 java.util.Map<java.lang.String,java.lang.Object> getChanged()
           
 java.lang.Object getCheckPoint()
           
 java.util.Map<java.lang.String,java.lang.Object> getComplete()
          Get complete content from configuration source.
 java.util.Map<java.lang.String,java.lang.Object> getDeleted()
           
 boolean hasChanges()
          Indicate whether this result has any content.
 boolean isIncremental()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createFull

public static PollResult createFull(java.util.Map<java.lang.String,java.lang.Object> complete)
Create a full result that represents the complete content of the configuration source.

Parameters:
complete - map that contains all the properties

createIncremental

public static PollResult createIncremental(java.util.Map<java.lang.String,java.lang.Object> added,
                                           java.util.Map<java.lang.String,java.lang.Object> changed,
                                           java.util.Map<java.lang.String,java.lang.Object> deleted,
                                           java.lang.Object checkPoint)
Create a result that represents incremental changes from the configuration source.

Parameters:
added - properties added
changed - properties changed
deleted - properties deleted, in which case the value in the map will be ignored
checkPoint - Object that served as a marker for this incremental change, for example, a time stamp of the last change.

hasChanges

public final boolean hasChanges()
Indicate whether this result has any content. If the result is incremental, this is true if there is any any added, changed or deleted properties. If the result is complete, this is true if getComplete() is null.


getComplete

public final java.util.Map<java.lang.String,java.lang.Object> getComplete()
Get complete content from configuration source. null if the result is incremental.


getAdded

public final java.util.Map<java.lang.String,java.lang.Object> getAdded()
Returns:
the added properties in the configuration source as a map

getChanged

public final java.util.Map<java.lang.String,java.lang.Object> getChanged()
Returns:
the changed properties in the configuration source as a map

getDeleted

public final java.util.Map<java.lang.String,java.lang.Object> getDeleted()
Returns:
the deleted properties in the configuration source as a map

isIncremental

public final boolean isIncremental()
Returns:
whether the result is incremental. false if it is the complete content of the configuration source.

getCheckPoint

public final java.lang.Object getCheckPoint()
Returns:
the check point (marker) for this poll result