@SuppressWarnings("WeakerAccess") public static <T> T unwrapTunnelledException(TunnelException te) throws CommonException { Throwable cause = te.getCause(); if (cause instanceof CommonException) { throw (CommonException) cause; } else if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } else { throw te; } }
if (te.getCause() instanceof SchemaException) { throw (SchemaException)te.getCause(); } else if (te.getCause() instanceof ConfigurationException) { throw (ConfigurationException)te.getCause(); } else if (te.getCause() instanceof ExpressionEvaluationException) { throw (ExpressionEvaluationException)te.getCause(); } else if (te.getCause() instanceof ObjectNotFoundException) { throw (ObjectNotFoundException)te.getCause(); } else if (te.getCause() instanceof CommunicationException) { throw (CommunicationException)te.getCause(); } else if (te.getCause() instanceof SecurityViolationException) { throw (SecurityViolationException)te.getCause(); } else { throw new SystemException("Unexpected exception: "+te, te);
/** * Encrypts all encryptable values in delta. */ public static <T extends ObjectType> void encryptValues(Protector protector, ObjectDelta<T> delta) throws EncryptionException { try { delta.accept(createEncryptingVisitor(protector)); } catch (TunnelException e) { throw (EncryptionException) e.getCause(); } }
/** * Encrypts all encryptable values in the object. */ public static <T extends ObjectType> void encryptValues(Protector protector, PrismObject<T> object) throws EncryptionException { try { object.accept(createEncryptingVisitor(protector)); } catch (TunnelException e) { throw (EncryptionException) e.getCause(); } }
public void revive(Object bean, final PrismContext prismContext) throws SchemaException { Handler<Object> visitor = o -> { if (o instanceof Revivable) { try { ((Revivable)o).revive(prismContext); } catch (SchemaException e) { throw new TunnelException(e); } } return true; }; try { visit(bean, visitor); } catch (TunnelException te) { SchemaException e = (SchemaException) te.getCause(); throw e; } }
/** * Re-encrypts all encryptable values in the object. */ public static <T extends ObjectType> int reencryptValues(Protector protector, PrismObject<T> object) throws EncryptionException { try { Holder<Integer> modCountHolder = new Holder<>(0); object.accept(createVisitor((ps, propName) -> reencryptProtectedStringType(ps, propName, modCountHolder, protector))); return modCountHolder.getValue(); } catch (TunnelException e) { throw (EncryptionException) e.getCause(); } }
protected <F extends FocusType> ContainerDelta<AssignmentType> createAssignmentModification(Class<F> type, QName elementName, String roleOid, QName refType, QName relation, PrismContainer<?> extension, ActivationType activationType, boolean add) throws SchemaException { try { return createAssignmentModification(type, elementName, roleOid, refType, relation, assignment -> { if (extension != null) { try { assignment.asPrismContainerValue().add(extension.clone()); } catch (SchemaException e) { throw new TunnelException(e); } } assignment.setActivation(activationType); }, add); } catch (TunnelException te) { throw (SchemaException)te.getCause(); } }
ItemPath.create(ShadowType.F_ASSOCIATION, null), false); } catch (TunnelException e) { Throwable cause = e.getCause(); if (cause instanceof SchemaException) { throw (SchemaException) cause;
Throwable originalException = te.getCause(); if (originalException instanceof SchemaException) { throw (SchemaException) originalException;
ItemPath.create(ShadowType.F_ASSOCIATION, null), false); } catch (TunnelException e) { Throwable cause = e.getCause(); if (cause instanceof SchemaException) { throw (SchemaException) cause;
filter.accept(visitor); } catch (TunnelException te) { throw (SchemaException) te.getCause();
MiscUtil.carthesian((Collection)valueCollections, (Processor)processor); } catch (TunnelException e) { Throwable originalException = e.getCause(); if (originalException instanceof ExpressionEvaluationException) { throw (ExpressionEvaluationException)originalException;
throw (PolicyViolationException)e.getCause();
Throwable e = te.getCause(); if (e instanceof SchemaException) { throw (SchemaException)e;
throw (SchemaException)e.getCause();
Throwable cause = te.getCause(); if (cause instanceof SchemaException) { throw (SchemaException) cause;
Throwable e = te.getCause(); if (e instanceof RuntimeException) { throw (RuntimeException)e;
+ ex.getMessage(), ex); } catch (TunnelException e) { Throwable cause = e.getCause(); if (cause instanceof SchemaException) { throw (SchemaException)cause;
connector.search(entitlementOcDef, query, handler, attributesToReturn, null, searchHierarchyConstraints, subjectCtx, parentResult); } catch (TunnelException e) { throw (SchemaException)e.getCause(); } catch (GenericFrameworkException e) { throw new GenericConnectorException(e.getMessage(), e);