public final class CredentialUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
CredentialUtils.ServiceCredentials
A util class to easily store service credentials.
|
Modifier and Type | Method and Description |
---|---|
static CredentialUtils.ServiceCredentials |
getCredentialsFromVcap(java.lang.String serviceName)
Calls methods to parse VCAP_SERVICES and retrieve credential values.
|
static CredentialUtils.ServiceCredentials |
getFileCredentials(java.lang.String serviceName)
Calls methods to find and parse a credential file in various locations.
|
static boolean |
hasBadStartOrEndChar(java.lang.String credentialValue)
Returns true if the supplied value begins or ends with curly brackets or quotation marks.
|
static void |
setContext(java.util.Hashtable<java.lang.String,java.lang.String> env)
Sets the context variable for JDNI.
|
static void |
setServices(java.lang.String services)
Sets the VCAP_SERVICES variable.
|
public static boolean hasBadStartOrEndChar(java.lang.String credentialValue)
credentialValue
- the credential value to checkpublic static CredentialUtils.ServiceCredentials getCredentialsFromVcap(java.lang.String serviceName)
serviceName
- the service namepublic static void setServices(java.lang.String services)
services
- the VCAP_SERVICESpublic static void setContext(java.util.Hashtable<java.lang.String,java.lang.String> env)
env
- Configuration options for the contextpublic static CredentialUtils.ServiceCredentials getFileCredentials(java.lang.String serviceName)
serviceName
- the service name