Below are the key steps to create and deploy a service interceptor:
1.Create a new interceptor project
On your development machine (with the ArcGIS Enterprise SDK installed), create a new Java project using the IDE of your choice. Make sure you have installed appropriate Maven archetypes after installing the ArcGIS Enterprise SDK.
2.Configure the @ Interceptor annotation
Update the @ annotation with appropriate values:
- Set a meaningful
displayandName description - Specify the
urlto define which services should be interceptedPatterns - Add optional
propertiesto control runtime behavior
3.Implement interception logic
In the intercept() method:
- Add request interception logic before the line
filter;Chain.intercept(request, response) - Add response interception logic after that line
You may include additional helper classes or utilities to support complex logic.
4.Package the project
Build the project and package the compiled code into a .interceptor file using your IDE or Maven.
5.Deploy the interceptor
Register the .interceptor file with ArcGIS Server using the ArcGIS Server Admin API. Once registered, the interceptor becomes active and starts intercepting requests matching the specified URL patterns.
Refer to Quick Tour of Service Interceptors topic for detailed instructions and walkthrough.