Package com.evolveum.midpoint.schema
Class SelectorOptions<T>
java.lang.Object
com.evolveum.midpoint.schema.SelectorOptions<T>
- All Implemented Interfaces:
DebugDumpable
,ShortDumpable
,Serializable
,Cloneable
public class SelectorOptions<T>
extends Object
implements Serializable, DebugDumpable, ShortDumpable, Cloneable
- Author:
- semancik
- See Also:
-
Field Summary
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
Constructor Summary
ConstructorDescriptionSelectorOptions
(@NotNull SelectorOptions<T> prototype) SelectorOptions
(ObjectSelector selector, T options) SelectorOptions
(T options) -
Method Summary
Modifier and TypeMethodDescriptionclone()
static <T> SelectorOptions<T>
create
(UniformItemPath path, T options) static <T> SelectorOptions<T>
create
(T options) static <T> Collection<SelectorOptions<T>>
createCollection
(UniformItemPath path, T options) static <T> Collection<SelectorOptions<T>>
createCollection
(T options) static <T> Collection<SelectorOptions<T>>
createCollection
(T options, UniformItemPath... paths) debugDump
(int indent) boolean
static boolean
excludesSomethingFromRetrieval
(@Nullable Collection<SelectorOptions<GetOperationOptions>> options) Very primitive method that checks whether there is an instruction to exclude any item from retrieval.extractOptionValues
(Collection<SelectorOptions<GetOperationOptions>> options, Function<GetOperationOptions, T> supplier) static List<SelectorOptions<GetOperationOptions>>
static <T> @NotNull Collection<T>
findOptionsForPath
(Collection<SelectorOptions<T>> options, @NotNull UniformItemPath path) Finds all the options for given path.static <T> T
findRootOptions
(Collection<SelectorOptions<T>> options) Returns options that apply to the "root" object.@NotNull ItemPath
@NotNull UniformItemPath
getItemPath
(UniformItemPath emptyPath) int
hashCode()
static boolean
hasToFetchPathNotRetrievedByDefault
(@NotNull ItemPath path, @Nullable Collection<SelectorOptions<GetOperationOptions>> options) Returns true if the asked path must be considered for fetching based on the provided get options.static boolean
hasToIncludePath
(@NotNull ItemPath path, @Nullable Collection<SelectorOptions<GetOperationOptions>> options, boolean defaultValue) Returns true if the asked path must be included in the object based on the provided get options.static boolean
isRetrievedFullyByDefault
(Class<?> objectType) boolean
isRoot()
void
Show the content of the object intended for diagnostics.toString()
static <T> @NotNull Collection<SelectorOptions<T>>
updateRootOptions
(@Nullable Collection<SelectorOptions<T>> options, @NotNull Consumer<T> updater, Supplier<T> newValueSupplier) Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazily
Methods inherited from interface com.evolveum.midpoint.util.ShortDumpable
shortDump, shortDumpLazily
-
Constructor Details
-
SelectorOptions
-
SelectorOptions
-
SelectorOptions
-
-
Method Details
-
create
-
create
-
createCollection
-
createCollection
-
createCollection
public static <T> Collection<SelectorOptions<T>> createCollection(T options, UniformItemPath... paths) -
getSelector
-
getOptions
-
getItemPath
-
getItemPath
-
findRootOptions
Returns options that apply to the "root" object. I.e. options that have null selector, null path, empty path, ... Must return 'live object' that could be modified. -
updateRootOptions
@NotNull public static <T> @NotNull Collection<SelectorOptions<T>> updateRootOptions(@Nullable @Nullable Collection<SelectorOptions<T>> options, @NotNull @NotNull Consumer<T> updater, Supplier<T> newValueSupplier) -
findOptionsForPath
@NotNull public static <T> @NotNull Collection<T> findOptionsForPath(Collection<SelectorOptions<T>> options, @NotNull @NotNull UniformItemPath path) Finds all the options for given path. TODO could there be more than one? Returns live objects that could be modified by client. -
isRoot
public boolean isRoot() -
isRetrievedFullyByDefault
-
excludesSomethingFromRetrieval
public static boolean excludesSomethingFromRetrieval(@Nullable @Nullable Collection<SelectorOptions<GetOperationOptions>> options) Very primitive method that checks whether there is an instruction to exclude any item from retrieval. -
hasToIncludePath
public static boolean hasToIncludePath(@NotNull @NotNull ItemPath path, @Nullable @Nullable Collection<SelectorOptions<GetOperationOptions>> options, boolean defaultValue) Returns true if the asked path must be included in the object based on the provided get options. SeeGetOperationOptions.retrieve
javadoc for more details. Retrieve option with null or empty path asks to load everything. This is not used only in repository but also for retrieving information during provisioning. Default value must be explicitly provided as it depends on the context of the question. Simplified example: When we ask for path "x/y", the path itself and anything under it is to be included. User wants "x/y", as well as "x/y/ya", etc. User does not say anything about path "x" (prefix) or "z" (different path altogether). If no option defines what to do with the asked path, defaultValue is returned. -
hasToFetchPathNotRetrievedByDefault
public static boolean hasToFetchPathNotRetrievedByDefault(@NotNull @NotNull ItemPath path, @Nullable @Nullable Collection<SelectorOptions<GetOperationOptions>> options) Returns true if the asked path must be considered for fetching based on the provided get options. This is different fromhasToIncludePath(ItemPath, Collection, boolean)
as it considers path relation in any direction (subpath or prefix or equal). This is typical for repository usage that asks questions like: "Should I load container x *that I don't fetch by default*?" When the user specifies options with retrieve of the path inside that container, e.g. "x/a"), he does not state that he wants to fetch "x", but the repo can't just ignore processing of "x" and skip it altogether if it is stored separately. At the same time, original semantics ofhasToIncludePath(ItemPath, Collection, boolean)
has to hold as well - if user asks to load "a", repo needs to fetch "a/b" as well (everything under "a"). Simplified example: When we ask for path "x/y", the path itself, any subpath and any prefix must be considered for fetching. User wants "x/y", as well as "x/y/ya", etc. User does not say anything about path "x" (prefix) or "z" (different path altogether), but while we can ignore "z", we must consider "x" if the repo does not provide it by default. In that case it needs to fetch it (fully or partially, whatever is practical and/or efficient) to provide the requested "x/y" content. -
filterRetrieveOptions
public static List<SelectorOptions<GetOperationOptions>> filterRetrieveOptions(Collection<SelectorOptions<GetOperationOptions>> options) -
extractOptionValues
public static <T> Map<T,PathSet> extractOptionValues(Collection<SelectorOptions<GetOperationOptions>> options, Function<GetOperationOptions, T> supplier) -
equals
-
hashCode
public int hashCode() -
toString
-
debugDump
- Specified by:
debugDump
in interfaceDebugDumpable
-
shortDump
Description copied from interface:ShortDumpable
Show the content of the object intended for diagnostics. This method is supposed to append a compact, human-readable output in a single line. Unlike toString() method, there is no requirement to identify the actual class or type of the object. It is assumed that the class/type will be obvious from the context in which the output is used.- Specified by:
shortDump
in interfaceShortDumpable
- Parameters:
sb
- StringBuilder to which to a compact one-line content of the object intended for diagnostics by system administrator should be appended.
-
clone
-