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 class
static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final JsonResourceCodec<R>
protected final com.inductiveautomation.ignition.common.gson.JsonObject
protected final String
protected final String
protected final PermissionType
protected final RouteFilter
protected final boolean
protected final PermissionType
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultResourceRouteDelegate
(JsonResourceCodec<R> codec, boolean supportsExtraDataFiles, RouteFilter routeFilter, 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.getCodec()
Get theJsonResourceCodec
used by the automatically created resource type routes to encode and decode resources of this type.com.inductiveautomation.ignition.common.gson.JsonObject
static <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) boolean
Indicates whether this resource expects any "extra" data files beyond "config.json".
-
Field Details
-
codec
-
supportsExtraDataFiles
protected final boolean supportsExtraDataFiles -
routeFilter
-
openApiGroupName
-
openApiTagName
-
configSchema
protected final com.inductiveautomation.ignition.common.gson.JsonObject configSchema -
fieldResolvers
-
searchFields
-
readPermission
-
writePermission
-
-
Constructor Details
-
DefaultResourceRouteDelegate
public DefaultResourceRouteDelegate(JsonResourceCodec<R> codec, boolean supportsExtraDataFiles, RouteFilter routeFilter, @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:
getConfigSchema
in interfaceResourceRouteDelegate<R>
-
getRouteFilter
- Specified by:
getRouteFilter
in interfaceResourceRouteDelegate<R>
- Returns:
- a route filter used to decide which routes to expose for this resource type. Default is to expose all routes.
-
supportsExtraDataFiles
public boolean supportsExtraDataFiles()Description copied from interface:ResourceRouteDelegate
Indicates whether this resource expects any "extra" data files beyond "config.json". Used to simplify the route structure created for this resource.- Specified by:
supportsExtraDataFiles
in interfaceResourceRouteDelegate<R>
- Returns:
- true if this resource type supports extra data files. Default is false.
-
getOpenApiGroupName
- Specified by:
getOpenApiGroupName
in interfaceResourceRouteDelegate<R>
-
getOpenApiTagName
- Specified by:
getOpenApiTagName
in interfaceResourceRouteDelegate<R>
-
findFieldValue
Description copied from interface:ResourceRouteDelegate
Attempts 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:
findFieldValue
in interfaceResourceRouteDelegate<R>
-
getSearchFields
- Specified by:
getSearchFields
in 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:ResourceRouteDelegate
Get theJsonResourceCodec
used by the automatically created resource type routes to encode and decode resources of this type.- Specified by:
getCodec
in interfaceResourceRouteDelegate<R>
- Returns:
- The
JsonResourceCodec
that can be used to encode and decode resources of this type between their serializedResource
form, and the configuration object form represented by<R>
-
getReadPermission
- Specified by:
getReadPermission
in interfaceResourceRouteDelegate<R>
- Returns:
- the permission type required to read this resource type. Default is READ.
-
getWritePermission
- Specified by:
getWritePermission
in 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
DefaultResourceRouteDelegate
for 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
- TheExtensionPointProfileConfig
type of the extension point category.- Returns:
- A new builder for creating a
DefaultResourceRouteDelegate
for an extension point resource type.
-