public static ObjectQuery createOrigNameQuery(PolyString name, PrismContext prismContext) throws SchemaException { return prismContext.queryFor(ObjectType.class) .item(ObjectType.F_NAME).eq(name).matchingOrig() .build(); }
private ObjectFilter createFilterFor(Class<? extends Containerable> type, ItemPath path, XMLGregorianCalendar lastScanTimestamp, XMLGregorianCalendar thisScanTimestamp) { if (lastScanTimestamp == null) { return prismContext.queryFor(type) .item(path).le(thisScanTimestamp) .buildFilter(); } else { return prismContext.queryFor(type) .item(path).gt(lastScanTimestamp) .and().item(path).le(thisScanTimestamp) .buildFilter(); } }
public static ObjectFilter createResourceAndKindIntentFilter(String resourceOid, ShadowKindType kind, String intent, PrismContext prismContext) throws SchemaException { Validate.notNull(resourceOid, "Resource where to search must not be null."); Validate.notNull(kind, "Kind to search must not be null."); Validate.notNull(prismContext, "Prism context must not be null."); return prismContext.queryFor(ShadowType.class) .item(ShadowType.F_RESOURCE_REF).ref(resourceOid) .and().item(ShadowType.F_KIND).eq(kind) .and().item(ShadowType.F_INTENT).eq(intent) .buildFilter(); }
boolean hasNoResponseCases(String campaignOid, OperationResult result) { ObjectQuery query = prismContext.queryFor(AccessCertificationCaseType.class) .ownerId(campaignOid) .and().item(AccessCertificationCaseType.F_OUTCOME).eq(SchemaConstants.MODEL_CERTIFICATION_OUTCOME_NO_RESPONSE) .build(); return repositoryService.countContainers(AccessCertificationCaseType.class, query, null, result) > 0; } }
<C extends Containerable, T> ObjectFilter createEqualFilter(ItemPath propertyPath, Class<C> type, T realValue) throws SchemaException { return prismContext.queryFor(type) .item(propertyPath).eq(realValue) .buildFilter(); }
public static ObjectFilter createResourceFilter(String resourceOid, PrismContext prismContext) throws SchemaException { return prismContext.queryFor(ShadowType.class) .item(ShadowType.F_RESOURCE_REF).ref(resourceOid) .buildFilter(); }
private static ObjectFilter createResourceAndKindFilter(String resourceOid, ShadowKindType kind, PrismContext prismContext) throws SchemaException { Validate.notNull(resourceOid, "Resource where to search must not be null."); Validate.notNull(kind, "Kind to search must not be null."); Validate.notNull(prismContext, "Prism context must not be null."); return prismContext.queryFor(ShadowType.class) .item(ShadowType.F_RESOURCE_REF).ref(resourceOid) .and().item(ShadowType.F_KIND).eq(kind) .buildFilter(); }
List<AccessCertificationCaseType> getAllCurrentIterationCases(String campaignOid, int iteration, Collection<SelectorOptions<GetOperationOptions>> options, OperationResult result) throws SchemaException { ObjectQuery query = prismContext.queryFor(AccessCertificationCaseType.class) .ownerId(campaignOid) .and().item(AccessCertificationCaseType.F_ITERATION).eq(iteration) .build(); return repositoryService.searchContainers(AccessCertificationCaseType.class, query, options, result); }
public static ObjectFilter createObjectClassFilter(QName objectClass, PrismContext prismContext) { return prismContext.queryFor(ShadowType.class) .item(ShadowType.F_OBJECT_CLASS).eq(objectClass) .buildFilter(); }
public static ObjectQuery createAllShadowsQuery(ResourceType resourceType, QName objectClass, PrismContext prismContext) throws SchemaException { return prismContext.queryFor(ShadowType.class) .item(ShadowType.F_RESOURCE_REF).ref(resourceType.getOid()) .and().item(ShadowType.F_OBJECT_CLASS).eq(objectClass) .build(); }
<C extends Containerable, T> ObjectFilter createEqualFilter(QName propertyName, Class<C> type, T realValue) throws SchemaException { return prismContext.queryFor(type) .item(propertyName).eq(realValue) .buildFilter(); }
public static S_AtomicFilterExit createResourceAndObjectClassFilterPrefix(String resourceOid, QName objectClass, PrismContext prismContext) throws SchemaException { Validate.notNull(resourceOid, "Resource where to search must not be null."); Validate.notNull(objectClass, "Object class to search must not be null."); Validate.notNull(prismContext, "Prism context must not be null."); return prismContext.queryFor(ShadowType.class) .item(ShadowType.F_RESOURCE_REF).ref(resourceOid) .and().item(ShadowType.F_OBJECT_CLASS).eq(objectClass); }