Search in sources :

Example 1 with InstallationNotFoundException

use of io.gravitee.rest.api.service.exceptions.InstallationNotFoundException in project gravitee-management-rest-api by gravitee-io.

the class InstallationServiceImpl method setAdditionalInformation.

@Override
public InstallationEntity setAdditionalInformation(Map<String, String> additionalInformation) {
    try {
        final Optional<Installation> optInstallation = this.installationRepository.find();
        if (optInstallation.isPresent()) {
            Installation installation = optInstallation.get();
            installation.setAdditionalInformation(additionalInformation);
            installation.setUpdatedAt(new Date());
            return convert(this.installationRepository.update(installation));
        }
    } catch (final Exception ex) {
        LOGGER.error("Error while updating installation : {}", ex.getMessage());
        throw new TechnicalManagementException("Error while updating installation", ex);
    }
    throw new InstallationNotFoundException("");
}
Also used : Installation(io.gravitee.repository.management.model.Installation) InstallationNotFoundException(io.gravitee.rest.api.service.exceptions.InstallationNotFoundException) Date(java.util.Date) TechnicalManagementException(io.gravitee.rest.api.service.exceptions.TechnicalManagementException) InstallationNotFoundException(io.gravitee.rest.api.service.exceptions.InstallationNotFoundException) TechnicalManagementException(io.gravitee.rest.api.service.exceptions.TechnicalManagementException)

Aggregations

Installation (io.gravitee.repository.management.model.Installation)1 InstallationNotFoundException (io.gravitee.rest.api.service.exceptions.InstallationNotFoundException)1 TechnicalManagementException (io.gravitee.rest.api.service.exceptions.TechnicalManagementException)1 Date (java.util.Date)1