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:
  • Constructor Details

    • SelectorOptions

      public SelectorOptions(ObjectSelector selector, T options)
    • SelectorOptions

      public SelectorOptions(T options)
    • SelectorOptions

      public SelectorOptions(@NotNull @NotNull SelectorOptions<T> prototype)
  • Method Details

    • create

      public static <T> SelectorOptions<T> create(UniformItemPath path, T options)
    • create

      public static <T> SelectorOptions<T> create(T options)
    • createCollection

      public static <T> Collection<SelectorOptions<T>> createCollection(UniformItemPath path, T options)
    • createCollection

      public static <T> Collection<SelectorOptions<T>> createCollection(T options)
    • createCollection

      public static <T> Collection<SelectorOptions<T>> createCollection(T options, UniformItemPath... paths)
    • getSelector

      public ObjectSelector getSelector()
    • getOptions

      public T getOptions()
    • getItemPath

      @NotNull public @NotNull UniformItemPath getItemPath(UniformItemPath emptyPath)
    • getItemPath

      @NotNull public @NotNull ItemPath getItemPath()
    • findRootOptions

      public static <T> T findRootOptions(Collection<SelectorOptions<T>> options)
      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

      public static boolean isRetrievedFullyByDefault(Class<?> objectType)
    • 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. See GetOperationOptions.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 from hasToIncludePath(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 of hasToIncludePath(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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • debugDump

      public String debugDump(int indent)
      Specified by:
      debugDump in interface DebugDumpable
    • shortDump

      public void shortDump(StringBuilder sb)
      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 interface ShortDumpable
      Parameters:
      sb - StringBuilder to which to a compact one-line content of the object intended for diagnostics by system administrator should be appended.
    • clone

      public SelectorOptions<T> clone()
      Overrides:
      clone in class Object