Class SystemPropertiesManager
java.lang.Object
com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycle
com.inductiveautomation.ignition.gateway.model.SystemPropertiesManager
- All Implemented Interfaces:
Lifecycle
Manages access to the SystemPropertiesResource. A lot of different systems need access to the data in the record,
and it is better to consolidate access to the record in a single place. When first loaded, this class will read
the underlying SystemPropertiesResource and load all the values into a map. Other systems will then retrieve values
using properties specified in the GatewaySystemProperties class. Other systems can also write a value through
this manager, which will propagate the changed value into the underlying SystemPropertiesResource.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Whenever a SystemPropertiesListener fires, this provides a read-only version of the system properties map that can be safely passed to listeners. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a listener that will fire whenever the edge-specific gateway system properties change.void
Adds a listener that will fire whenever the gateway system properties change.<T> T
getEdgePropertyValue
(Property<T> property) Retrieves an EdgeSystemPropertiesResource value.<T> T
getPropertyValue
(Property<T> property) Retrieves a SystemPropertiesResource value.protected void
protected void
void
void
<T> void
setEdgePropertyValue
(Property<T> property, T newPropValue) Sets a value that will be propagated to the EdgeSystemPropertiesResource.<T> void
setLocalPropertyValue
(Property<T> property, T newPropValue) Sets a value that will be propagated to the *local* SystemPropertiesResource.void
setNewEdgeTagProvider
(String edgeTagProviderName) Only use when a new gateway has just been commissioned and started for the first time.<T> void
setPropertyValue
(Property<T> property, T newPropValue) Sets a value that will be propagated to the SystemPropertiesResource.void
setPropertyValues
(List<PropertyValue> propValues) Sets a collection of PropertyValues that will be propagated to the SystemPropertiesResource.void
setup()
Methods inherited from class com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycle
isRunning, shutdown, startup
-
Constructor Details
-
SystemPropertiesManager
-
-
Method Details
-
setup
public void setup() -
addSystemPropsListener
Adds a listener that will fire whenever the gateway system properties change. This is the modern equivalent to adding a listener to the SystemPropertiesResource.META object. -
removeSystemPropsListener
-
addEdgeSystemPropsListener
Adds a listener that will fire whenever the edge-specific gateway system properties change. This is the modern equivalent to adding a listener to the EdgeSystemPropertiesResource.META object. -
removeEdgeSystemPropsListener
-
getPropertyValue
Retrieves a SystemPropertiesResource value. This method is safer than accessing the SystemPropertiesResource directly. Look in the GatewaySystemProperties class to locate the property whose value you need to retrieve. WARNING: this function will return null if the value is null in the SystemPropertiesResource. -
getErrorReportPassword
- Returns:
- the error report password as a cleartext String, if it is set.
-
getEdgePropertyValue
Retrieves an EdgeSystemPropertiesResource value. This method is safer than accessing the EdgeSystemPropertiesResource directly. Look in the EdgeSystemProperties class to locate the property whose value you need to retrieve. WARNING: this function will return null if the value is null in the EdgeSystemPropertiesResource. -
getPropertyValues
- Returns:
- All gateway system properties in a read-only map. Look in the GatewaySystemProperties class to retrieve properties that you need to get out of the map.
-
setPropertyValue
Sets a value that will be propagated to the SystemPropertiesResource. Look in the GatewaySystemProperties class to locate the property whose value you need to set. If the notifyRecordUpdated parameter is set to true, all registered SystemPropertiesListener objects will be notified. -
setEdgePropertyValue
Sets a value that will be propagated to the EdgeSystemPropertiesResource. Look in the EdgeSystemProperties class to locate the property whose value you need to set. If the notifyRecordUpdated parameter is set to true, all SystemPropertiesListener objects registered as Edge system properties listeners will be notified. -
setNewEdgeTagProvider
Only use when a new gateway has just been commissioned and started for the first time. We have to set the name of the Edge Tag Provider in EdgeSystemProperties. This is needed so other systems can look up the reference later for things like the name of the tag provider. -
setPropertyValues
Sets a collection of PropertyValues that will be propagated to the SystemPropertiesResource. Look in the GatewaySystemProperties class to locate the properties whose values you need to set. -
setLocalPropertyValue
Sets a value that will be propagated to the *local* SystemPropertiesResource. This means that the value will NOT be propagated to the other redundant node in a redundancy setup. In general, do NOT use this method except in specific circumstances where you know the SystemPropertiesResource change needs to be kept local (one example is the demo timer reset). Instead, use setPropertyValue(). If the notifyRecordUpdated parameter is set to true, all registered SystemPropertiesListener objects will be notified. -
getSystemName
- Returns:
- the gateway name
-
onStartup
protected void onStartup()- Specified by:
onStartup
in classAbstractLifecycle
-
onShutdown
protected void onShutdown()- Specified by:
onShutdown
in classAbstractLifecycle
-