<commit_before># service-integration-sdk

Represents a collection of utilities meant to facilitate the implementation
of custom connectors. It is assumed that the SDK is consumed by
Spring Boot applications.

## Features
* Automatic parsing of incoming market events
* Automatic oauth authentication of messages using signed fetch
* Automatic Oauth signing of messages to the marketplace

##Getting started
* Include a dependency on the sdk in your pom.xml
```
<dependency>
    <groupId>com.appdirect</groupId>
    <artifactId>service-integration-sdk</artifactId>
    <version>1.5-SNAPSHOT</version>
</dependency>
```

* Ensure your application context imports the `ConnectorSdkConfiguration`
  class; Use the import annotation `@Import(ConnectorSdkConfiguration.class)`. i.e.
```
@SpringBootApplication
@Import(ConnectorSdkConfiguration.class)
public class MinimalConnector {
    // your code...
}
```

* Ensure your application context includes a `DeveloperSpecificAppmarketCredentialsSupplier` bean
  that returns valid appmarket credentials given a consumer key.

* Ensure your application context includes a `AppmarketEventHandler<T>` bean for every type of
  market event your connector handles.
  * Not providing handler for a mandatory event types will lead to an application context failure.
  * Current mandatory events are `SubscriptionOrder`, `SubscriptionCancel` & `SubscriptionChange`

## Exposed endpoints
* `GET /health`
  Returns a 200 (Success) HTTP code. Used to verify that the server is up

* `GET /info`
  Returns information about the deployed application. The information returned varies
  according to the configuration of the client application. Currently we've 
  confirmed that if there is a `git.properties` file in the classpath, generated
  by the [git commit id maven plugin](https://github.com/ktoso/maven-git-commit-id-plugin),
  you'll get output like:
  ```
  {
  	"git": {
  		"commit": {
  			"time": "2016-11-07T18:05:22.000+0000",
  			"id": "2940352"
  		},
  		"branch": "bugfix/HTTPSigInConnector"
  	}
  }
  ```
* `GET /api/v1/integration/processEvent?eventUrl=[insert-event-callback-url-here]`
  That is the endpoint where the appmarket sends event notifications
<commit_msg>List of events you need to support updated<commit_after># service-integration-sdk

Represents a collection of utilities meant to facilitate the implementation
of custom connectors. It is assumed that the SDK is consumed by
Spring Boot applications.

## Features
* Automatic parsing of incoming market events
* Automatic oauth authentication of messages using signed fetch
* Automatic Oauth signing of messages to the marketplace

##Getting started
* Include a dependency on the sdk in your pom.xml
```
<dependency>
    <groupId>com.appdirect</groupId>
    <artifactId>service-integration-sdk</artifactId>
    <version>1.5-SNAPSHOT</version>
</dependency>
```

* Ensure your application context imports the `ConnectorSdkConfiguration`
  class; Use the import annotation `@Import(ConnectorSdkConfiguration.class)`. i.e.
```
@SpringBootApplication
@Import(ConnectorSdkConfiguration.class)
public class MinimalConnector {
    // your code...
}
```

* Ensure your application context includes a `DeveloperSpecificAppmarketCredentialsSupplier` bean
  that returns valid appmarket credentials given a consumer key.

* Ensure your application context includes a `AppmarketEventHandler<T>` bean for every type of market events.
  * Not providing handler for a mandatory event types will lead to an application context failure.
  * The events you need to expose `AppmarketEventHandler`s for are
      * [`SubscriptionOrder`](src/main/java/com/appdirect/sdk/appmarket/events/SubscriptionOrder.java)
      * [`SubscriptionCancel`](src/main/java/com/appdirect/sdk/appmarket/events/SubscriptionCancel.java)
      * [`SubscriptionChange`](src/main/java/com/appdirect/sdk/appmarket/events/SubscriptionChange.java)
      * [`SubscriptionClosed`](src/main/java/com/appdirect/sdk/appmarket/events/SubscriptionClosed.java)
      * [`SubscriptionDeactivated`](src/main/java/com/appdirect/sdk/appmarket/events/SubscriptionDeactivated.java)
      * [`SubscriptionReactivated`](src/main/java/com/appdirect/sdk/appmarket/events/SubscriptionReactivated.java)
      * [`SubscriptionUpcomingInvoice`](src/main/java/com/appdirect/sdk/appmarket/events/SubscriptionUpcomingInvoice.java)

## Exposed endpoints
* `GET /health`
  Returns a 200 (Success) HTTP code. Used to verify that the server is up

* `GET /info`
  Returns information about the deployed application. The information returned varies
  according to the configuration of the client application. Currently we've 
  confirmed that if there is a `git.properties` file in the classpath, generated
  by the [git commit id maven plugin](https://github.com/ktoso/maven-git-commit-id-plugin),
  you'll get output like:
  ```
  {
  	"git": {
  		"commit": {
  			"time": "2016-11-07T18:05:22.000+0000",
  			"id": "2940352"
  		},
  		"branch": "bugfix/HTTPSigInConnector"
  	}
  }
  ```
* `GET /api/v1/integration/processEvent?eventUrl=[insert-event-callback-url-here]`
  That is the endpoint where the appmarket sends event notifications

{'fraction_non_alphanumeric': 0.095274831243973, 'fraction_numerical': 0.013114754098360656, 'mean_word_length': 4.680175246440307, 'pattern_counts': {'":': 10, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '551180', 'n_tokens_mistral': 1516, 'n_tokens_neox': 1434, 'n_words': 465}