use of com.evolveum.midpoint.repo.sql.data.common.embedded.ROperationalState in project midpoint by Evolveum.
the class RResource method copyFromJAXB.
public static void copyFromJAXB(ResourceType jaxb, RResource repo, RepositoryContext repositoryContext, IdGeneratorResult generatorResult) throws DtoTranslationException {
RObject.copyFromJAXB(jaxb, repo, repositoryContext, generatorResult);
repo.setName(RPolyString.copyFromJAXB(jaxb.getName()));
repo.setConnectorRef(RUtil.jaxbRefToEmbeddedRepoRef(jaxb.getConnectorRef(), repositoryContext.prismContext));
if (jaxb.getConnector() != null) {
LOGGER.warn("Connector from resource type won't be saved. It should be translated to connector reference.");
}
try {
if (jaxb.getBusiness() != null) {
ResourceBusinessConfigurationType business = jaxb.getBusiness();
repo.getApproverRef().addAll(RUtil.safeListReferenceToSet(business.getApproverRef(), repositoryContext.prismContext, repo, RReferenceOwner.RESOURCE_BUSINESS_CONFIGURATON_APPROVER));
repo.setAdministrativeState(RUtil.getRepoEnumValue(business.getAdministrativeState(), RResourceAdministrativeState.class));
}
if (jaxb.getOperationalState() != null) {
ROperationalState repoOpState = new ROperationalState();
ROperationalState.copyFromJAXB(jaxb.getOperationalState(), repoOpState);
repo.setOperationalState(repoOpState);
}
} catch (Exception ex) {
throw new DtoTranslationException(ex.getMessage(), ex);
}
}
Aggregations