public class ApplicationImpl extends Object implements IApplication
IApplication implementation| Modifier and Type | Field and Description |
|---|---|
protected IEntity |
entity |
protected ISettingsMap |
map |
| Constructor and Description |
|---|
ApplicationImpl(IEntity entity,
ISettingsMap map,
String configName)
Create a new application.
|
| Modifier and Type | Method and Description |
|---|---|
void |
audit()
Audit an application.
|
protected void |
auditFile(String path,
boolean isDict)
Audit a settings file.
|
protected void |
auditFileByPrefix(String path,
boolean isDict) |
List<String> |
getApplyResolverOn() |
String |
getCluster() |
IEntity |
getEntity() |
ISettingsMap |
getEnv() |
IExitRequest |
getExitRequest() |
ISettingsMap |
getExitSettingsOrDefault(ISettingsMap defaultExitCondition)
Applications, as defined in a book structure, can specify an optional
exit settings.
|
String |
getFullName()
This returns something like : "stormshield_networksecurity/main/single_topology".
|
List<String> |
getPredecessors() |
String |
getReloadAction() |
ISettingsMap |
getSettingsMap() |
List<String> |
getShivaArgs() |
String |
getShivaCommand() |
String |
getShivaCronSchedule() |
List<String> |
getShivaResources() |
List<String> |
getShivaTags() |
String |
getShortName() |
ITenant |
getTenant() |
String |
getTenantName() |
EClusterType |
getType() |
protected static EClusterType |
getType(ISettingsMap map) |
String |
getUUID()
The unique application identifier is attributed by the owner entity (book or channel).
|
String |
getVersion() |
boolean |
isOneShot() |
boolean |
isShivaApplication() |
boolean |
isSparkStreamingApplication() |
boolean |
isStormApplication() |
IApplication |
setApplicationUUID(String uuid)
Set the unique identifier to this application.
|
IApplication |
setEnv(String name,
String value)
Set an environment variable.
|
IApplication |
setExitRequest(IExitRequest request)
Set an exit wish to this application.
|
String |
toString() |
protected IEntity entity
protected ISettingsMap map
public ApplicationImpl(IEntity entity, ISettingsMap map, String configName)
entity - a channel or bookmap - a mapconfigName - the file structure name i.e. tenant/channel/appname. It does not have the cluster in it.public ISettingsMap getSettingsMap()
getSettingsMap in interface IApplicationpublic IEntity getEntity()
getEntity in interface IApplicationpublic String getShortName()
getShortName in interface IApplicationpublic String getFullName() throws ConfigurationException
IApplicationWatchout this method requires a valid cluster to be configured in your application. A checked exception is thrown if you refer to one not known from your platform properties.
getFullName in interface IApplicationConfigurationExceptionpublic ITenant getTenant()
getTenant in interface IApplicationpublic String getTenantName()
getTenantName in interface IApplicationpublic EClusterType getType() throws ConfigurationException
getType in interface IApplicationConfigurationExceptionprotected static EClusterType getType(ISettingsMap map) throws ConfigurationException
ConfigurationExceptionpublic boolean isStormApplication()
throws ConfigurationException
isStormApplication in interface IApplicationConfigurationException - is the application has a wrong runtime or type settingspublic boolean isSparkStreamingApplication()
throws ConfigurationException
isSparkStreamingApplication in interface IApplicationConfigurationException - is the application has a wrong runtime or type settingspublic boolean isShivaApplication()
throws ConfigurationException
isShivaApplication in interface IApplicationConfigurationException - is the application has a wrong runtime or type settingspublic boolean isOneShot()
isOneShot in interface IApplicationpublic String getCluster() throws ConfigurationException
getCluster in interface IApplicationConfigurationExceptionpublic String getReloadAction()
getReloadAction in interface IApplicationpublic List<String> getShivaTags()
getShivaTags in interface IApplicationpublic List<String> getShivaArgs()
getShivaArgs in interface IApplicationpublic List<String> getShivaResources()
getShivaResources in interface IApplicationpublic String getShivaCronSchedule()
getShivaCronSchedule in interface IApplicationpublic String getVersion()
getVersion in interface IApplicationpublic String getShivaCommand()
getShivaCommand in interface IApplicationpublic List<String> getPredecessors()
getPredecessors in interface IApplicationpublic IApplication setExitRequest(IExitRequest request)
IApplicationsetExitRequest in interface IApplicationrequest - the requested wish to exitpublic IExitRequest getExitRequest()
getExitRequest in interface IApplicationpublic ISettingsMap getEnv()
getEnv in interface IApplicationpublic IApplication setEnv(String name, String value)
IApplicationsetEnv in interface IApplicationpublic IApplication setApplicationUUID(String uuid)
IApplicationsetApplicationUUID in interface IApplicationpublic String getUUID()
IApplicationgetUUID in interface IApplicationpublic List<String> getApplyResolverOn()
getApplyResolverOn in interface IApplicationpublic void audit()
throws ConfigurationException
IApplicationaudit in interface IApplicationConfigurationExceptionprotected void auditFile(String path, boolean isDict) throws ConfigurationException
path - the file pathisDict - true to decode it as a dictionaryConfigurationException - if tehre is some issueprotected void auditFileByPrefix(String path, boolean isDict) throws ConfigurationException
ConfigurationExceptionpublic ISettingsMap getExitSettingsOrDefault(ISettingsMap defaultExitCondition) throws ConfigurationException
IApplicationIn channel structure it is not allowed, the applications are either periodic or ever running, but have never their exit managed by the platform.
exit:
{
type: default
condition: {
failure:
{
acks_greater_or_equal_to: 0
inactive_for_more_than: 5s
}
success:
{
fails_greater_or_equal_to: 0
}
}
getExitSettingsOrDefault in interface IApplicationdefaultExitCondition - the ones to return if none is foundConfigurationException - if a channel express one, or if it is invalidCopyright © 2014–2022. All rights reserved.