Class AbstractExtensionPoint<S>
java.lang.Object
com.inductiveautomation.ignition.gateway.config.AbstractExtensionPoint<S>
- All Implemented Interfaces:
ExtensionPoint<S>
,Comparable<ExtensionPoint<S>>
- Direct Known Subclasses:
AbstractEmailProfileExtensionPoint
,AlarmNotificationProfileExtensionPoint
,AuditProfileType
,OpcConnectionExtensionPoint
,ScheduleExtensionPoint
,ServiceConnectorExtensionPoint
,TagProviderExtensionPoint
,UserSourceExtensionPoint
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.inductiveautomation.ignition.gateway.config.ExtensionPoint
ExtensionPoint.ComponentType
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final String
protected final com.inductiveautomation.ignition.common.gson.Gson
protected final String
protected final String
protected final ResourceValidator<S>
Fields inherited from interface com.inductiveautomation.ignition.gateway.config.ExtensionPoint
PROFILE_KEY, SETTINGS_KEY
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractExtensionPoint
(String typeId, String nameKey, String descriptionKey) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addReferenceProperty
(String propertyName, Consumer<ReferenceFinderBuilder<S>> build) Add a reference finder to this extension point.protected com.inductiveautomation.ignition.common.gson.Gson
protected ResourceValidator<S>
Builds a validator for the extension point type's settings config object.protected void
customizeGson
(com.inductiveautomation.ignition.common.gson.GsonBuilder builder) Override this to customize theGson
instance used to encode/decode settings.decode
(com.inductiveautomation.ignition.common.gson.JsonElement json) Decode the settings object from the givenJsonElement
.description
(Locale locale) A description of this extension point.com.inductiveautomation.ignition.common.gson.JsonElement
Encode the settings object to aJsonElement
.Get the reference finders for this extension point.If present, will be used to further validate a settings object afterExtensionPoint.decode(JsonElement)
succeeds.The human-readable name of this extension point.final String
typeId()
The unique type identifier for this extension point.protected void
validate
(S settings, ValidationErrors.Builder errors) Provides an opportunity to validate the extension point type's settings config object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.inductiveautomation.ignition.gateway.config.ExtensionPoint
canCreate, compareTo, defaultSettings, getMenuActions, getSettings, getWebUiComponent, resourceType, settingsSchema, settingsType
-
Field Details
-
typeId
-
nameKey
-
descriptionKey
-
gson
protected final com.inductiveautomation.ignition.common.gson.Gson gson -
validator
-
-
Constructor Details
-
AbstractExtensionPoint
-
-
Method Details
-
addReferenceProperty
Add a reference finder to this extension point. A reference finder is able to identify a reference stored in this extension point's settings object that references another named configuration resource. For example, supposed your extension point's settings object references a database connection. You could add a reference finder like this:addReferenceProperty("databaseConnection", ref -> ref .targetType(DatasourceManager.DATABASE_CONNECTION_RESOURCE) .match((settings, name) -> name.equals(settings.getDatabaseConnection())) .onUpdate((settings, newName) -> settings.copyWithDatabaseConnection(newName)) );
-
getReferenceFinders
Description copied from interface:ExtensionPoint
Get the reference finders for this extension point. Reference finders are used to find properties within this extension point type's settings object that reference other resources. By finding these references, referential integrity can be maintained when resources are renamed or deleted.- Specified by:
getReferenceFinders
in interfaceExtensionPoint<S>
-
buildGson
protected com.inductiveautomation.ignition.common.gson.Gson buildGson() -
customizeGson
protected void customizeGson(com.inductiveautomation.ignition.common.gson.GsonBuilder builder) Override this to customize theGson
instance used to encode/decode settings. -
buildValidator
Builds a validator for the extension point type's settings config object. Default implementation delegates tovalidate(Object, ValidationErrors.Builder)
, the intended target for implementations to override. -
validate
Provides an opportunity to validate the extension point type's settings config object. If any errors are added to theValidationErrors.Builder
, the settings object will be considered invalid and will be rejected. -
getSettingsValidator
Description copied from interface:ExtensionPoint
If present, will be used to further validate a settings object afterExtensionPoint.decode(JsonElement)
succeeds.- Specified by:
getSettingsValidator
in interfaceExtensionPoint<S>
-
typeId
Description copied from interface:ExtensionPoint
The unique type identifier for this extension point. Must be unique within the resource type.- Specified by:
typeId
in interfaceExtensionPoint<S>
-
name
Description copied from interface:ExtensionPoint
The human-readable name of this extension point.- Specified by:
name
in interfaceExtensionPoint<S>
-
description
Description copied from interface:ExtensionPoint
A description of this extension point.- Specified by:
description
in interfaceExtensionPoint<S>
-
decode
public S decode(com.inductiveautomation.ignition.common.gson.JsonElement json) throws DecodingException Description copied from interface:ExtensionPoint
Decode the settings object from the givenJsonElement
.- Specified by:
decode
in interfaceExtensionPoint<S>
- Parameters:
json
- theJsonElement
to decode.- Returns:
- the decoded settings object.
- Throws:
DecodingException
- if the settings object could not be decoded or this extension point does not have a settings type.
-
encode
Description copied from interface:ExtensionPoint
Encode the settings object to aJsonElement
.- Specified by:
encode
in interfaceExtensionPoint<S>
-