Class CollectAttachmentContext

java.lang.Object
fr.gouv.vitam.worker.core.extractseda.CollectAttachmentContext

public class CollectAttachmentContext extends Object
Attachment positions offered to the root archive units of a collect SIP. Every unit id it carries is already resolved against the transaction, so applying the context needs no further lookup.
  • Constructor Details

  • Method Details

    • empty

      public static CollectAttachmentContext empty()
    • explicit

      public static CollectAttachmentContext explicit(String explicitAttachmentUnitId)
    • ofProject

      public static CollectAttachmentContext ofProject(String staticAttachmentUnitId, List<DynamicAttachmentRule> dynamicAttachmentRules)
    • resolveRootParentUnitIds

      public Set<String> resolveRootParentUnitIds(com.fasterxml.jackson.databind.JsonNode unitMetadata, boolean carriesUpdateOperation)
      Resolves the parent units of a root archive unit, by decreasing priority :
      1. the explicit X-Attachement-Id target, nothing else applies
      2. the unit declares an UpdateOperation, no project attachment applies
      3. every dynamic rule the unit metadata matches
      4. the static attachment unit
      5. no attachment
      Parameters:
      unitMetadata - metadata of the archive unit, used by the dynamic rules
      carriesUpdateOperation - whether the archive unit declares an UpdateOperation of its own
      Returns:
      the parent unit ids, never null
    • attachmentUnitIds

      public Set<String> attachmentUnitIds()
      Returns:
      every attachment unit this context may attach a root unit to, in a stable order
    • getExplicitAttachmentUnitId

      public String getExplicitAttachmentUnitId()
    • getStaticAttachmentUnitId

      public String getStaticAttachmentUnitId()
    • getDynamicAttachmentRules

      public List<DynamicAttachmentRule> getDynamicAttachmentRules()