use of com.evolveum.midpoint.prism.path.UniformItemPath in project midpoint by Evolveum.
the class ReferenceNameResolver method getPathsToResolve.
@NotNull
private static List<? extends ItemPath> getPathsToResolve(Collection<SelectorOptions<GetOperationOptions>> options) {
final UniformItemPath emptyPath = PrismContext.get().emptyPath();
List<UniformItemPath> rv = new ArrayList<>();
if (options == null || options.isEmpty()) {
return rv;
}
for (SelectorOptions<GetOperationOptions> option : options) {
if (GetOperationOptions.isResolveNames(option.getOptions())) {
rv.add(option.getItemPath(emptyPath));
}
}
return rv;
}
use of com.evolveum.midpoint.prism.path.UniformItemPath in project midpoint by Evolveum.
the class EntityRegistry method hasAttributePathOverride.
public boolean hasAttributePathOverride(ManagedType<?> type, ItemPath pathOverride) {
Map<UniformItemPath, Attribute<?, ?>> overrides = attributeNamePathOverrides.get(type);
if (overrides == null) {
return false;
}
ItemPath namedOnly = pathOverride.namedSegmentsOnly();
for (UniformItemPath path : overrides.keySet()) {
if (path.isSuperPathOrEquivalent(namedOnly)) {
return true;
}
}
return false;
}
use of com.evolveum.midpoint.prism.path.UniformItemPath in project midpoint by Evolveum.
the class GetOperationOptions method toRestIncludeOption.
public static List<String> toRestIncludeOption(Collection<SelectorOptions<GetOperationOptions>> options) {
List<SelectorOptions<GetOperationOptions>> includeOptions = SelectorOptions.filterRetrieveOptions(options);
List<String> includePaths = new ArrayList<>();
for (SelectorOptions<GetOperationOptions> includeOption : includeOptions) {
UniformItemPath path = includeOption.getSelector().getPath();
includePaths.add(path.namedSegmentsOnly().toString());
}
return includePaths;
}
use of com.evolveum.midpoint.prism.path.UniformItemPath in project midpoint by Evolveum.
the class GetOperationOptions method merge.
@NotNull
@SafeVarargs
public static Collection<SelectorOptions<GetOperationOptions>> merge(PrismContext prismContext, Collection<SelectorOptions<GetOperationOptions>>... parts) {
final UniformItemPath emptyPath = prismContext.emptyPath();
Collection<SelectorOptions<GetOperationOptions>> merged = new ArrayList<>();
for (Collection<SelectorOptions<GetOperationOptions>> part : parts) {
for (SelectorOptions<GetOperationOptions> increment : CollectionUtils.emptyIfNull(part)) {
if (increment != null) {
// should always be so
Collection<GetOperationOptions> existing = SelectorOptions.findOptionsForPath(merged, increment.getItemPath(emptyPath));
if (existing.isEmpty()) {
merged.add(increment);
} else if (existing.size() == 1) {
existing.iterator().next().merge(increment.getOptions());
} else {
throw new AssertionError("More than one options for path: " + increment.getItemPath(emptyPath));
}
}
}
}
return merged;
}
use of com.evolveum.midpoint.prism.path.UniformItemPath in project midpoint by Evolveum.
the class GetOperationOptionsBuilderImpl method forPaths.
private GetOperationOptionsBuilderImpl forPaths(Consumer<GetOperationOptions> modifier) {
for (UniformItemPath path : currentPaths) {
GetOperationOptions optionsForPath = options.computeIfAbsent(path, (key) -> new GetOperationOptions());
modifier.accept(optionsForPath);
}
return this;
}
Aggregations