private Collection<SelectorOptions<GetOperationOptions>> getDefaultGetOptionCollection() { return SelectorOptions.createCollection(GetOperationOptions.createExecutionPhase()); }
private boolean nullOrHarmlessOptions(Collection<SelectorOptions<GetOperationOptions>> options) { if (options == null || options.isEmpty()) { return true; } if (options.size() > 1) { return false; } SelectorOptions<GetOperationOptions> selectorOptions = options.iterator().next(); if (!selectorOptions.isRoot()) { return false; } GetOperationOptions options1 = selectorOptions.getOptions(); // TODO FIX THIS!!! if (options1 == null || options1.equals(new GetOperationOptions()) || options1.equals(GetOperationOptions.createAllowNotFound()) || options1.equals(GetOperationOptions.createExecutionPhase())) { return true; } return false; }
private <T extends ObjectType> List<PrismObject<T>> searchObjects(Class<T> clazz, ObjectQuery query, OperationResult result, boolean preAuthorized) throws SchemaException, SecurityViolationException { if (preAuthorized) { return repositoryService.searchObjects(clazz, query, null, result); } else { try { Collection<SelectorOptions<GetOperationOptions>> options = SelectorOptions.createCollection(GetOperationOptions.createExecutionPhase()); return modelService.searchObjects(clazz, query, options, getCurrentTask(), result); } catch (ObjectNotFoundException | CommunicationException | ConfigurationException | ExpressionEvaluationException e) { throw new SystemException("Couldn't search objects: " + e.getMessage(), e); } } }
public <T extends ObjectType> T getObject(Class<T> type, String oid, boolean preAuthorized) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException { PrismObject<T> prismObject; if (preAuthorized) { prismObject = repositoryService.getObject(type, oid, null, getCurrentResult()); } else { Collection<SelectorOptions<GetOperationOptions>> options = SelectorOptions.createCollection(GetOperationOptions.createExecutionPhase()); prismObject = modelService.getObject(type, oid, options, getCurrentTask(), getCurrentResult()); } return prismObject.asObjectable(); }
@Override public <T extends ObjectType> T resolveReference(ObjectReferenceType reference) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException { if (reference == null) { return null; } QName type = reference.getType(); // TODO what about implicitly specified types, like in resourceRef? PrismObjectDefinition<T> objectDefinition = prismContext.getSchemaRegistry() .findObjectDefinitionByType(reference.getType()); if (objectDefinition == null) { throw new SchemaException("No definition for type " + type); } return modelService.getObject( objectDefinition.getCompileTimeClass(), reference.getOid(), SelectorOptions.createCollection(GetOperationOptions.createExecutionPhase()), getCurrentTask(), getCurrentResult()) .asObjectable(); }
createCollection(createExecutionPhase()), opTask, result).asObjectable(); newTask.setName(PolyStringType.fromOrig(newTask.getName().getOrig() + " " + (int) (Math.random() * 10000))); newTask.setOid(null);