Class CollectAttachmentContext
java.lang.Object
fr.gouv.vitam.worker.core.extractseda.CollectAttachmentContext
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 Summary
ConstructorsConstructorDescriptionCollectAttachmentContext(String explicitAttachmentUnitId, String staticAttachmentUnitId, List<DynamicAttachmentRule> dynamicAttachmentRules) -
Method Summary
Modifier and TypeMethodDescriptionstatic CollectAttachmentContextempty()static CollectAttachmentContextstatic CollectAttachmentContextofProject(String staticAttachmentUnitId, List<DynamicAttachmentRule> dynamicAttachmentRules) resolveRootParentUnitIds(com.fasterxml.jackson.databind.JsonNode unitMetadata, boolean carriesUpdateOperation) Resolves the parent units of a root archive unit, by decreasing priority : the explicit X-Attachement-Id target, nothing else applies the unit declares an UpdateOperation, no project attachment applies every dynamic rule the unit metadata matches the static attachment unit no attachment
-
Constructor Details
-
CollectAttachmentContext
public CollectAttachmentContext(String explicitAttachmentUnitId, String staticAttachmentUnitId, List<DynamicAttachmentRule> dynamicAttachmentRules)
-
-
Method Details
-
empty
-
explicit
-
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 :- the explicit X-Attachement-Id target, nothing else applies
- the unit declares an UpdateOperation, no project attachment applies
- every dynamic rule the unit metadata matches
- the static attachment unit
- no attachment
- Parameters:
unitMetadata- metadata of the archive unit, used by the dynamic rulescarriesUpdateOperation- whether the archive unit declares an UpdateOperation of its own- Returns:
- the parent unit ids, never null
-
attachmentUnitIds
- Returns:
- every attachment unit this context may attach a root unit to, in a stable order
-
getExplicitAttachmentUnitId
-
getStaticAttachmentUnitId
-
getDynamicAttachmentRules
-