Search in sources :

Example 1 with ServiceUnavailableException

use of com.aws.greengrass.security.exceptions.ServiceUnavailableException in project aws-greengrass-nucleus by aws-greengrass.

the class SecurityService method selectCryptoKeyProvider.

private CryptoKeySpi selectCryptoKeyProvider(URI uri) throws ServiceUnavailableException {
    CaseInsensitiveString keyType = new CaseInsensitiveString(uri.getScheme());
    CryptoKeySpi provider = cryptoKeyProviderMap.get(keyType);
    if (provider == null) {
        throw new ServiceUnavailableException(String.format("Crypto key service for %s is unavailable", keyType));
    }
    return provider;
}
Also used : ServiceUnavailableException(com.aws.greengrass.security.exceptions.ServiceUnavailableException) CaseInsensitiveString(com.aws.greengrass.config.CaseInsensitiveString)

Example 2 with ServiceUnavailableException

use of com.aws.greengrass.security.exceptions.ServiceUnavailableException in project aws-greengrass-nucleus by aws-greengrass.

the class SecurityService method selectMqttConnectionProvider.

private MqttConnectionSpi selectMqttConnectionProvider(URI uri) throws ServiceUnavailableException {
    CaseInsensitiveString keyType = new CaseInsensitiveString(uri.getScheme());
    MqttConnectionSpi provider = mqttConnectionProviderMap.get(keyType);
    if (provider == null) {
        throw new ServiceUnavailableException(String.format("Mqtt connection provider for %s is unavailable", keyType));
    }
    return provider;
}
Also used : ServiceUnavailableException(com.aws.greengrass.security.exceptions.ServiceUnavailableException) CaseInsensitiveString(com.aws.greengrass.config.CaseInsensitiveString)

Aggregations

CaseInsensitiveString (com.aws.greengrass.config.CaseInsensitiveString)2 ServiceUnavailableException (com.aws.greengrass.security.exceptions.ServiceUnavailableException)2