public class ApplicationEnv extends Object
Applications are provided with an environment variable that includes their launcher identifier, name and possibly other injected configuration.
This pojo-like class makes it easy to deal with it.
Constructor and Description |
---|
ApplicationEnv(String entityName,
String entityUUID,
String applicationName,
String applicationUuid,
EExitType exitType,
ISettingsMap exitSettings)
This constructor sets the essential fields but none of the
kafka properties.
|
Modifier and Type | Method and Description |
---|---|
String |
asJsonString() |
static ApplicationEnv |
fromMap(ISettingsMap map)
Call ths from your application.
|
String |
getApplicationControlBootstrapUrl() |
String |
getApplicationControlTopic() |
String |
getApplicationName() |
String |
getApplicationUuid() |
String |
getEntityName() |
String |
getEntityUUID() |
ISettingsMap |
getExitCondition()
Type is always present
|
EExitType |
getExitType() |
JavaStoreSecurity |
getKafkaCredentials() |
void |
setExitConditions(ISettingsMap spoutExitConditions) |
ApplicationEnv |
setKafkaProperties(String kafkaTopic,
String kafkaBootstratUrl,
JavaStoreSecurity kafkaCredentials)
Add the optional and mandatory kafka related properties and return a ready to use
instance.
|
public ApplicationEnv(String entityName, String entityUUID, String applicationName, String applicationUuid, EExitType exitType, ISettingsMap exitSettings)
This constructor is used by the book at startup to create the first application environment. Applications go through the fromMap method.
entityName
- your entity (typically book or channel) nameentityUUID
- the unique id of your entityapplicationName
- the application name, only useful for info and debugexitType
- one o f the supported exit typeapplicationUuid
- the application unique id.public ApplicationEnv setKafkaProperties(String kafkaTopic, String kafkaBootstratUrl, JavaStoreSecurity kafkaCredentials)
kafkaTopic
- kafkaBootstratUrl
- kafkaTrustoreLocation
- kafkaTrustorePassword
- public String asJsonString()
public static ApplicationEnv fromMap(ISettingsMap map) throws ConfigurationException
map
- a settings mapConfigurationException
an
- exception if some of the field is missing.public String getEntityName()
public String getEntityUUID()
public String getApplicationUuid()
public String getApplicationName()
public ISettingsMap getExitCondition()
condition is an optional key
exit:
{
type: default
condition: {
failure:
{
acks_greater_or_equal_to: 0
inactive_for_more_than: 5s
}
success:
{
fails_greater_or_equal_to: 0
}
}
}
public EExitType getExitType()
public String getApplicationControlTopic()
public String getApplicationControlBootstrapUrl()
public JavaStoreSecurity getKafkaCredentials()
public void setExitConditions(ISettingsMap spoutExitConditions)
Copyright © 2014–2022. All rights reserved.