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,DeviceExtensionPoint,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 Stringprotected final com.inductiveautomation.ignition.common.gson.Gsonprotected final Stringprotected final Stringprotected final ResourceValidator<S>Fields inherited from interface com.inductiveautomation.ignition.gateway.config.ExtensionPoint
PROFILE_KEY, SETTINGS_KEY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractExtensionPoint(String typeId, String nameKey, String descriptionKey) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddReferenceProperty(String propertyName, Consumer<ReferencePropertyBuilder<S>> build) Add a reference finder to this extension point.protected com.inductiveautomation.ignition.common.gson.Gsonprotected ResourceValidator<S>Builds a validator for the extension point type's settings config object.protected voidcustomizeGson(com.inductiveautomation.ignition.common.gson.GsonBuilder builder) Override this to customize theGsoninstance 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.JsonElementEncode the settings object to aJsonElement.Get the reference properties 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 StringtypeId()The unique type identifier for this extension point.protected voidvalidate(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, waitMethods 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
protected void addReferenceProperty(String propertyName, Consumer<ReferencePropertyBuilder<S>> build) 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, suppose 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) .value(settings -> settings.getDatabaseConnection()) .onUpdate((settings, newName) -> settings.copyWithDatabaseConnection(newName)) ); -
getReferenceProperties
Description copied from interface:ExtensionPointGet the reference properties for this extension point. These are properties within the extension point's settings object that are references to other resources (String, by name). By exposing these reference properties, referential integrity can be maintained when resources are renamed or deleted.- Specified by:
getReferencePropertiesin 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 theGsoninstance 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.- Parameters:
settings- the settings to validate. COULD BE NULL.errors- theValidationErrors.Builder. never null.
-
getSettingsValidator
Description copied from interface:ExtensionPointIf present, will be used to further validate a settings object afterExtensionPoint.decode(JsonElement)succeeds.- Specified by:
getSettingsValidatorin interfaceExtensionPoint<S>
-
typeId
Description copied from interface:ExtensionPointThe unique type identifier for this extension point. Must be unique within the resource type.- Specified by:
typeIdin interfaceExtensionPoint<S>
-
name
Description copied from interface:ExtensionPointThe human-readable name of this extension point.- Specified by:
namein interfaceExtensionPoint<S>
-
description
Description copied from interface:ExtensionPointA description of this extension point.- Specified by:
descriptionin interfaceExtensionPoint<S>
-
decode
public S decode(com.inductiveautomation.ignition.common.gson.JsonElement json) throws DecodingException Description copied from interface:ExtensionPointDecode the settings object from the givenJsonElement.- Specified by:
decodein interfaceExtensionPoint<S>- Parameters:
json- theJsonElementto 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:ExtensionPointEncode the settings object to aJsonElement.- Specified by:
encodein interfaceExtensionPoint<S>
-