use of com.evolveum.midpoint.repo.sql.util.DtoTranslationException in project midpoint by Evolveum.
the class RAssignmentExtension method fromJaxb.
private static void fromJaxb(PrismContainerValue<?> containerValue, RAssignmentExtension repo, RAssignmentExtensionType type, RepositoryContext repositoryContext) throws DtoTranslationException {
RAnyConverter converter = new RAnyConverter(repositoryContext.prismContext, repositoryContext.extItemDictionary);
Set<RAnyValue> values = new HashSet<>();
try {
for (Item item : containerValue.getItems()) {
values.addAll(converter.convertToRValue(item, true, RObjectExtensionType.EXTENSION));
}
} catch (Exception ex) {
throw new DtoTranslationException(ex.getMessage(), ex);
}
for (RAnyValue value : values) {
((RAExtValue) value).setAnyContainer(repo);
((RAExtValue) value).setExtensionType(type);
if (value instanceof RAExtDate) {
repo.getDates().add((RAExtDate) value);
} else if (value instanceof RAExtLong) {
repo.getLongs().add((RAExtLong) value);
} else if (value instanceof RAExtReference) {
repo.getReferences().add((RAExtReference) value);
} else if (value instanceof RAExtString) {
repo.getStrings().add((RAExtString) value);
} else if (value instanceof RAExtPolyString) {
repo.getPolys().add((RAExtPolyString) value);
} else if (value instanceof RAExtBoolean) {
repo.getBooleans().add((RAExtBoolean) value);
}
}
}
use of com.evolveum.midpoint.repo.sql.util.DtoTranslationException in project midpoint by Evolveum.
the class AssignmentMapper method map.
@Override
public RAssignment map(AssignmentType input, MapperContext context) {
RAssignment ass = new RAssignment();
ItemDelta delta = context.getDelta();
ItemPath path = delta.getPath().namedSegmentsOnly();
if (path.startsWithName(FocusType.F_ASSIGNMENT)) {
ass.setAssignmentOwner(RAssignmentOwner.FOCUS);
} else {
ass.setAssignmentOwner(RAssignmentOwner.ABSTRACT_ROLE);
}
RObject owner = (RObject) context.getOwner();
try {
RAssignment.fromJaxb(input, ass, owner, context.getRepositoryContext());
} catch (DtoTranslationException ex) {
throw new SystemException("Couldn't translate assignment to entity", ex);
}
return ass;
}
use of com.evolveum.midpoint.repo.sql.util.DtoTranslationException 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);
}
}
use of com.evolveum.midpoint.repo.sql.util.DtoTranslationException in project midpoint by Evolveum.
the class FocusActivationMapper method map.
@Override
public RFocusActivation map(ActivationType input, MapperContext context) {
try {
RFocusActivation activation = new RFocusActivation();
RFocusActivation.fromJaxb(input, activation);
return activation;
} catch (DtoTranslationException ex) {
throw new SystemException("Couldn't translate activation to entity", ex);
}
}
use of com.evolveum.midpoint.repo.sql.util.DtoTranslationException in project midpoint by Evolveum.
the class OperationalStateMapper method map.
@Override
public ROperationalState map(OperationalStateType input, MapperContext context) {
try {
ROperationalState rstate = new ROperationalState();
ROperationalState.fromJaxb(input, rstate);
return rstate;
} catch (DtoTranslationException ex) {
throw new SystemException("Couldn't translate operational state to entity", ex);
}
}
Aggregations