public interface XEnvironment extends Initializable, Startable
This class is intended to store the tags attached to this instance where the tags will be changed when the
failover strategy change the tags accordingly. The listeners registered will be notified about these tag changes.
Each interested entity has to implement the XEnvironmentListener
in order to be notified about the tag changes.
Whenever a tag is changed, it is that entity's responsibility to take necessary actions to respond to the tag change.
Modifier and Type | Interface and Description |
---|---|
static class |
XEnvironment.Mode
The mode of the environment usually fits into one of the deployment cycles
|
Modifier and Type | Method and Description |
---|---|
void |
addTags(XTag... newTags)
Adds a
XTag to the tag repository. |
boolean |
containsValue(String tagName,
String expectedValue)
This method should be used by the listeners when taking decisions based the current tags in the repository.
|
Stream<File> |
findProjects() |
List<String> |
getExtensionPackages() |
String |
getFirstValue(String tagName)
Get the first value in the value list under a given key
|
default XEnvironment.Mode |
getMode() |
String |
getNodeName() |
String |
getNodeSpace() |
String |
getProductName() |
File |
getProjectBaseDir()
Gives the base directory for projects as a file
|
String |
getProjectConfDirPath()
Gives the project's configuration directory which contains the integration flow files
|
RuntimeVersion |
getRuntimeVersion() |
File |
getTmpDir() |
List<String> |
getValues(String tagName)
Returns the
XTag values in the tag container. |
void |
registerListener(XEnvironmentListener listener) |
void |
removeListener(XEnvironmentListener listener) |
void |
removeTags(XTag... tagsToRemove)
Remove one or more
XTag s from the tag repository. |
void |
resetTags()
Reset the tag listener to its initial state.
|
destroy, init
File getProjectBaseDir()
String getProjectConfDirPath()
File getTmpDir()
String getProductName()
String getNodeName()
default XEnvironment.Mode getMode()
RuntimeVersion getRuntimeVersion()
String getNodeSpace()
void addTags(XTag... newTags)
XTag
to the tag repository.newTags
- The tag to be addedvoid removeTags(XTag... tagsToRemove)
XTag
s from the tag repository. The tags to be removed should be given as a key value pair.
If the value of the given key is equal, the tag will be removed.tagsToRemove
- The tag to be removedvoid removeListener(XEnvironmentListener listener)
void registerListener(XEnvironmentListener listener)
List<String> getValues(String tagName)
XTag
values in the tag container. It is recommended not to use this method for decision
making purposes. Use containsValue(String, String)
insteadtagName
- the name of the tag to retrieve tag valuesString getFirstValue(String tagName)
tagName
- key of the tagboolean containsValue(String tagName, String expectedValue)
tagName
- Tag nameexpectedValue
- value of the tagvoid resetTags()
Copyright © 2016–2019 AdroitLogic. All rights reserved.