/** * Constructs a new RetryableException which signals partial success of * <code>create</code> operation. * * This should be called inside * {@link org.identityconnectors.framework.spi.operations.CreateOp#create(org.identityconnectors.framework.common.objects.ObjectClass, java.util.Set, org.identityconnectors.framework.common.objects.OperationOptions)} * implementation to signal that the create was not completed but the object * was created with <code>Uid</code> and Application should call the * {@link org.identityconnectors.framework.spi.operations.UpdateOp#update(org.identityconnectors.framework.common.objects.ObjectClass, org.identityconnectors.framework.common.objects.Uid, java.util.Set, org.identityconnectors.framework.common.objects.OperationOptions)} * method now. * <p/> * Use this only if the created object can not be deleted. The best-practice * should always be the Connector implementation reverts the changes if the * operation failed. * * @param message * the detail message (which is saved for later retrieval by the * {@link #getMessage()} method). * * @param uid * the new object's Uid. * @return a <code>RetryableException</code> that either <i>is</i> the * specified exception or <i>contains</i> the specified exception. */ public static RetryableException wrap(final String message, final Uid uid) { return new RetryableException(message, new AlreadyExistsException().initUid(Assertions .nullChecked(uid, "Uid"))); } }
/** * Constructs a new RetryableException which signals partial success of * <code>create</code> operation. * * This should be called inside * {@link org.identityconnectors.framework.spi.operations.CreateOp#create(org.identityconnectors.framework.common.objects.ObjectClass, java.util.Set, org.identityconnectors.framework.common.objects.OperationOptions)} * implementation to signal that the create was not completed but the object * was created with <code>Uid</code> and Application should call the * {@link org.identityconnectors.framework.spi.operations.UpdateOp#update(org.identityconnectors.framework.common.objects.ObjectClass, org.identityconnectors.framework.common.objects.Uid, java.util.Set, org.identityconnectors.framework.common.objects.OperationOptions)} * method now. * <p/> * Use this only if the created object can not be deleted. The best-practice * should always be the Connector implementation reverts the changes if the * operation failed. * * @param message * the detail message (which is saved for later retrieval by the * {@link #getMessage()} method). * * @param uid * the new object's Uid. * @return a <code>RetryableException</code> that either <i>is</i> the * specified exception or <i>contains</i> the specified exception. */ public static RetryableException wrap(final String message, final Uid uid) { return new RetryableException(message, new AlreadyExistsException().initUid(Assertions .nullChecked(uid, "Uid"))); } }