This topic discusses the process of developing service interceptors.
The following are the key steps for creating and deploying a service interceptor:
-
Create a new interceptor project
On your development machine (with the ArcGIS Enterprise SDK installed), create a new Java project using an IDE of your choice. You must ensure you have installed the appropriate Maven archetypes after installing the ArcGIS Enterprise SDK.
-
Configure the
@
annotationInterceptor Update the
@
annotation with appropriate values:Interceptor -
Set a meaningful
display
andName description
-
Specify the
url
to define which services should be interceptedPatterns -
Add optional
properties
to control runtime behavior
-
-
Implement interception logic
In the
intercept()
method:-
Add request interception logic before the line
filter
Chain.intercept(request, response); -
Add response interception logic after the previous line
You may include additional helper classes or utilities to support complex logic.
-
-
Package the project
Build the project and package the compiled code into a .interceptor file using your IDE or Maven.
-
Deploy the interceptor
Register the .interceptor file with ArcGIS Server using the ArcGIS Server Admin API. Once registered, the interceptor becomes active and begins intercepting requests that match the specified URL patterns. For more information, see Quick tour of service interceptors.