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
Nested 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.JsonObject
protected final String
protected final String
protected final PermissionType
protected 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 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)
-
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:
getConfigSchema
in interfaceResourceRouteDelegate<R>
-
getCapabilities
Description copied from interface:ResourceRouteDelegate
A 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:
getCapabilities
in interfaceResourceRouteDelegate<R>
- See Also:
-
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.
-