@Test(expectedExceptions = FaultMessage.class) public void testGetEmptyOid() throws FaultMessage { try { modelService.getObject(UserType.COMPLEX_TYPE, "", new SelectorQualifiedGetOptionsType(), new Holder<ObjectType>(), new Holder<OperationResultType>()); } catch (FaultMessage ex) { ModelTUtil.assertIllegalArgumentFault(ex); } Assert.fail("get must fail"); }
@Override public void getObject(QName objectType, String oid, SelectorQualifiedGetOptionsType optionsType, Holder<ObjectType> objectHolder, Holder<OperationResultType> resultHolder) throws FaultMessage { notNullArgument(objectType, "Object type must not be null."); notEmptyArgument(oid, "Oid must not be null or empty."); Task task = createTaskInstance(GET_OBJECT); auditLogin(task); OperationResult operationResult = task.getResult(); try { Class objectClass = ObjectTypes.getObjectTypeFromTypeQName(objectType).getClassDefinition(); Collection<SelectorOptions<GetOperationOptions>> options = MiscSchemaUtil.optionsTypeToOptions(optionsType); PrismObject<? extends ObjectType> object = model.getObject(objectClass, oid, options, task, operationResult); handleOperationResult(operationResult, resultHolder); objectHolder.value = object.asObjectable(); return; } catch (Exception ex) { LoggingUtils.logException(LOGGER, "# MODEL getObject() failed", ex); throwFault(ex, operationResult); } finally { auditLogout(task); } }
ModelWebService extends AbstractModelWebService implements ModelPortType, ModelPort { @Override public void getObject(QName objectType, String oid, SelectorQualifiedGetOptionsType optionsType, Holder<ObjectType> objectHolder, Holder<OperationResultType> resultHolder) throws FaultMessage { notNullArgument(objectType, "Object type must not be null."); notEmptyArgument(oid, "Oid must not be null or empty."); Task task = createTaskInstance(GET_OBJECT); auditLogin(task); OperationResult operationResult = task.getResult(); try { Class objectClass = ObjectTypes.getObjectTypeFromTypeQName(objectType).getClassDefinition(); Collection<SelectorOptions<GetOperationOptions>> options = MiscSchemaUtil.optionsTypeToOptions(optionsType); PrismObject<? extends ObjectType> object = model.getObject(objectClass, oid, options, task, operationResult); handleOperationResult(operationResult, resultHolder); objectHolder.value = object.asObjectable(); return; } catch (Exception ex) { LoggingUtils.logException(LOGGER, "# MODEL getObject() failed", ex); throwFault(ex, operationResult); } finally { auditLogout(task); } } }
ModelWebService extends AbstractModelWebService implements ModelPortType, ModelPort { @Override public void getObject(QName objectType, String oid, SelectorQualifiedGetOptionsType optionsType, Holder<ObjectType> objectHolder, Holder<OperationResultType> resultHolder) throws FaultMessage { notNullArgument(objectType, "Object type must not be null."); notEmptyArgument(oid, "Oid must not be null or empty."); Task task = createTaskInstance(GET_OBJECT); auditLogin(task); OperationResult operationResult = task.getResult(); try { Class objectClass = ObjectTypes.getObjectTypeFromTypeQName(objectType).getClassDefinition(); Collection<SelectorOptions<GetOperationOptions>> options = MiscSchemaUtil.optionsTypeToOptions(optionsType); PrismObject<? extends ObjectType> object = model.getObject(objectClass, oid, options, task, operationResult); handleOperationResult(operationResult, resultHolder); objectHolder.value = object.asObjectable(); return; } catch (Exception ex) { LoggingUtils.logException(LOGGER, "# MODEL getObject() failed", ex); throwFault(ex, operationResult); } finally { auditLogout(task); } }  }
ModelWebService extends AbstractModelWebService implements ModelPortType, ModelPort { @Override public void getObject(QName objectType, String oid, SelectorQualifiedGetOptionsType optionsType, Holder<ObjectType> objectHolder, Holder<OperationResultType> resultHolder) throws FaultMessage { notNullArgument(objectType, "Object type must not be null."); notEmptyArgument(oid, "Oid must not be null or empty."); Task task = createTaskInstance(GET_OBJECT); auditLogin(task); OperationResult operationResult = task.getResult(); try { Class objectClass = ObjectTypes.getObjectTypeFromTypeQName(objectType).getClassDefinition(); Collection<SelectorOptions<GetOperationOptions>> options = MiscSchemaUtil.optionsTypeToOptions(optionsType); PrismObject<? extends ObjectType> object = model.getObject(objectClass, oid, options, task, operationResult); handleOperationResult(operationResult, resultHolder); objectHolder.value = object.asObjectable(); return; } catch (Exception ex) { LoggingUtils.logException(LOGGER, "# MODEL getObject() failed", ex); throwFault(ex, operationResult); } finally { auditLogout(task); } }  @Override void getObject(QName objectType, String oid, SelectorQualifiedGetOptionsType optionsType,
			Holder<ObjectType> objectHolder, Holder<OperationResultType> resultHolder); @Override void searchObjects(QName objectType, QueryType query, SelectorQualifiedGetOptionsType optionsType,
                  Holder<ObjectListType> objectListHolder, Holder<OperationResultType> result); @Override ObjectDeltaOperationListType executeChanges(ObjectDeltaListType deltaList, ModelExecuteOptionsType optionsType); @Override void findShadowOwner(String accountOid, Holder<UserType> userHolder, Holder<OperationResultType> result); @Override OperationResultType testResource(String resourceOid); @Override ExecuteScriptsResponseType executeScripts(ExecuteScriptsType parameters); static PipelineDataType prepareXmlData(List<PipelineItem> output,
			ScriptingExpressionEvaluationOptionsType options); FaultMessage createIllegalArgumentFault(String message); void throwFault(Throwable ex, OperationResult result); @Override TaskType importFromResource(String resourceOid, QName objectClass); @Override TaskType notifyChange(ResourceObjectShadowChangeDescriptionType changeDescription); }
ModelWebService extends AbstractModelWebService implements ModelPortType, ModelPort { @Override public void getObject(QName objectType, String oid, SelectorQualifiedGetOptionsType optionsType, Holder<ObjectType> objectHolder, Holder<OperationResultType> resultHolder) throws FaultMessage { notNullArgument(objectType, "Object type must not be null."); notEmptyArgument(oid, "Oid must not be null or empty."); Task task = createTaskInstance(GET_OBJECT); auditLogin(task); OperationResult operationResult = task.getResult(); try { Class objectClass = ObjectTypes.getObjectTypeFromTypeQName(objectType).getClassDefinition(); Collection<SelectorOptions<GetOperationOptions>> options = MiscSchemaUtil.optionsTypeToOptions(optionsType); PrismObject<? extends ObjectType> object = model.getObject(objectClass, oid, options, task, operationResult); handleOperationResult(operationResult, resultHolder); objectHolder.value = object.asObjectable(); return; } catch (Exception ex) { LoggingUtils.logException(LOGGER, "# MODEL getObject() failed", ex); throwFault(ex, operationResult); } finally { auditLogout(task); } }  @Override void getObject(QName objectType, String oid, SelectorQualifiedGetOptionsType optionsType,
			Holder<ObjectType> objectHolder, Holder<OperationResultType> resultHolder); @Override void searchObjects(QName objectType, QueryType query, SelectorQualifiedGetOptionsType optionsType,
                  Holder<ObjectListType> objectListHolder, Holder<OperationResultType> result); @Override ObjectDeltaOperationListType executeChanges(ObjectDeltaListType deltaList, ModelExecuteOptionsType optionsType); @Override void findShadowOwner(String accountOid, Holder<UserType> userHolder, Holder<OperationResultType> result); @Override OperationResultType testResource(String resourceOid); @Override ExecuteScriptsResponseType executeScripts(ExecuteScriptsType parameters); static PipelineDataType prepareXmlData(List<PipelineItem> output,
			ScriptingExpressionEvaluationOptionsType options); FaultMessage createIllegalArgumentFault(String message); void throwFault(Throwable ex, OperationResult result); @Override TaskType importFromResource(String resourceOid, QName objectClass); @Override TaskType notifyChange(ResourceObjectShadowChangeDescriptionType changeDescription);  }