Class BulkIdResolverAbstract<T extends com.fasterxml.jackson.databind.JsonNode>


  • public abstract class BulkIdResolverAbstract<T extends com.fasterxml.jackson.databind.JsonNode>
    extends Object
    author Pascal Knueppel
    created at: 21.08.2022 - 13:47

    • Field Detail

      • operationBulkId

        protected final String operationBulkId
        the bulkId that is representing this bulk operation details
      • uriInfos

        protected final UriInfos uriInfos
        the uri information of the currently accessed resource-type
      • resource

        protected final T extends com.fasterxml.jackson.databind.JsonNode resource
        the resource object that might contain some bulkId references
      • referencedBulkIds

        protected final Set<String> referencedBulkIds
        contains all referenced bulkIds from this operation. Resolved elements will be removed from this set
      • bulkIdReferences

        protected final Map<String,​List<BulkIdReferenceWrapper>> bulkIdReferences
        contains all bulkId reference of the resource. Since it might be possible that a bulkId reference is used to reference the same resource in different places we use this map for linking these entries from bulkId to found entries. Resolved elements will be removed from this map
    • Constructor Detail

      • BulkIdResolverAbstract

        public BulkIdResolverAbstract​(String operationBulkId,
                                      UriInfos uriInfos,
                                      T resource)
    • Method Detail

      • findAllBulkIdReferences

        protected void findAllBulkIdReferences()
        this method will retrieve all bulkId references present within the resource object
      • getComplexBulkIdNodes

        protected abstract List<BulkIdReferenceWrapper> getComplexBulkIdNodes()
        this method must return the bulkId references from the resource that are based on the complex-node bulkId specification
        Returns:
        the bulkId references that were found within the resource
      • getDirectBulkIdNodes

        protected abstract List<BulkIdReferenceWrapper> getDirectBulkIdNodes()
        this method must return the bulkId references from the resource that are based on the simple-node bulkId specification
        Returns:
        the bulkId references that were found within the resource
      • replaceBulkIdNode

        public final void replaceBulkIdNode​(String bulkId,
                                            String value)
        will replace the values marked with the given bulkId by the given value
        Parameters:
        bulkId - the bulkId that should be replaced
        value - the value that should replace the bulkId reference
      • hasAnyBulkIdReferences

        public final boolean hasAnyBulkIdReferences()
        Returns:
        if any bulkId references have been found
      • getUnresolvedBulkIds

        public final Set<String> getUnresolvedBulkIds()
        Returns:
        the bulkIds that have not been resolved yet
      • hasSelfReference

        public final boolean hasSelfReference()
        checks if this operation contains a self-reference
      • containsBulkIdReference

        protected final boolean containsBulkIdReference​(com.fasterxml.jackson.databind.JsonNode jsonNode)
        verifies if the given node does even contain a bulkId
      • checkForBulkIdReferenceValidity

        protected void checkForBulkIdReferenceValidity​(String bulkIdReferenceValue)
      • getOperationBulkId

        public String getOperationBulkId()
        the bulkId that is representing this bulk operation details
      • getUriInfos

        public UriInfos getUriInfos()
        the uri information of the currently accessed resource-type
      • getResource

        public T getResource()
        the resource object that might contain some bulkId references
      • getReferencedBulkIds

        public Set<String> getReferencedBulkIds()
        contains all referenced bulkIds from this operation. Resolved elements will be removed from this set
      • isHadSuccessInLastRun

        public boolean isHadSuccessInLastRun()
        a bulk operation may be processed several times if bulkIds need to be resolved. In order to find unresolvable bulkIds we need to investigate each operation and must try to resolve the contained bulkIds. If an operation will be processed the second third or fourth time it must have set this boolean set to true otherwise we will assume that this operation contains an unresolvable bulkId.