Package org.swisspush.gateleen.expansion
Class RecursiveExpansionHandler
- java.lang.Object
-
- org.swisspush.gateleen.expansion.RecursiveExpansionHandler
-
- All Implemented Interfaces:
io.vertx.core.Handler<ResourceNode>,DeltaHandler<ResourceNode>
public class RecursiveExpansionHandler extends Object implements DeltaHandler<ResourceNode>
A class for handeling the recursive get request. She holds exactly one collection and handles all of their children, before she calls here parent.- Author:
- https://github.com/ljucam [Mario Ljuca]
-
-
Constructor Summary
Constructors Constructor Description RecursiveExpansionHandler(List<String> subResourceNames, String collectionName, String collectioneTag, DeltaHandler<ResourceNode> parentHandler)Creates a new instance of the RecursiveExpansionHandler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidhandle(ResourceNode node)Handles the given node.voidstoreXDeltaResponseHeader(String xDeltaResponseNumber)Checks if the given x-delta number from the response is not null and is higher then the already stored one.
-
-
-
Constructor Detail
-
RecursiveExpansionHandler
public RecursiveExpansionHandler(List<String> subResourceNames, String collectionName, String collectioneTag, DeltaHandler<ResourceNode> parentHandler)
Creates a new instance of the RecursiveExpansionHandler.- Parameters:
subResourceNames- - a list with the child names, needed for preserving the order of the resourcescollectionName- - the name of the collectioncollectioneTag- - eTag of the request that lead to this collectionparentHandler- - the parent handler
-
-
Method Detail
-
handle
public void handle(ResourceNode node)
Handles the given node. A node has to field, his name and an object. Normaly this object is either a JsonObject or an JSonArray. If an error occures, this object can carry an exception (serious error) or null (no serious error).- Specified by:
handlein interfaceio.vertx.core.Handler<ResourceNode>- Parameters:
node- node
-
storeXDeltaResponseHeader
public void storeXDeltaResponseHeader(String xDeltaResponseNumber)
Description copied from interface:DeltaHandlerChecks if the given x-delta number from the response is not null and is higher then the already stored one. If so the number is set otherwise not.- Specified by:
storeXDeltaResponseHeaderin interfaceDeltaHandler<ResourceNode>- Parameters:
xDeltaResponseNumber- null or the current x-delta value from the response.
-
-