Search in sources :

Example 1 with RTaskAutoScaling

use of com.evolveum.midpoint.repo.sql.data.common.embedded.RTaskAutoScaling in project midpoint by Evolveum.

the class RTask method copyFromJAXB.

// dynamically called
public static void copyFromJAXB(TaskType jaxb, RTask repo, RepositoryContext repositoryContext, IdGeneratorResult generatorResult) throws DtoTranslationException {
    copyAssignmentHolderInformationFromJAXB(jaxb, repo, repositoryContext, generatorResult);
    repo.setNameCopy(RPolyString.copyFromJAXB(jaxb.getName()));
    repo.setTaskIdentifier(jaxb.getTaskIdentifier());
    repo.setExecutionStatus(RUtil.getRepoEnumValue(jaxb.getExecutionState(), RTaskExecutionState.class));
    repo.setHandlerUri(jaxb.getHandlerUri());
    repo.setLastRunFinishTimestamp(jaxb.getLastRunFinishTimestamp());
    repo.setCompletionTimestamp(jaxb.getCompletionTimestamp());
    repo.setLastRunStartTimestamp(jaxb.getLastRunStartTimestamp());
    repo.setNode(jaxb.getNode());
    repo.setBinding(RUtil.getRepoEnumValue(jaxb.getBinding(), RTaskBinding.class));
    repo.setRecurrence(RUtil.getRepoEnumValue(TaskTypeUtil.getEffectiveRecurrence(jaxb), RTaskRecurrence.class));
    repo.setThreadStopAction(RUtil.getRepoEnumValue(jaxb.getThreadStopAction(), RThreadStopAction.class));
    repo.setCategory(jaxb.getCategory());
    repo.setParent(jaxb.getParent());
    repo.setObjectRef(RUtil.jaxbRefToEmbeddedRepoRef(jaxb.getObjectRef(), repositoryContext.relationRegistry));
    repo.setOwnerRefTask(RUtil.jaxbRefToEmbeddedRepoRef(jaxb.getOwnerRef(), repositoryContext.relationRegistry));
    repo.setWaitingReason(RUtil.getRepoEnumValue(jaxb.getWaitingReason(), RTaskWaitingReason.class));
    repo.setSchedulingState(RUtil.getRepoEnumValue(jaxb.getSchedulingState(), RTaskSchedulingState.class));
    repo.setDependent(RUtil.listToSet(jaxb.getDependent()));
    TaskAutoScalingType autoScaling = jaxb.getAutoScaling();
    if (autoScaling != null) {
        RTaskAutoScaling rAutoScaling = new RTaskAutoScaling();
        RTaskAutoScaling.fromJaxb(autoScaling, rAutoScaling);
        repo.setAutoScaling(rAutoScaling);
    }
    RUtil.copyResultFromJAXB(TaskType.F_RESULT, jaxb.getResult(), repo, repositoryContext.prismContext);
}
Also used : TaskAutoScalingType(com.evolveum.midpoint.xml.ns._public.common.common_3.TaskAutoScalingType) RTaskAutoScaling(com.evolveum.midpoint.repo.sql.data.common.embedded.RTaskAutoScaling)

Example 2 with RTaskAutoScaling

use of com.evolveum.midpoint.repo.sql.data.common.embedded.RTaskAutoScaling in project midpoint by Evolveum.

the class TaskAutoScalingMapper method map.

@Override
public RTaskAutoScaling map(TaskAutoScalingType input, MapperContext context) {
    try {
        RTaskAutoScaling taskAutoScaling = new RTaskAutoScaling();
        RTaskAutoScaling.fromJaxb(input, taskAutoScaling);
        return taskAutoScaling;
    } catch (DtoTranslationException ex) {
        throw new SystemException("Couldn't translate TaskAutoScaling to entity", ex);
    }
}
Also used : DtoTranslationException(com.evolveum.midpoint.repo.sql.util.DtoTranslationException) RTaskAutoScaling(com.evolveum.midpoint.repo.sql.data.common.embedded.RTaskAutoScaling) SystemException(com.evolveum.midpoint.util.exception.SystemException)

Aggregations

RTaskAutoScaling (com.evolveum.midpoint.repo.sql.data.common.embedded.RTaskAutoScaling)2 DtoTranslationException (com.evolveum.midpoint.repo.sql.util.DtoTranslationException)1 SystemException (com.evolveum.midpoint.util.exception.SystemException)1 TaskAutoScalingType (com.evolveum.midpoint.xml.ns._public.common.common_3.TaskAutoScalingType)1