use of io.gravitee.repository.management.model.Organization in project gravitee-management-rest-api by gravitee-io.
the class OrganizationServiceImpl method findById.
@Override
public OrganizationEntity findById(String organizationId) {
try {
LOGGER.debug("Find organization by ID: {}", organizationId);
Optional<Organization> optOrganization = organizationRepository.findById(organizationId);
if (!optOrganization.isPresent()) {
throw new OrganizationNotFoundException(organizationId);
}
return convert(optOrganization.get());
} catch (TechnicalException ex) {
LOGGER.error("An error occurs while trying to find organization by ID", ex);
throw new TechnicalManagementException("An error occurs while trying to find organization by ID", ex);
}
}
Aggregations