Class DefaultResourceRouteDelegate<R>
java.lang.Object
com.inductiveautomation.ignition.gateway.config.DefaultResourceRouteDelegate<R>
- All Implemented Interfaces:
ResourceRouteDelegate<R>
Standard, builder-supported implementation of
ResourceRouteDelegate. Can be built for standard resource types
or extension point resource types.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classNested classes/interfaces inherited from interface com.inductiveautomation.ignition.gateway.config.ResourceRouteDelegate
ResourceRouteDelegate.ApiCapability -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final JsonResourceCodec<R>protected final com.inductiveautomation.ignition.common.gson.JsonObjectprotected final Stringprotected final Stringprotected final PermissionTypeprotected final Set<ResourceRouteDelegate.ApiCapability>protected final PermissionType -
Constructor Summary
ConstructorsConstructorDescriptionDefaultResourceRouteDelegate(JsonResourceCodec<R> codec, Set<ResourceRouteDelegate.ApiCapability> resourceActionSet, String openApiGroupName, String openApiTagName, com.inductiveautomation.ignition.common.gson.JsonObject configSchema, Map<String, Function<R, Object>> fieldResolvers, Set<String> searchFields, PermissionType readPermission, PermissionType writePermission) -
Method Summary
Modifier and TypeMethodDescriptionfindFieldValue(R resource, String field) Attempts to find the value of a named field for a resource instance.@NotNull Set<ResourceRouteDelegate.ApiCapability>A declarative set of supported actions for the REST API subsystem.getCodec()Get theJsonResourceCodecused by the automatically created resource type routes to encode and decode resources of this type.com.inductiveautomation.ignition.common.gson.JsonObjectstatic <R> DefaultResourceRouteDelegate.Builder<R>newBuilder(JsonResourceCodec<R> codec) static <P extends ExtensionPointProfileConfig>
DefaultResourceRouteDelegate.ExtensionPointBuilder<P>newExtensionPointBuilder(ResourceType resourceType, JsonResourceCodec<ExtensionPointConfig<P, ?>> codec, ExtensionPointCollection<? extends ExtensionPoint<?>> extensionPointCollection)
-
Field Details
-
codec
-
resourceActionSet
-
openApiGroupName
-
openApiTagName
-
configSchema
protected final com.inductiveautomation.ignition.common.gson.JsonObject configSchema -
fieldResolvers
-
searchFields
-
readPermission
-
writePermission
-
-
Constructor Details
-
DefaultResourceRouteDelegate
public DefaultResourceRouteDelegate(JsonResourceCodec<R> codec, Set<ResourceRouteDelegate.ApiCapability> resourceActionSet, @Nullable String openApiGroupName, @Nullable String openApiTagName, @Nullable com.inductiveautomation.ignition.common.gson.JsonObject configSchema, Map<String, Function<R, Object>> fieldResolvers, Set<String> searchFields, PermissionType readPermission, PermissionType writePermission)
-
-
Method Details
-
getConfigSchema
public com.inductiveautomation.ignition.common.gson.JsonObject getConfigSchema()- Specified by:
getConfigSchemain interfaceResourceRouteDelegate<R>
-
getCapabilities
Description copied from interface:ResourceRouteDelegateA declarative set of supported actions for the REST API subsystem. Note that you must both declare a capability and an implementation backing it (ResourceTypeMeta.getResourceActionSet()) for a route to ultimately be exposed.- Specified by:
getCapabilitiesin interfaceResourceRouteDelegate<R>- See Also:
-
getOpenApiGroupName
- Specified by:
getOpenApiGroupNamein interfaceResourceRouteDelegate<R>
-
getOpenApiTagName
- Specified by:
getOpenApiTagNamein interfaceResourceRouteDelegate<R>
-
findFieldValue
Description copied from interface:ResourceRouteDelegateAttempts to find the value of a named field for a resource instance. Used by the route system for filtering and sorting. Default implementation looks for top-level keys in the configuration JSON object.- Specified by:
findFieldValuein interfaceResourceRouteDelegate<R>
-
getSearchFields
- Specified by:
getSearchFieldsin interfaceResourceRouteDelegate<R>- Returns:
- the set of fields that can be searched on for this resource type. See
RouteGroup.ListRouteMounter.searchFields(Set)
-
getCodec
Description copied from interface:ResourceRouteDelegateGet theJsonResourceCodecused by the automatically created resource type routes to encode and decode resources of this type.- Specified by:
getCodecin interfaceResourceRouteDelegate<R>- Returns:
- The
JsonResourceCodecthat can be used to encode and decode resources of this type between their serializedResourceform, and the configuration object form represented by<R>
-
getReadPermission
- Specified by:
getReadPermissionin interfaceResourceRouteDelegate<R>- Returns:
- the permission type required to read this resource type. Default is READ.
-
getWritePermission
- Specified by:
getWritePermissionin interfaceResourceRouteDelegate<R>- Returns:
- the permission type required to write to this resource type. Default is WRITE.
-
newBuilder
- Type Parameters:
R- The config object type of the resource- Returns:
- A new builder for creating a
DefaultResourceRouteDelegatefor a standard resource type
-
newExtensionPointBuilder
public static <P extends ExtensionPointProfileConfig> DefaultResourceRouteDelegate.ExtensionPointBuilder<P> newExtensionPointBuilder(ResourceType resourceType, JsonResourceCodec<ExtensionPointConfig<P, ?>> codec, ExtensionPointCollection<? extends ExtensionPoint<?>> extensionPointCollection) - Type Parameters:
P- TheExtensionPointProfileConfigtype of the extension point category.- Returns:
- A new builder for creating a
DefaultResourceRouteDelegatefor an extension point resource type.
-