private KMSClientProvider[] createProviders(Configuration conf, URL origUrl, int port, String hostsPart) throws IOException { String[] hosts = hostsPart.split(";"); KMSClientProvider[] providers = new KMSClientProvider[hosts.length]; for (int i = 0; i < hosts.length; i++) { try { providers[i] = new KMSClientProvider( new URI("kms", origUrl.getProtocol(), hosts[i], port, origUrl.getPath(), null, null), conf); } catch (URISyntaxException e) { throw new IOException("Could not instantiate KMSProvider.", e); } } return providers; } }
private KeyProvider createProvider(URI providerUri, Configuration conf, URL origUrl, int port, String hostsPart) throws IOException { String[] hosts = hostsPart.split(";"); if (hosts.length == 1) { return new KMSClientProvider(providerUri, conf); } else { KMSClientProvider[] providers = new KMSClientProvider[hosts.length]; for (int i = 0; i < hosts.length; i++) { try { providers[i] = new KMSClientProvider( new URI("kms", origUrl.getProtocol(), hosts[i], port, origUrl.getPath(), null, null), conf); } catch (URISyntaxException e) { throw new IOException("Could not instantiate KMSProvider..", e); } } return new LoadBalancingKMSClientProvider(providers, conf); } } }
private KeyProvider createProvider(URI providerUri, Configuration conf, URL origUrl, int port, String hostsPart) throws IOException { String[] hosts = hostsPart.split(";"); if (hosts.length == 1) { return new KMSClientProvider(providerUri, conf); } else { KMSClientProvider[] providers = new KMSClientProvider[hosts.length]; for (int i = 0; i < hosts.length; i++) { try { providers[i] = new KMSClientProvider( new URI("kms", origUrl.getProtocol(), hosts[i], port, origUrl.getPath(), null, null), conf); } catch (URISyntaxException e) { throw new IOException("Could not instantiate KMSProvider..", e); } } return new LoadBalancingKMSClientProvider(providers, conf); } } }
private KeyProvider createProvider(URI providerUri, Configuration conf, URL origUrl, int port, String hostsPart) throws IOException { String[] hosts = hostsPart.split(";"); if (hosts.length == 1) { return new KMSClientProvider(providerUri, conf); } else { KMSClientProvider[] providers = new KMSClientProvider[hosts.length]; for (int i = 0; i < hosts.length; i++) { try { providers[i] = new KMSClientProvider( new URI("kms", origUrl.getProtocol(), hosts[i], port, origUrl.getPath(), null, null), conf); } catch (URISyntaxException e) { throw new IOException("Could not instantiate KMSProvider..", e); } } return new LoadBalancingKMSClientProvider(providers, conf); } } }
private KeyProvider createProvider(URI providerUri, Configuration conf, URL origUrl, int port, String hostsPart) throws IOException { String[] hosts = hostsPart.split(";"); if (hosts.length == 1) { return new KMSClientProvider(providerUri, conf); } else { KMSClientProvider[] providers = new KMSClientProvider[hosts.length]; for (int i = 0; i < hosts.length; i++) { try { providers[i] = new KMSClientProvider( new URI("kms", origUrl.getProtocol(), hosts[i], port, origUrl.getPath(), null, null), conf); } catch (URISyntaxException e) { throw new IOException("Could not instantiate KMSProvider..", e); } } return new LoadBalancingKMSClientProvider(providers, conf); } } }
private KMSClientProvider createKMSClientProvider(URI uri, Configuration conf) throws IOException { final KMSClientProvider ret = new KMSClientProvider(uri, conf); providersCreated.add(ret); return ret; }
protected KeyProvider createProvider(URI uri, Configuration conf) throws IOException { return new LoadBalancingKMSClientProvider( new KMSClientProvider[] { new KMSClientProvider(uri, conf) }, conf); }
protected KeyProvider createProvider(URI uri, Configuration conf) throws IOException { final KeyProvider ret = new LoadBalancingKMSClientProvider(uri, new KMSClientProvider[] {new KMSClientProvider(uri, conf)}, conf); providersCreated.add(ret); return ret; }
/** * create a LoadBalancingKMSClientProvider from an array of URIs. * @param uris an array of KMS URIs * @param conf configuration object * @return a LoadBalancingKMSClientProvider object * @throws IOException */ protected LoadBalancingKMSClientProvider createHAProvider(URI lbUri, URI[] uris, Configuration conf) throws IOException { KMSClientProvider[] providers = new KMSClientProvider[uris.length]; for (int i = 0; i < providers.length; i++) { providers[i] = new KMSClientProvider(uris[i], conf); } final LoadBalancingKMSClientProvider ret = new LoadBalancingKMSClientProvider(lbUri, providers, conf); providersCreated.add(ret); return ret; }