@@ -174,7 +174,7 @@ public static boolean hasBadStartOrEndChar(String credentialValue) {
174
174
175
175
/**
176
176
* Calls methods to parse VCAP_SERVICES and retrieve credential values. For some values, if VCAP_SERVICES aren't
177
- * present, it'll fall back to checking JDNI .
177
+ * present, it'll fall back to checking JNDI .
178
178
*
179
179
* @param serviceName the service name
180
180
* @return ServiceCredentials object containing parsed values
@@ -184,12 +184,12 @@ public static ServiceCredentials getCredentialsFromVcap(String serviceName) {
184
184
String password = getVcapValue (serviceName , PASSWORD );
185
185
String oldApiKey = getVcapValue (serviceName , OLD_APIKEY );
186
186
if (username == null && password == null && oldApiKey == null ) {
187
- oldApiKey = getJdniValue (serviceName , LOOKUP_NAME_EXTENSION_API_KEY );
187
+ oldApiKey = getJndiValue (serviceName , LOOKUP_NAME_EXTENSION_API_KEY );
188
188
}
189
189
190
190
String url = getVcapValue (serviceName , URL );
191
191
if (url == null ) {
192
- url = getJdniValue (serviceName , LOOKUP_NAME_EXTENSION_URL );
192
+ url = getJndiValue (serviceName , LOOKUP_NAME_EXTENSION_URL );
193
193
}
194
194
195
195
String iamApiKey = getVcapValue (serviceName , IAM_APIKEY );
@@ -199,26 +199,26 @@ public static ServiceCredentials getCredentialsFromVcap(String serviceName) {
199
199
}
200
200
201
201
/**
202
- * Builds the lookup name to be searched for in JDNI
203
- * and uses it to call the overloaded JDNI method.
202
+ * Builds the lookup name to be searched for in JNDI
203
+ * and uses it to call the overloaded JNDI method.
204
204
*
205
205
* @param serviceName Name of the bluemix service
206
- * @param lookupNameExtension Extension to determine which value should be retrieved through JDNI
206
+ * @param lookupNameExtension Extension to determine which value should be retrieved through JNDI
207
207
* @return The encoded desired value
208
208
*/
209
- private static String getJdniValue (String serviceName , String lookupNameExtension ) {
210
- return getJdniValue ("watson-developer-cloud/" + serviceName + lookupNameExtension );
209
+ private static String getJndiValue (String serviceName , String lookupNameExtension ) {
210
+ return getJndiValue ("watson-developer-cloud/" + serviceName + lookupNameExtension );
211
211
}
212
212
213
213
/**
214
214
* Attempt to get the Base64-encoded value through JNDI.
215
215
*
216
216
* This method should always return null on Android due to the javax functions being unsupported
217
217
*
218
- * @param lookupName Key to lookup in JDNI
218
+ * @param lookupName Key to lookup in JNDI
219
219
* @return The encoded desired value
220
220
*/
221
- private static String getJdniValue (String lookupName ) {
221
+ private static String getJndiValue (String lookupName ) {
222
222
if (!isClassAvailable ("javax.naming.Context" ) || !isClassAvailable ("javax.naming.InitialContext" )) {
223
223
log .info ("JNDI string lookups is not available." );
224
224
return null ;
@@ -297,7 +297,7 @@ public static String getVcapValue(String serviceName, String key) {
297
297
298
298
/**
299
299
* Returns the value associated with the provided key from the VCAP_SERVICES, or null if it doesn't exist. In the
300
- * case of the API URL, if VCAP_SERVICES aren't present, this method will also search in JDNI .
300
+ * case of the API URL, if VCAP_SERVICES aren't present, this method will also search in JNDI .
301
301
*
302
302
* @param serviceName the service name
303
303
* @param key the key whose value should be returned
@@ -333,15 +333,15 @@ public static void setServices(String services) {
333
333
}
334
334
335
335
/**
336
- * Sets the context variable for JDNI . This is a utility method for testing.
336
+ * Sets the context variable for JNDI . This is a utility method for testing.
337
337
*
338
338
* @param env Configuration options for the context
339
339
*/
340
340
public static void setContext (Hashtable <String , String > env ) {
341
341
try {
342
342
CredentialUtils .context = new InitialContext (env );
343
343
} catch (Exception e ) {
344
- log .fine ("Error setting up JDNI context: " + e .getMessage ());
344
+ log .fine ("Error setting up JNDI context: " + e .getMessage ());
345
345
}
346
346
}
347
347
0 commit comments