Class 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 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 resources
        collectionName - - the name of the collection
        collectioneTag - - eTag of the request that lead to this collection
        parentHandler - - 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:
        handle in interface io.vertx.core.Handler<ResourceNode>
        Parameters:
        node - node
      • storeXDeltaResponseHeader

        public void storeXDeltaResponseHeader​(String xDeltaResponseNumber)
        Description copied from interface: DeltaHandler
        Checks 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:
        storeXDeltaResponseHeader in interface DeltaHandler<ResourceNode>
        Parameters:
        xDeltaResponseNumber - null or the current x-delta value from the response.