Class BulkIdResolverAbstract<T extends com.fasterxml.jackson.databind.JsonNode>
- java.lang.Object
-
- de.captaingoldfish.scim.sdk.server.endpoints.bulkid.BulkIdResolverAbstract<T>
-
public abstract class BulkIdResolverAbstract<T extends com.fasterxml.jackson.databind.JsonNode> extends Object
author Pascal Knueppel
created at: 21.08.2022 - 13:47
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,List<BulkIdReferenceWrapper>>bulkIdReferencescontains all bulkId reference of theresource.protected StringoperationBulkIdthe bulkId that is representing this bulk operation detailsprotected Set<String>referencedBulkIdscontains all referenced bulkIds from this operation.protected Tresourcethe resource object that might contain some bulkId referencesprotected UriInfosuriInfosthe uri information of the currently accessed resource-type
-
Constructor Summary
Constructors Constructor Description BulkIdResolverAbstract(String operationBulkId, UriInfos uriInfos, T resource)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcheckForBulkIdReferenceValidity(String bulkIdReferenceValue)protected booleancontainsBulkIdReference(com.fasterxml.jackson.databind.JsonNode jsonNode)verifies if the given node does even contain a bulkIdprotected voidfindAllBulkIdReferences()this method will retrieve all bulkId references present within theresourceobjectprotected abstract List<BulkIdReferenceWrapper>getComplexBulkIdNodes()this method must return the bulkId references from the resource that are based on the complex-node bulkId specificationprotected abstract List<BulkIdReferenceWrapper>getDirectBulkIdNodes()this method must return the bulkId references from the resource that are based on the simple-node bulkId specificationStringgetOperationBulkId()the bulkId that is representing this bulk operation detailsSet<String>getReferencedBulkIds()contains all referenced bulkIds from this operation.TgetResource()the resource object that might contain some bulkId references<R extends ScimObjectNode>
RgetResource(Class<R> type)Set<String>getUnresolvedBulkIds()UriInfosgetUriInfos()the uri information of the currently accessed resource-typebooleanhasAnyBulkIdReferences()booleanhasSelfReference()checks if this operation contains a self-referencebooleanisHadSuccessInLastRun()a bulk operation may be processed several times if bulkIds need to be resolved.voidreplaceBulkIdNode(String bulkId, String value)will replace the values marked with the given bulkId by the given value
-
-
-
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 theresource. 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
-
-
Method Detail
-
findAllBulkIdReferences
protected void findAllBulkIdReferences()
this method will retrieve all bulkId references present within theresourceobject
-
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 replacedvalue- 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)
-
getResource
public <R extends ScimObjectNode> R getResource(Class<R> type)
-
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.
-
-