Class ObjectQueryUtil
- java.lang.Object
-
- com.evolveum.midpoint.schema.util.ObjectQueryUtil
-
public class ObjectQueryUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description ObjectQueryUtil()
-
Method Summary
-
-
-
Method Detail
-
createNameQuery
public static ObjectQuery createNameQuery(String name, PrismContext prismContext) throws SchemaException
- Throws:
SchemaException
-
createOrigNameQuery
public static ObjectQuery createOrigNameQuery(String name, PrismContext prismContext)
-
createNameQuery
public static ObjectQuery createNameQuery(PolyStringType name, PrismContext prismContext) throws SchemaException
- Throws:
SchemaException
-
createNameQuery
public static ObjectQuery createNameQuery(PolyString name, PrismContext prismContext) throws SchemaException
- Throws:
SchemaException
-
createOidQuery
public static <O extends ObjectType> ObjectQuery createOidQuery(PrismObject<O> object) throws SchemaException
- Throws:
SchemaException
-
createOidQuery
public static ObjectQuery createOidQuery(String oid, PrismContext prismContext)
-
createOrigNameQuery
public static ObjectQuery createOrigNameQuery(PolyString name, PrismContext prismContext)
-
createNormNameQuery
public static ObjectQuery createNormNameQuery(PolyString name, PrismContext prismContext)
-
createNameQuery
public static ObjectQuery createNameQuery(ObjectType object) throws SchemaException
- 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) throws SchemaException
- Throws:
SchemaException
-
createResourceAndKind
public static ObjectQuery createResourceAndKind(String resourceOid, ShadowKindType kind)
-
createResourceAndKindIntentFilter
public static ObjectFilter createResourceAndKindIntentFilter(String resourceOid, ShadowKindType kind, String intent)
-
createResourceQuery
public static ObjectQuery createResourceQuery(String resourceOid)
-
createResourceFilter
public static ObjectFilter createResourceFilter(String resourceOid)
-
createObjectClassFilter
public static ObjectFilter createObjectClassFilter(QName objectClass)
-
createNameQuery
public static <T extends ObjectType> ObjectQuery createNameQuery(Class<T> clazz, PrismContext prismContext, String name) throws SchemaException
- Throws:
SchemaException
-
createRootOrgQuery
public static ObjectQuery createRootOrgQuery(PrismContext prismContext)
-
hasAllDefinitions
public static boolean hasAllDefinitions(ObjectQuery query)
-
hasAllDefinitions
public static boolean hasAllDefinitions(ObjectFilter filter)
-
assertPropertyOnly
public static void assertPropertyOnly(ObjectFilter filter, String message)
-
assertNotRaw
public static void assertNotRaw(ObjectFilter filter, String message)
-
dump
public static String dump(QueryType query, @NotNull @NotNull PrismContext prismContext) throws SchemaException
- Throws:
SchemaException
-
filterAnd
public static ObjectFilter filterAnd(ObjectFilter origFilter, ObjectFilter additionalFilter, PrismContext prismContext)
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
public static ObjectFilter filterOr(ObjectFilter origFilter, ObjectFilter additionalFilter, PrismContext prismContext)
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
public static boolean isAll(ObjectFilter filter)
-
isNone
public static boolean isNone(ObjectFilter filter)
-
simplify
public static ObjectFilter simplify(ObjectFilter filter)
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.
-
simplify
@Deprecated public static ObjectFilter simplify(ObjectFilter filter, PrismContext prismContext)
Deprecated.DEPRECATED - replace with simplify(filter) and make private when not used.
-
simplifyQuery
public static ObjectQuery simplifyQuery(ObjectQuery query)
Returns cloned query with simplified filter - ALL, NONE only at the top level, never UNDEFINED.
-
isNoneQuery
public static boolean isNoneQuery(ObjectQuery query)
Returns true if query is not null and its filter isNoneFilter
.
-
getResourceOidFromFilter
public static String getResourceOidFromFilter(ObjectFilter filter) throws SchemaException
- 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
public static ObjectQuery addConjunctions(ObjectQuery query, ObjectFilter... newConjunctionMembers)
-
addConjunctions
public static ObjectQuery addConjunctions(ObjectQuery query, Collection<ObjectFilter> newConjunctionMembers)
Returns non-null value if newConjunctionMembers is not empty.
-
hasFilter
public static boolean hasFilter(ObjectQuery query)
-
replaceFilter
@NotNull public static @NotNull ObjectQuery replaceFilter(ObjectQuery original, ObjectFilter newFilter)
-
convertToObjectPaging
public static ObjectPaging convertToObjectPaging(PagingType pagingType, PrismContext prismContext)
-
openItemsQuery
@NotNull public static @NotNull ObjectQuery openItemsQuery()
-
createQuery
@NotNull public static @NotNull ObjectQuery createQuery(@Nullable @Nullable ObjectFilter filter)
-
-