use of org.ligoj.app.iam.ContainerOrg in project ligoj-api by ligoj.
the class DelegateOrgResource method toEntity.
/**
* Build the entity from the import entry.
*
* @param importEntry
* The new delegate.
* @return The JPA entity form with validated inputs.
*/
private DelegateOrg toEntity(final DelegateOrgEditionVo importEntry) {
// Validate the related receiver of this delegate
final ResourceOrg receiver = toReceiver.get(importEntry.getReceiverType()).apply(importEntry.getReceiver());
final DelegateOrg entity = new DelegateOrg();
entity.setId(importEntry.getId());
entity.setName(Normalizer.normalize(importEntry.getName()));
entity.setCanAdmin(importEntry.isCanAdmin());
entity.setCanWrite(importEntry.isCanWrite());
entity.setType(importEntry.getType());
entity.setReceiver(receiver.getId());
entity.setReceiverType(importEntry.getReceiverType());
if (receiver instanceof ContainerOrg) {
// Store receiver DN only for immutable containers
entity.setReceiverDn(receiver.getDn());
}
return entity;
}
Aggregations