Class ObjectQueryUtil
java.lang.Object
com.evolveum.midpoint.schema.util.ObjectQueryUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectQuery
addConjunctions
(ObjectQuery query, ObjectFilter... newConjunctionMembers) static ObjectQuery
addConjunctions
(ObjectQuery query, Collection<ObjectFilter> newConjunctionMembers) Returns non-null value if newConjunctionMembers is not empty.static void
assertNotRaw
(ObjectFilter filter, String message) static void
assertPropertyOnly
(ObjectFilter filter, String message) static ObjectPaging
convertToObjectPaging
(PagingType pagingType) static ObjectQuery
createNameQuery
(PolyString name) static <O extends ObjectType>
ObjectQuerycreateNameQuery
(PrismObject<O> object) static ObjectQuery
createNameQuery
(ObjectType object) static ObjectQuery
static <T extends ObjectType>
ObjectQuerycreateNameQuery
(Class<T> clazz, String name) static ObjectQuery
createNameQuery
(String name) static ObjectQuery
static ObjectFilter
createObjectClassFilter
(QName objectClass) static @NotNull ObjectFilter
createObjectTypesFilter
(@NotNull String resourceOid, @NotNull Collection<ShadowRelationParticipantType> targetParticipantTypes, boolean executableOnResource, Object errorCtx) Creates a filter that matches target objects for given reference or association definition.static <O extends ObjectType>
ObjectQuerycreateOidQuery
(PrismObject<O> object) static ObjectQuery
createOidQuery
(String oid) static ObjectQuery
static ObjectQuery
createOrigNameQuery
(String name) static @NotNull ObjectQuery
createQuery
(@Nullable ObjectFilter filter) static List<PrismReferenceValue>
createReferences
(String oid, RelationKindType kind, RelationRegistry relationRegistry) static List<PrismReferenceValue>
createReferences
(Collection<String> oids, RelationKindType kind, RelationRegistry relationRegistry) static ObjectQuery
createResourceAndKind
(String resourceOid, ShadowKindType kind) static @NotNull ObjectQuery
createResourceAndKindIntent
(String resourceOid, ShadowKindType kind, String intent) static ObjectFilter
createResourceAndKindIntentFilter
(String resourceOid, ShadowKindType kind, String intent) static ObjectFilter
createResourceAndObjectClassFilter
(String resourceOid, QName objectClass) static ObjectFilter
createResourceAndObjectClassFilter
(String resourceOid, QName objectClass, PrismContext ignored) Deprecated.static S_FilterExit
createResourceAndObjectClassFilterPrefix
(String resourceOid, QName objectClass) static @NotNull ObjectQuery
createResourceAndObjectClassQuery
(String resourceOid, QName objectClass) static @NotNull ObjectQuery
createResourceAndObjectClassQuery
(String resourceOid, QName objectClass, PrismContext ignored) Deprecated.static ObjectFilter
createResourceFilter
(String resourceOid) static ObjectQuery
createResourceQuery
(String resourceOid) static ObjectQuery
createRootOrgQuery
(PrismContext prismContext) static String
dump
(QueryType query, @NotNull PrismContext prismContext) static @NotNull ObjectQuery
emptyIfNull
(ObjectQuery objectQuery) static ObjectFilter
filterAnd
(ObjectFilter origFilter, ObjectFilter additionalFilter) Merges the two provided arguments into one AND filter in the most efficient way.static ObjectFilter
filterAndImmutable
(@Nullable ObjectFilter origFilter, @Nullable ObjectFilter additionalFilter) Merges the two provided arguments into one AND filter in an immutable way.static ObjectFilter
filterOr
(ObjectFilter origFilter, ObjectFilter additionalFilter) Merges the two provided arguments into one OR filter in the most efficient way.static ObjectFilter
filterOrImmutable
(ObjectFilter origFilter, ObjectFilter additionalFilter) Merges the two provided arguments into one OR filter in an immutable way.static @NotNull ResourceOperationCoordinates
getOperationCoordinates
(ObjectFilter filter) static @NotNull ResourceOperationCoordinates
static String
getResourceOidFromFilter
(ObjectFilter filter) static ResourceShadowCoordinates
getShadowCoordinates
(ObjectFilter filter, PrismContext ignored) Deprecated.static ResourceShadowCoordinates
getShadowCoordinates
(ObjectQuery query) static boolean
hasAllDefinitions
(ObjectFilter filter) static boolean
hasAllDefinitions
(ObjectQuery query) static boolean
hasFilter
(ObjectQuery query) static boolean
isAll
(ObjectFilter filter) static boolean
isNone
(ObjectFilter filter) static boolean
isNoneQuery
(ObjectQuery query) Returns true if query is not null and its filter isNoneFilter
.static @NotNull ObjectQuery
static @NotNull ObjectQuery
replaceFilter
(ObjectQuery original, ObjectFilter newFilter) static ObjectFilter
simplify
(ObjectFilter filter) Returns ALL, NONE only at the top level (never inside the filter), never returns UNDEFINED.static ObjectQuery
simplifyQuery
(ObjectQuery query) Returns cloned query with simplified filter - ALL, NONE only at the top level, never UNDEFINED.
-
Constructor Details
-
ObjectQueryUtil
public ObjectQueryUtil()
-
-
Method Details
-
createNameQuery
- Throws:
SchemaException
-
createOrigNameQuery
-
createNameQuery
- Throws:
SchemaException
-
createNameQuery
- Throws:
SchemaException
-
createOidQuery
public static <O extends ObjectType> ObjectQuery createOidQuery(PrismObject<O> object) throws SchemaException - Throws:
SchemaException
-
createOidQuery
-
createOrigNameQuery
-
createNormNameQuery
-
createNameQuery
- Throws:
SchemaException
-
createNameQuery
public static <O extends ObjectType> ObjectQuery createNameQuery(PrismObject<O> object) throws SchemaException - Throws:
SchemaException
-
createResourceAndObjectClassQuery
@Deprecated @NotNull public static @NotNull ObjectQuery createResourceAndObjectClassQuery(String resourceOid, QName objectClass, PrismContext ignored) Deprecated. -
createResourceAndObjectClassQuery
@NotNull public static @NotNull ObjectQuery createResourceAndObjectClassQuery(String resourceOid, QName objectClass) -
createResourceAndObjectClassFilter
@Deprecated public static ObjectFilter createResourceAndObjectClassFilter(String resourceOid, QName objectClass, PrismContext ignored) Deprecated. -
createResourceAndObjectClassFilter
public static ObjectFilter createResourceAndObjectClassFilter(String resourceOid, QName objectClass) -
createResourceAndObjectClassFilterPrefix
public static S_FilterExit createResourceAndObjectClassFilterPrefix(String resourceOid, QName objectClass) -
createResourceAndKindIntent
@NotNull public static @NotNull ObjectQuery createResourceAndKindIntent(String resourceOid, ShadowKindType kind, String intent) -
createResourceAndKind
-
createResourceAndKindIntentFilter
public static ObjectFilter createResourceAndKindIntentFilter(String resourceOid, ShadowKindType kind, String intent) -
createResourceQuery
-
createResourceFilter
-
createObjectClassFilter
-
createNameQuery
public static <T extends ObjectType> ObjectQuery createNameQuery(Class<T> clazz, String name) throws SchemaException - Throws:
SchemaException
-
createRootOrgQuery
-
hasAllDefinitions
-
hasAllDefinitions
-
assertPropertyOnly
-
assertNotRaw
-
dump
public static String dump(QueryType query, @NotNull @NotNull PrismContext prismContext) throws SchemaException - Throws:
SchemaException
-
filterAnd
Merges the two provided arguments into one AND filter in the most efficient way. *Please note: If provided `origFilter` isAndFilter
it will be modified!* TODO consider moving to QueryFactory -
filterAndImmutable
public static ObjectFilter filterAndImmutable(@Nullable @Nullable ObjectFilter origFilter, @Nullable @Nullable ObjectFilter additionalFilter) Merges the two provided arguments into one AND filter in an immutable way. If provided `origFilter` isAndFilter
, it will be cloned first, then modified. Although input objects are not changed, there is no guarantee that new object is always returned. For many simple and/or corner cases one of the parameters may be returned, so it may not be safe to mutate the returned value. TODO consider moving to QueryFactory -
filterOr
Merges the two provided arguments into one OR filter in the most efficient way. *Please note: If provided `origFilter` isOrFilter
it will be modified!* TODO consider moving to QueryFactory -
filterOrImmutable
public static ObjectFilter filterOrImmutable(ObjectFilter origFilter, ObjectFilter additionalFilter) Merges the two provided arguments into one OR filter in an immutable way. If provided `origFilter` isOrFilter
, it will be cloned first, then modified. Although input objects are not changed, there is no guarantee that new object is always returned. For many simple and/or corner cases one of the parameters may be returned, so it may not be safe to mutate the returned value. TODO consider moving to QueryFactory -
isAll
-
isNone
-
simplify
Returns ALL, NONE only at the top level (never inside the filter), never returns UNDEFINED. This always returns cloned filter which can be freely modify later. -
simplifyQuery
Returns cloned query with simplified filter - ALL, NONE only at the top level, never UNDEFINED. -
isNoneQuery
Returns true if query is not null and its filter isNoneFilter
. -
getResourceOidFromFilter
- Throws:
SchemaException
-
getShadowCoordinates
@Deprecated public static ResourceShadowCoordinates getShadowCoordinates(ObjectFilter filter, PrismContext ignored) throws SchemaException Deprecated.- Throws:
SchemaException
-
getOperationCoordinates
@NotNull public static @NotNull ResourceOperationCoordinates getOperationCoordinates(ObjectQuery query) throws SchemaException - Throws:
SchemaException
-
getShadowCoordinates
public static ResourceShadowCoordinates getShadowCoordinates(ObjectQuery query) throws SchemaException - Throws:
SchemaException
-
getOperationCoordinates
@NotNull public static @NotNull ResourceOperationCoordinates getOperationCoordinates(ObjectFilter filter) throws SchemaException - Throws:
SchemaException
-
createReferences
public static List<PrismReferenceValue> createReferences(String oid, RelationKindType kind, RelationRegistry relationRegistry) -
createReferences
public static List<PrismReferenceValue> createReferences(Collection<String> oids, RelationKindType kind, RelationRegistry relationRegistry) -
addConjunctions
-
addConjunctions
public static ObjectQuery addConjunctions(ObjectQuery query, Collection<ObjectFilter> newConjunctionMembers) Returns non-null value if newConjunctionMembers is not empty. -
hasFilter
-
replaceFilter
@NotNull public static @NotNull ObjectQuery replaceFilter(ObjectQuery original, ObjectFilter newFilter) -
convertToObjectPaging
-
openItemsQuery
-
createQuery
-
emptyIfNull
-
createObjectTypesFilter
@NotNull public static @NotNull ObjectFilter createObjectTypesFilter(@NotNull @NotNull String resourceOid, @NotNull @NotNull Collection<ShadowRelationParticipantType> targetParticipantTypes, boolean executableOnResource, Object errorCtx) Creates a filter that matches target objects for given reference or association definition. For internal use by reference and association definitions.
-