public void setHandlerUriTransient(String handlerUri) { try { taskPrism.setPropertyRealValue(TaskType.F_HANDLER_URI, handlerUri); } catch (SchemaException e) { // This should not happen throw new IllegalStateException("Internal schema error: " + e.getMessage(), e); } }
private void setTaskIdentifier(String value) { try { taskPrism.setPropertyRealValue(TaskType.F_TASK_IDENTIFIER, value); } catch (SchemaException e) { // This should not happen throw new IllegalStateException("Internal schema error: " + e.getMessage(), e); } }
@Override public void setProgressTransient(long value) { try { taskPrism.setPropertyRealValue(TaskType.F_PROGRESS, value); } catch (SchemaException e) { // This should not happen throw new IllegalStateException("Internal schema error: " + e.getMessage(), e); } }
public void setCategoryTransient(String value) { try { taskPrism.setPropertyRealValue(TaskType.F_CATEGORY, value); } catch (SchemaException e) { // This should not happen throw new IllegalStateException("Internal schema error: " + e.getMessage(), e); } }
public static <IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> I createItem(PrismContainerValue parentValue, QName name, Class<I> type) { Validate.notNull(parentValue, "Parent container value must not be null."); Validate.notNull(name, "QName must not be null."); try { return (I) parentValue.findOrCreateItem(name, type); } catch (SchemaException ex) { throw new SystemException(ex.getMessage(), ex); } }
public void setExecutionStatusTransient(TaskExecutionStatus executionStatus) { try { taskPrism.setPropertyRealValue(TaskType.F_EXECUTION_STATUS, executionStatus.toTaskType()); } catch (SchemaException e) { // This should not happen throw new IllegalStateException("Internal schema error: " + e.getMessage(), e); } }
public <IV extends PrismValue,ID extends ItemDefinition, I extends Item<IV,ID>> I findItem(ItemPath itemPath, Class<I> type) { try { return findCreateItem(itemPath, type, null, false); } catch (SchemaException e) { // This should not happen throw new SystemException("Internal Error: "+e.getMessage(),e); } }
private <V extends PrismValue, D extends ItemDefinition> void addItemValueIfPossible(Item<V, D> item, V value, ParsingContext pc) throws SchemaException { if (value != null) { try { item.add(value); } catch (SchemaException e) { pc.warnOrThrow(LOGGER, "Couldn't add a value of " + value + " to the containing item: " + e.getMessage(), e); } } }
public <IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> I findItem(QName itemQName, Class<I> type) { try { return findCreateItem(itemQName, type, false); } catch (SchemaException e) { // This should not happen throw new SystemException("Internal Error: "+e.getMessage(),e); } }
@Override public <IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> I findItem(ItemPath path, Class<I> type) { try { return findCreateItem(path, type, null, false); } catch (SchemaException e) { // This should not happen throw new SystemException("Internal Error:(path="+path+",type="+type+"): "+e.getMessage(),e); } }
private void logOperationInformation(ModelContext context) { if (LOGGER.isTraceEnabled()) { @SuppressWarnings({"unchecked", "raw"}) LensContext<?> lensContext = (LensContext<?>) context; try { medic.traceContext(LOGGER, "WORKFLOW (" + context.getState() + ")", "workflow processing", true, lensContext, false); } catch (SchemaException e) { throw new IllegalStateException("SchemaException when tracing model context: " + e.getMessage(), e); } } }
protected <T extends ObjectType> void assertObjectDoesntExist(Class<T> clazz, String oid) { OperationResult result = new OperationResult("assertObjectDoesntExist"); try { PrismObject<T> object = repositoryService.getObject(clazz, oid, null, result); fail("Object of type " + clazz.getName() + " with OID " + oid + " exists even if it shouldn't: " + object.debugDump()); } catch (ObjectNotFoundException e) { // ok } catch (SchemaException e) { throw new SystemException("Object of type " + clazz.getName() + " with OID " + oid + " probably exists, and moreover it couldn't be read: " + e.getMessage(), e); } }
private PrismObject<TaskType> createPrism() { try { return getPrismContext().createObject(TaskType.class); } catch (SchemaException e) { throw new SystemException(e.getMessage(), e); } }
protected void copyValues(CloneStrategy strategy, PrismReferenceImpl clone) { super.copyValues(strategy, clone); for (PrismReferenceValue value : getValues()) { try { clone.add(value.cloneComplex(strategy)); } catch (SchemaException e) { throw new IllegalStateException("Unexpected SchemaException while copying values: " + e.getMessage(), e); } } }
@Override public PrismObjectDefinition<ShadowType> getObjectDefinition() { if (shadowDefinition == null) { try { shadowDefinition = ShadowUtil.applyObjectClass(super.getObjectDefinition(), getCompositeObjectClassDefinition()); } catch (SchemaException e) { // This should not happen throw new SystemException(e.getMessage(), e); } } return shadowDefinition; }
@Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { // TODO Auto-generated method stub try { return getPrincipal(username); } catch (ObjectNotFoundException e) { throw new UsernameNotFoundException(e.getMessage(), e); } catch (SchemaException e) { throw new IllegalArgumentException(e.getMessage(), e); } }
@Override public boolean add(T t) { PrismContainerValue value = getValueFrom(t); try { if (container.getParent() == null) { parent.add(container); } return container.add(value); } catch (SchemaException ex) { throw new SystemException(ex.getMessage(), ex); } }
private static ItemDeltaItem<PrismContainerValue<AssignmentType>, PrismContainerDefinition<AssignmentType>> createAssignmentIdi( AssignmentType assignment) { try { ItemDeltaItem<PrismContainerValue<AssignmentType>, PrismContainerDefinition<AssignmentType>> idi = new ItemDeltaItem<>(); idi.setItemOld(LensUtil.createAssignmentSingleValueContainerClone(assignment)); idi.recompute(); return idi; } catch (SchemaException e) { // should not really occur! throw new SystemException("Couldn't create assignment IDI: " + e.getMessage(), e); } }
protected void copyValues(CloneStrategy strategy, PrismContainerImpl<C> clone) { super.copyValues(strategy, clone); clone.compileTimeClass = this.compileTimeClass; for (PrismContainerValue<C> pval : getValues()) { try { clone.add(pval.cloneComplex(strategy)); } catch (SchemaException e) { // This should not happen throw new SystemException("Internal Error: "+e.getMessage(),e); } } }
public PipelineData evaluateConstantStringExpression(RawType constant, ExecutionContext context, OperationResult result) throws ScriptExecutionException { try { String value = constant.getParsedRealValue(String.class); return PipelineData.createItem(prismContext.itemFactory().createPropertyValue(value), context.getInitialVariables()); } catch (SchemaException e) { throw new ScriptExecutionException(e.getMessage(), e); } }