Updating a template when the Payment Manager API changes
| This section assumes that the reader is using the generic Core Connector REST template. |
Inside client-adapter-interface/src/main/resources/, there is a file called api.yaml. This is the definition of the Payment Manager API. Every time the Payment Manager API definition changes, the change must be made in this .yaml file too.
Adding a new endpoint
If the change is about adding a new endpoint:
-
Add the new endpoint to
client-adapter-interface/src/main/resources/api.yamljust like you would add a new endpoint to any other Swagger.yamlfile. -
Add the class that implements the interface for the new endpoint. Add the class (
<Endpoint>ApiImpl.java) here:client-adapter/src/main/java/com/modusbox/client/jaxrs. -
Add a new route definition (
from()) in the relevant router here:client-adapter/src/main/java/com/modus/client/router/. -
Add a
<camelcxf:serviceBeans />for the new implementation class inclient-adapter/src/main/resources/spring/cxf.xml. -
Add a
<bean />and<camel:routeBuilder />for the new router. -
Add new DataSonnet mappings (
client-adapter/src/main/resources/mappings/). -
After the changes have been made, change directory to the root folder of the Core Connector project (
pm4ml-core-connector-rest-template) and runmvn clean install.
You should see the interface for the new endpoint (<Endpoint>Api.java) automatically added here:client-adapter-interface/target/generated-sources/src/gen/java/com/modusbox/client/api/.
Updating an existing endpoint
If the change is about updating an existing endpoint:
-
Make the change in
client-adapter-interface/src/main/resources/api.yamljust like you would add an update to any other Swagger.yamlfile. -
After the changes have been made, change directory to the
client-adapter-interfaceand runmvn clean install.
The change will be automatically reflected in the affected endpoint’s interface (<Endpoint>Api.javainclient-adapter-interface/target/generated-sources/src/gen/java/com/modusbox/client/api).
However, the change must be made manually in the affected implementation class (<Endpoint>ApiImpl.javain theclient-adapter/src/main/java/com/modusbox/client/jaxrs/folder).