Search in sources :

Example 6 with ClientRegistrationProvider

use of io.gravitee.repository.management.model.ClientRegistrationProvider in project gravitee-management-rest-api by gravitee-io.

the class ClientRegistrationServiceImpl method findById.

@Override
public ClientRegistrationProviderEntity findById(String id) {
    try {
        LOGGER.debug("Find client registration provider by ID: {}", id);
        Optional<ClientRegistrationProvider> clientRegistrationProvider = clientRegistrationProviderRepository.findById(id);
        if (clientRegistrationProvider.isPresent()) {
            return convert(clientRegistrationProvider.get());
        }
        throw new ClientRegistrationProviderNotFoundException(id);
    } catch (TechnicalException ex) {
        LOGGER.error("An error occurs while trying to find a client registration provider using its ID {}", id, ex);
        throw new TechnicalManagementException("An error occurs while trying to delete a client registration provider using its ID " + id, ex);
    }
}
Also used : TechnicalException(io.gravitee.repository.exceptions.TechnicalException) ClientRegistrationProvider(io.gravitee.repository.management.model.ClientRegistrationProvider) TechnicalManagementException(io.gravitee.rest.api.service.exceptions.TechnicalManagementException)

Aggregations

ClientRegistrationProvider (io.gravitee.repository.management.model.ClientRegistrationProvider)6 TechnicalException (io.gravitee.repository.exceptions.TechnicalException)4 TechnicalManagementException (io.gravitee.rest.api.service.exceptions.TechnicalManagementException)4 Date (java.util.Date)3 DiscoveryBasedDynamicClientRegistrationProviderClient (io.gravitee.rest.api.service.impl.configuration.application.registration.client.DiscoveryBasedDynamicClientRegistrationProviderClient)2 DynamicClientRegistrationProviderClient (io.gravitee.rest.api.service.impl.configuration.application.registration.client.DynamicClientRegistrationProviderClient)2 ClientRegistrationProviderEntity (io.gravitee.rest.api.model.configuration.application.registration.ClientRegistrationProviderEntity)1 NewClientRegistrationProviderEntity (io.gravitee.rest.api.model.configuration.application.registration.NewClientRegistrationProviderEntity)1 UpdateClientRegistrationProviderEntity (io.gravitee.rest.api.model.configuration.application.registration.UpdateClientRegistrationProviderEntity)1