Skip to content

Commit

Permalink
Mark selected GetOperationOptions as cache-neutral
Browse files Browse the repository at this point in the history
The doNotDiscovery, forceRefresh, forceRetry, errorHandling options
are currently relevant only at the level of provisioning module.
They do not affect processing in repository in any way, so they can
be considered neutral (harmless) from the caching point of view.

This resolves MID-7040.
  • Loading branch information
mederly committed May 7, 2021
1 parent 2c3ceec commit be8352b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
Expand Up @@ -147,8 +147,10 @@ public <T extends Containerable> int countContainers(Class<T> type, ObjectQuery

//region --- ADD, MODIFY, DELETE and other modifications -------------------------------------------------------

@NotNull
@Override
public <T extends ObjectType> @NotNull String addObject(@NotNull PrismObject<T> object, RepoAddOptions options, @NotNull OperationResult parentResult)
public <T extends ObjectType> String addObject(@NotNull PrismObject<T> object, RepoAddOptions options,
@NotNull OperationResult parentResult)
throws ObjectAlreadyExistsException, SchemaException {
return modificationOpHandler.addObject(object, options, parentResult);
}
Expand Down
Expand Up @@ -79,15 +79,31 @@ static PassReason determine(Collection<SelectorOptions<GetOperationOptions>> opt
}
GetOperationOptions cloned = selectorOptions.getOptions().clone();

// Options considered harmful:
// - retrieve
// - resolve
// - resolveNames
// - raw (because of strange definition handling)
// - tolerateRawData (this is questionable, though)
// - relationalValueSearchQuery
// - distinct
// - attachDiagData
// - definitionProcessing
// - iterationMethod

// Eliminate harmless options
cloned.doNotDiscovery(null);
cloned.setForceRefresh(null);
cloned.setForceRetry(null);
cloned.setAllowNotFound(null);
cloned.setExecutionPhase(null);
cloned.setReadOnly(null);
cloned.setNoFetch(null);
cloned.setPointInTimeType(null); // This is not used by repository anyway.
cloned.setPointInTimeType(null); // This is not used by repository anyway.
// We know the staleness is not zero, so caching is (in principle) allowed.
// More detailed treatment of staleness is not yet available.
cloned.setStaleness(null);
cloned.setErrorHandling(null);
if (cloned.equals(GetOperationOptions.EMPTY)) {
return null;
}
Expand Down

0 comments on commit be8352b

Please sign in to comment.