public final class CredentialUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
CredentialUtils.VcapCredentials
This class is used to unmarshal the contents of the "credentials" field within
a vcap service entry.
|
static class |
CredentialUtils.VcapService
This class is used to unmarshal an item in the list of services belonging to a particular service key.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PLAN_STANDARD |
Modifier and Type | Method and Description |
---|---|
static java.util.Map<java.lang.String,java.lang.String> |
getServiceProperties(java.lang.String serviceName)
This function will retrieve configuration properties for the specified service from the following
external config sources (in priority order):
1) Credential file
2) Environment variables
3) VCAP_SERVICES
4) System properties
The properties are returned in a Map.
|
static java.util.Map<java.lang.String,java.util.List<CredentialUtils.VcapService>> |
getVcapServicesObj()
Retrieves the VCAP_SERVICES environment variable and unmarshals it.
|
static boolean |
hasBadStartOrEndChar(java.lang.String credentialValue)
Returns true if the supplied value begins or ends with curly brackets or quotation marks.
|
public static final java.lang.String PLAN_STANDARD
public static java.util.Map<java.lang.String,java.lang.String> getServiceProperties(java.lang.String serviceName)
serviceName
- the name of the service. When searching for service-related properties in the
credential file and environment variable config sources, this service name is transformed by
folding it to upper case and replacing "-" with "_". (e.g. "my-service" yields "MY_SERVICE").
When searching for the service within the VCAP_SERVICES setting, no transformation of the service name
is performed.public static boolean hasBadStartOrEndChar(java.lang.String credentialValue)
credentialValue
- the credential value to checkpublic static java.util.Map<java.lang.String,java.util.List<CredentialUtils.VcapService>> getVcapServicesObj()
Copyright © 2022 IBM Cloud Developer Experience. All rights reserved.