public class CcAppEnv extends Object
| Modifier and Type | Method and Description |
|---|---|
String |
findCredentialsPropertyByServiceLabel(String label,
String credentialsProperty)
Method to find service credentials property by specified service label
Example json:
{
"user-provided": [
{
"name": "sso",
"label": "user-provided",
"tags": [],
"credentials": {
"apiEndpoint": "http://api.example.eu"
}
}]}
To get api endpoint from such json we could use this method like:
String apiEndpoint = ccAppEnv.findCredentialsPropertyByServiceLabel("user-provided", "apiEndpoint");
|
String |
findCredentialsPropertyByServiceName(String name,
String credentialsProperty)
Method to find service credentials property by specified service name
Example json:
{
"user-provided": [
{
"name": "sso",
"label": "user-provided",
"tags": [],
"credentials": {
"apiEndpoint": "http://api.example.eu"
}
}]}
To get api endpoint from such json we could use this method like:
String apiEndpoint = ccAppEnv.findCredentialsPropertyByServiceName("sso", "apiEndpoint");
|
com.fasterxml.jackson.databind.JsonNode |
getPropertyFromNodeSpecifiedByKeyAndValue(String key,
String value,
String property)
Method to get property from node specified by key and value
Example json:
{
"user-provided": [
{
"name": "sso",
"label": "user-provided",
"tags": [],
"credentials": {
"apiEndpoint": "http://api.example.eu"
}
}]}
To get credentials from such json we could use this method like:
JsonNode credentials = ccAppEnv.getPropertyFromNodeSpecifiedByKeyAndValue("name", "sso", "credentials");
To get api endpoint from such json we could use this method like:
String apiEndpoint = ccAppEnv.getPropertyFromNodeSpecifiedByKeyAndValue("name", "sso", "credentials").findValue("apiEndpoint").toString();
|
com.fasterxml.jackson.databind.JsonNode |
getValueByFilter(String filter)
Method to get value by specified filter
Example json:
{
"user-provided": [
{
"name": "sso",
"label": "user-provided",
"tags": [],
"credentials": {
"apiEndpoint": "http://api.example.eu"
}
}]}
To get api endpoint from such json we could use this method like:
String apiEndpoint = ccAppEnv.getValueByFilter("$..[?(@.name=='sso')]..credentials..apiEndpoint").toString();
|
public CcAppEnv(Object env)
public com.fasterxml.jackson.databind.JsonNode getValueByFilter(String filter) throws IOException
Method to get value by specified filter
Example json:
{
"user-provided": [
{
"name": "sso",
"label": "user-provided",
"tags": [],
"credentials": {
"apiEndpoint": "http://api.example.eu"
}
}]}
To get api endpoint from such json we could use this method like:
String apiEndpoint = ccAppEnv.getValueByFilter("$..[?(@.name=='sso')]..credentials..apiEndpoint").toString();
filter - is an expression like: "$..[?(@.name=='sso')]..credentials..apiEndpoint"IOExceptionpublic com.fasterxml.jackson.databind.JsonNode getPropertyFromNodeSpecifiedByKeyAndValue(String key, String value, String property) throws IOException
Method to get property from node specified by key and value
Example json:
{
"user-provided": [
{
"name": "sso",
"label": "user-provided",
"tags": [],
"credentials": {
"apiEndpoint": "http://api.example.eu"
}
}]}
To get credentials from such json we could use this method like:
JsonNode credentials = ccAppEnv.getPropertyFromNodeSpecifiedByKeyAndValue("name", "sso", "credentials");
To get api endpoint from such json we could use this method like:
String apiEndpoint = ccAppEnv.getPropertyFromNodeSpecifiedByKeyAndValue("name", "sso", "credentials").findValue("apiEndpoint").toString();
property - is a property you like to get backIOExceptionpublic String findCredentialsPropertyByServiceLabel(String label, String credentialsProperty) throws IOException
Method to find service credentials property by specified service label
Example json:
{
"user-provided": [
{
"name": "sso",
"label": "user-provided",
"tags": [],
"credentials": {
"apiEndpoint": "http://api.example.eu"
}
}]}
To get api endpoint from such json we could use this method like:
String apiEndpoint = ccAppEnv.findCredentialsPropertyByServiceLabel("user-provided", "apiEndpoint");
label - is a service labelcredentialsProperty - is a service credentials propertyIOExceptionpublic String findCredentialsPropertyByServiceName(String name, String credentialsProperty) throws IOException
Method to find service credentials property by specified service name
Example json:
{
"user-provided": [
{
"name": "sso",
"label": "user-provided",
"tags": [],
"credentials": {
"apiEndpoint": "http://api.example.eu"
}
}]}
To get api endpoint from such json we could use this method like:
String apiEndpoint = ccAppEnv.findCredentialsPropertyByServiceName("sso", "apiEndpoint");
name - is a service namecredentialsProperty - is a service credentials propertyIOExceptionCopyright © 2016 Pivotal Software, Inc.. All rights reserved.