Skip to content

Getting Started

David Chau edited this page May 30, 2017 · 9 revisions

Short version

  1. Install Yeoman and generator-appdirect-connector using npm (we assume you have pre-installed node.js).
npm install -g yo
npm install -g generator-appdirect-connector
  1. Generate your new project:
yo appdirect-connector:java

Long version

  1. Include a dependency on the latest version of the sdk in your pom.xml
<dependency>
    <groupId>com.appdirect</groupId>
    <artifactId>service-integration-sdk</artifactId>
    <version>1.15</version>
</dependency>
  1. Import ConnectorSdkConfiguration class in your application context; Use the import annotation @Import(ConnectorSdkConfiguration.class). i.e.
@SpringBootApplication
@Import(ConnectorSdkConfiguration.class)
public class MinimalConnector {
    // your code...
}
  1. Include a DeveloperSpecificAppmarketCredentialsSupplier bean in your application context that returns valid appmarket credentials given a consumer key.

  2. Include a AppmarketEventHandler<T> bean in your application context for every type of mandatory market events.

  • Not providing handler for a mandatory event types will lead to an application context failure.
  • The events you need to expose AppmarketEventHandlers for are
  1. Optional events can be handled if need be.
  • Add AppmarketEventHandler<T> beans for every desired events and annotate it with @Primary.
@Primary
@Bean
public AppmarketEventHandler<SubscriptionUpcomingInvoice> mySubscriptionUpcomingNoticeHandler() {
	return event -> ApiResult.success("My handler for a SUBSCRIPTION_UPCOMING_INVOICE event");
}
Clone this wiki locally