Connector for SAP Commerce Cloud Manual / Version 2010
Table Of ContentsThe Commerce Hub API consists of a gRPC API used by the generic client, and a Java API which consists of the Entities API as a wrapper around the gRPC messages, and a Java Feature API, used by the specific adapter services.
The gRPC API
The gRPC API defines the messages and services used for the gRPC communication between generic client and adapter service. It is not necessary to access this API from any custom code. Access should be encapsulated, using the provided Java APIs, described below. In case the existing feature set does not fulfill all needs for a custom commerce integration, the gRPC API may be extended. CoreMedia provides two sample modules, showing a gRPC API extension in the Commerce Adapter Mock. Please have a look at the Section 3.2, “CoreMedia Commerce Adapter Mock” in Custom Commerce Adapter Developer Manual.
The Java API
The Java API consists of two parts. The first part defines Java Entities as a wrapper around gRPC. It is used by the generic client and the server in the base adapter.
The second part is meant for server side only. It defines the Java Interfaces, called Repositories, the adapter services may implement for any needed feature. This API should be used as an entry point for commerce adapter development.
Request flow
The request flow, using the above described APIs, starting from the generic client is as follows. Please have a look at Figure 2.3, “ More detailed architecture view ” first.
The generic client sends a gRPC request to the vendor agnostic base adapter. The Entities API is used to convert the Java entity to the corresponding gRPC message.
The gRPC service implementation in the base adapter receives the gRPC request and invokes the corresponding repository methods.
While the API definition of the repositories is placed in the base adapter, the implementation which is called here is part of a specific commerce adapter.
The commerce adapter uses its vendor specific implementation to obtain the requested data from the commerce system. The data is then mapped to a CoreMedia commerce entity as defined by the base adapter.
Finally, the service implementation in the base adapter converts the given entity back to a gRPC response and sends it back to the generic client.
The generic client receives the gRPC response and uses the Entities API to obtain and process the requested entity.