Create Custom Assertions
Custom Assertions are modules that are added to a gateway to add functionality to be executed in a service policy. They typically implement proprietary business logic, as opposed to standard-compliant mechanisms supported by CA Technologies.
Custom Assertions are modules that are added to a
Layer7 API Gatewayto add functionality to be executed in a service policy. They typically implement proprietary business logic, as opposed to standard-compliant mechanisms supported by CA Technologies.
This document describes how to create and install Custom Assertions on a
Layer7 API Gateway.
This section is intended for experienced Java developers familiar with the concept of “beans” and how to create Java applications. It also assumes some basic knowledge of the UNIX command line and file permissions and ownership.
The Traffic Logger sample custom assertion requires less Java coding experience. Use it to understand how custom assertions work and how they are implemented in the Gateway.
The Salesforce Connector custom assertion is more detailed and is intended for intermediate to advanced users.
The Custom Assertions API Javadoc provides technical content about the custom assertions application interface, in web format. The Javadoc is packaged within the Custom Assertions SDK and is intended for the experienced Java coder.
Creating your own custom assertion involves implementing the
com.l7tech.policy.assertion.ext.CustomAssertioninterface and extending the
Both of these interfaces and other dependencies are included in the
layer7-api-8.2.0.jarfile, which is located in the Custom Assertion SDK.
- The class implementing theCustomAssertioninterface uses the bean pattern to describe the data, configured by the administrator in the Policy Manager when the policy is being authored. Adding bean-style getter and setter methods enables these properties to be edited in the Policy Manager.
- TheServiceInvocationimplementation is instantiated by theLayer7 API Gatewayand is invoked at policy runtime execution.
Layer7 API Gatewayinstantiates the
ServiceInvocationimplementing class, the
CustomAssertionimplementing object is passed along with the data edited by the administrator.