Search in sources :

Example 1 with AsynchronousOperationReturnValue

use of com.evolveum.midpoint.schema.result.AsynchronousOperationReturnValue in project midpoint by Evolveum.

the class AbstractManualConnectorInstance method addObject.

// TODO: operations to check ticket state
@Override
public AsynchronousOperationReturnValue<Collection<ResourceAttribute<?>>> addObject(PrismObject<? extends ShadowType> object, Collection<Operation> additionalOperations, StateReporter reporter, OperationResult parentResult) throws CommunicationException, GenericFrameworkException, SchemaException, ObjectAlreadyExistsException, ConfigurationException {
    OperationResult result = parentResult.createSubresult(OPERATION_ADD);
    String ticketIdentifier = null;
    try {
        ticketIdentifier = createTicketAdd(object, additionalOperations, result);
    } catch (CommunicationException | GenericFrameworkException | SchemaException | ObjectAlreadyExistsException | ConfigurationException | RuntimeException | Error e) {
        result.recordFatalError(e);
        throw e;
    }
    result.recordInProgress();
    result.setAsynchronousOperationReference(ticketIdentifier);
    AsynchronousOperationReturnValue<Collection<ResourceAttribute<?>>> ret = new AsynchronousOperationReturnValue<>();
    ret.setOperationResult(result);
    return ret;
}
Also used : SchemaException(com.evolveum.midpoint.util.exception.SchemaException) CommunicationException(com.evolveum.midpoint.util.exception.CommunicationException) GenericFrameworkException(com.evolveum.midpoint.provisioning.ucf.api.GenericFrameworkException) AsynchronousOperationReturnValue(com.evolveum.midpoint.schema.result.AsynchronousOperationReturnValue) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) AsynchronousOperationResult(com.evolveum.midpoint.schema.result.AsynchronousOperationResult) ConfigurationException(com.evolveum.midpoint.util.exception.ConfigurationException) Collection(java.util.Collection) ObjectAlreadyExistsException(com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException)

Example 2 with AsynchronousOperationReturnValue

use of com.evolveum.midpoint.schema.result.AsynchronousOperationReturnValue in project midpoint by Evolveum.

the class AbstractManualConnectorInstance method modifyObject.

@Override
public AsynchronousOperationReturnValue<Collection<PropertyModificationOperation>> modifyObject(ObjectClassComplexTypeDefinition objectClass, Collection<? extends ResourceAttribute<?>> identifiers, Collection<Operation> changes, StateReporter reporter, OperationResult parentResult) throws ObjectNotFoundException, CommunicationException, GenericFrameworkException, SchemaException, SecurityViolationException, ObjectAlreadyExistsException, ConfigurationException {
    OperationResult result = parentResult.createSubresult(OPERATION_MODIFY);
    String ticketIdentifier = null;
    try {
        ticketIdentifier = createTicketModify(objectClass, identifiers, changes, result);
    } catch (ObjectNotFoundException | CommunicationException | GenericFrameworkException | SchemaException | ObjectAlreadyExistsException | ConfigurationException | RuntimeException | Error e) {
        result.recordFatalError(e);
        throw e;
    }
    result.recordInProgress();
    result.setAsynchronousOperationReference(ticketIdentifier);
    AsynchronousOperationReturnValue<Collection<PropertyModificationOperation>> ret = new AsynchronousOperationReturnValue<>();
    ret.setOperationResult(result);
    return ret;
}
Also used : SchemaException(com.evolveum.midpoint.util.exception.SchemaException) CommunicationException(com.evolveum.midpoint.util.exception.CommunicationException) GenericFrameworkException(com.evolveum.midpoint.provisioning.ucf.api.GenericFrameworkException) AsynchronousOperationReturnValue(com.evolveum.midpoint.schema.result.AsynchronousOperationReturnValue) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) AsynchronousOperationResult(com.evolveum.midpoint.schema.result.AsynchronousOperationResult) ConfigurationException(com.evolveum.midpoint.util.exception.ConfigurationException) ObjectNotFoundException(com.evolveum.midpoint.util.exception.ObjectNotFoundException) Collection(java.util.Collection) ObjectAlreadyExistsException(com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException)

Aggregations

GenericFrameworkException (com.evolveum.midpoint.provisioning.ucf.api.GenericFrameworkException)2 AsynchronousOperationResult (com.evolveum.midpoint.schema.result.AsynchronousOperationResult)2 AsynchronousOperationReturnValue (com.evolveum.midpoint.schema.result.AsynchronousOperationReturnValue)2 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)2 CommunicationException (com.evolveum.midpoint.util.exception.CommunicationException)2 ConfigurationException (com.evolveum.midpoint.util.exception.ConfigurationException)2 ObjectAlreadyExistsException (com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException)2 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)2 Collection (java.util.Collection)2 ObjectNotFoundException (com.evolveum.midpoint.util.exception.ObjectNotFoundException)1