public class ApplicationImpl extends Object implements IApplication
IApplication
implementationModifier 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 IApplication
public IEntity getEntity()
getEntity
in interface IApplication
public String getShortName()
getShortName
in interface IApplication
public String getFullName() throws ConfigurationException
IApplication
Watchout 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 IApplication
ConfigurationException
public ITenant getTenant()
getTenant
in interface IApplication
public String getTenantName()
getTenantName
in interface IApplication
public EClusterType getType() throws ConfigurationException
getType
in interface IApplication
ConfigurationException
protected static EClusterType getType(ISettingsMap map) throws ConfigurationException
ConfigurationException
public boolean isStormApplication() throws ConfigurationException
isStormApplication
in interface IApplication
ConfigurationException
- is the application has a wrong runtime or type settingspublic boolean isSparkStreamingApplication() throws ConfigurationException
isSparkStreamingApplication
in interface IApplication
ConfigurationException
- is the application has a wrong runtime or type settingspublic boolean isShivaApplication() throws ConfigurationException
isShivaApplication
in interface IApplication
ConfigurationException
- is the application has a wrong runtime or type settingspublic boolean isOneShot()
isOneShot
in interface IApplication
public String getCluster() throws ConfigurationException
getCluster
in interface IApplication
ConfigurationException
public String getReloadAction()
getReloadAction
in interface IApplication
public List<String> getShivaTags()
getShivaTags
in interface IApplication
public List<String> getShivaArgs()
getShivaArgs
in interface IApplication
public List<String> getShivaResources()
getShivaResources
in interface IApplication
public String getShivaCronSchedule()
getShivaCronSchedule
in interface IApplication
public String getVersion()
getVersion
in interface IApplication
public String getShivaCommand()
getShivaCommand
in interface IApplication
public List<String> getPredecessors()
getPredecessors
in interface IApplication
public IApplication setExitRequest(IExitRequest request)
IApplication
setExitRequest
in interface IApplication
request
- the requested wish to exitpublic IExitRequest getExitRequest()
getExitRequest
in interface IApplication
public ISettingsMap getEnv()
getEnv
in interface IApplication
public IApplication setEnv(String name, String value)
IApplication
setEnv
in interface IApplication
public IApplication setApplicationUUID(String uuid)
IApplication
setApplicationUUID
in interface IApplication
public String getUUID()
IApplication
getUUID
in interface IApplication
public List<String> getApplyResolverOn()
getApplyResolverOn
in interface IApplication
public void audit() throws ConfigurationException
IApplication
audit
in interface IApplication
ConfigurationException
protected 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
ConfigurationException
public ISettingsMap getExitSettingsOrDefault(ISettingsMap defaultExitCondition) throws ConfigurationException
IApplication
In 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 IApplication
defaultExitCondition
- the ones to return if none is foundConfigurationException
- if a channel express one, or if it is invalidCopyright © 2014–2022. All rights reserved.