Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/webhook it #37

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
3bc461d
add netty client.
Jan 2, 2016
1125345
set netty and jersey dependencies as optional (as one will probably c…
Jan 3, 2016
c7555dc
Merge remote-tracking branch 'upstream/master' into feature/netty_sup…
Jan 3, 2016
6eb99d3
fix merge conflicts
Jan 3, 2016
7d92520
add new entities
Jan 3, 2016
cf7c76e
add new entities
Jan 4, 2016
d6d1441
refactor endpoint genration
Jan 4, 2016
aaa1da4
add tests
Jan 5, 2016
aa4c879
reanme builder
Jan 5, 2016
26b2d7a
Merge branch 'feature/netty_support' into feature/addApiv2_resources
Jan 5, 2016
8715d23
Merge branch 'feature/addApiv2_resources' into feature/user_methods
Jan 5, 2016
443794b
add support for web hook methods
Jan 5, 2016
5b400ee
remove console output
Jan 5, 2016
189c458
Merge branch 'feature/netty_support' into feature/addApiv2_resources
Jan 5, 2016
268a94b
Merge branch 'feature/addApiv2_resources' into feature/user_methods
Jan 5, 2016
d0c264b
Merge branch 'feature/user_methods' into feature/web_hook_methods
Jan 5, 2016
5a84590
add tests
Jan 5, 2016
1c8e3d7
add normal console logger
Jan 5, 2016
6317471
add conditions
Jan 5, 2016
271ef06
improve request structure
Jan 6, 2016
821f1ed
add public key methods
Jan 6, 2016
c1fec7d
add tests
Jan 7, 2016
2829432
add member methods
Jan 7, 2016
434c9eb
add account methods
Jan 7, 2016
388291d
add connection methods
Jan 8, 2016
02d6323
make job changes to support V2
Jan 8, 2016
85f7dcc
add support for miscellaneous list methods
Jan 9, 2016
651438c
add cluster APIv2 support(new fields and methods)
Jan 9, 2016
41701de
add and renew tests
Jan 10, 2016
c83ceb4
add payment and subscription methods
Jan 10, 2016
de10e9f
changed package entity according to APIv2
Jan 10, 2016
c103aeb
add tests
Jan 11, 2016
164f503
add product updates methods
Jan 11, 2016
fc8abdb
add cluster and package object inclusion possibility
Jan 11, 2016
a5fc803
add cluster and package object inclusion possibility to job list
Jan 12, 2016
80a35d9
add package info and list flags to return json data flow
Jan 12, 2016
40137df
some fixes
Jan 12, 2016
3c13f2d
merge modules
Jan 13, 2016
bde9462
add member integration tests
Jan 13, 2016
10a05d6
add public key integration tests
Jan 13, 2016
51e3069
Add account integration tests
Jan 13, 2016
2356cb7
Add package integration tests
Jan 14, 2016
665e3be
Add user integration tests
Jan 17, 2016
1275993
Add webhook integration tests
Jan 22, 2016
7d368fc
Add webhook integration tests
Jan 22, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ target/
.classpath
.project
.settings/
testpackage/*
*/testpackage
XplentyApiTest.java
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ String api_key = "V4eyfgNqYcSasXGhzNxS";
XplentyAPI xplentyAPI = new XplentyAPI(account_id , api_key);
```

If you want to supply custom values for the version, protocol or host that the XplentyAPI object will use,
If you want to supply custom values for the version, protocol, host, timeout, logging or client implementation that the XplentyAPI object will use,
you can use XplentyAPI builder methods to customize these properties.

```java
Expand All @@ -24,10 +24,9 @@ String api_key = "V4eyfgNqYcSasXGhzNxS";
Xplenty.Version version = Xplenty.Version.V1;
String host = 'myHost';
Http.Protocol proto = Http.Protocol.Https;
XplentyAPI xplentyAPI = new XplentyAPI(account_id , api_key)
.withVersion(version)
.withHost(host)
.withProtocol(proto);
HttpClientBuilder builder = new HttpClientBuilder().withAccount(account_id).withApiKey(api_key).
withHost(host).withLogHttpCommunication(true).withClientImpl(Http.HttpClientImpl.SyncNetty);
XplentyAPI xplentyAPI = new XplentyAPI(builder);
```
### List the Cluster Plans

Expand Down
209 changes: 198 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,207 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.xplenty</groupId>
<artifactId>root</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
<artifactId>Xplenty.jar</artifactId>
<version>0.2.1-SNAPSHOT</version>
<packaging>jar</packaging>

<properties>
<name>Xplenty.jar</name>
<url>http://xplenty.com</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<jettyVersion>9.3.6.v20151106</jettyVersion>
<scala.version>2.10.4</scala.version>
<scalatra.version>2.4.0</scalatra.version>
<scalatra.suffix>_2.10</scalatra.suffix>
<jdk.version>1.7</jdk.version>
</properties>

<modules>
<module>xplenty.jar-core</module>
<module>xplenty.jar-integ-test</module>
</modules>
<dependencies>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.9.1</version>
<optional>true</optional>
</dependency>

<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-core</artifactId>
<version>1.9.1</version>
<optional>true</optional>
</dependency>

<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-json</artifactId>
<version>1.9.1</version>
<optional>true</optional>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.1.1</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.1.1</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.1.1</version>
</dependency>

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty</artifactId>
<version>3.10.5.Final</version>
<optional>true</optional>
</dependency>

<!-- Dependencies for tests -->
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.10</artifactId>
<version>1.9.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalatra</groupId>
<artifactId>scalatra${scalatra.suffix}</artifactId>
<version>${scalatra.version}</version>
<exclusions>
<exclusion>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
</exclusion>
</exclusions>
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.6</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.8.4</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<finalName>Xplenty</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.3.1.v20150714</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
<stopPort>8005</stopPort>
<stopKey>STOP</stopKey>
<webAppConfig>
<contextPath>/</contextPath>
<descriptor>${project.basedir}/src/test/scala/com/xplenty/api/webapp/WEB-INF/web.xml</descriptor>
</webAppConfig>
<webAppSourceDirectory>${project.basedir}/src/test/scala/com/xplenty/api/webapp</webAppSourceDirectory>
<classesDirectory>${project.build.testOutputDirectory}</classesDirectory>
</configuration>
<executions>
<execution>
<id>start-jetty</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
<configuration>
<scanIntervalSeconds>0</scanIntervalSeconds>
</configuration>
</execution>
<execution>
<id>stop-jetty</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>add-source</goal>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>scala-test-compile</id>
<phase>process-test-resources</phase>
<configuration>
<testOutputDir></testOutputDir>
</configuration>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.14.1</version>
<configuration>
<useFile>false</useFile>
</configuration>
<executions>
<execution>
<id>verify</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Loading