Skip to content

Commit e318a0e

Browse files
authored
Merge pull request #1 from igoldbrown/master
initial release
2 parents c83d69a + 32581d9 commit e318a0e

32 files changed

+3733
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/.gradle/
2+
/build/

README.md

Lines changed: 111 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,111 @@
1-
# xecd-rates-client-java
2-
XECD REST Client
1+
<p align="">
2+
<a href="http://www.xe.com" target="_blank">
3+
<img src="https://upload.wikimedia.org/wikipedia/en/5/55/XE_Corporation_logo.png" width="90" height="72"/>
4+
</a>
5+
</p>
6+
7+
# XE Currency Data Client - Java
8+
9+
XE.com Inc. is the World's Trusted Currency Authority. This project provides an SDK to interface with our XE Currency Data (XECD) product.
10+
11+
XE Currency Data is a REST API that gives you access to live and historic mid-market exchange rates between all of our supported currencies.
12+
13+
You will need an api key and secret to use this SDK. Sign up for a [free trial][5] or register for a [full account][6].
14+
15+
## Installation
16+
17+
The preferred way to install this package is by cloning it from github and building it locally. This package uses the [gradle][4] build system.
18+
19+
```bash
20+
cd xecd-rates-client-java
21+
./gradlew publishToMavenLocal
22+
```
23+
24+
To add a dependency on XECD Rates Client using Maven, use the following:
25+
26+
```xml
27+
<dependency>
28+
<groupId>com.xe.xecd</groupId>
29+
<artifactId>xecd-rates-client</artifactId>
30+
<version>0.1</version>
31+
</dependency>
32+
```
33+
34+
To add a dependency using Gradle:
35+
36+
```groovy
37+
dependencies {
38+
compile 'com.xe.xecd:xecd-rates-client:0.1.+'
39+
}
40+
```
41+
42+
This package follows [semantic versioning][3].
43+
44+
## Usage
45+
46+
```java
47+
package com.example;
48+
49+
import com.xe.xecdApiClient.model.HistoricRatesResponse;
50+
import com.xe.xecdApiClient.config.XecdApiConfigBean;
51+
import com.xe.xecdApiClient.service.XecdApiService;
52+
import com.xe.xecdApiClient.service.XecdApiServiceFactory;
53+
54+
public class Main
55+
{
56+
private XecdApiService apiService;
57+
58+
public void main() throws XecdApiException
59+
{
60+
XecdApiConfigBean config = new XecdApiConfigBean();
61+
config.setAccountId("<YOUR_ACCOUNT_ID>");
62+
config.setApiKey("<YOUR_API_KEY>");
63+
apiService = XecdApiServiceFactory.createXecdAPIService(config);
64+
65+
try {
66+
HistoricRatesResponse historicRatesResponse = apiService.historicRate("CAD", "USD,GBP", "2017-09-14", null, 1.00, false, false);
67+
}
68+
catch(XecdApiException e)
69+
{
70+
System.out.println(e.getMessage());
71+
}
72+
}
73+
}
74+
```
75+
76+
## Documentation
77+
78+
[Technical Specifications][2]
79+
80+
## Contributing
81+
82+
xecd-rates-client-java is an open-source project. Submit a pull request to contribute!
83+
84+
## Testing
85+
86+
```bash
87+
cd xecd-rates-client-java
88+
89+
# Unit tests.
90+
./gradlew test
91+
92+
# Integration tests.
93+
export XECD_ACCOUNT_ID=<YOUR_ACCOUNT_ID>
94+
export XECD_API_KEY=<YOUR_API_KEY>
95+
./gradlew test
96+
```
97+
98+
## Security Issues
99+
100+
If you discover a security vulnerability within this package, please **DO NOT** publish it publicly. Instead, contact us at **security [at] xe.com**. We will follow up with you as soon as possible.
101+
102+
## About Us
103+
104+
[XE.com Inc.][1] is The World's Trusted Currency Authority. Development of this project is led by the XE.com Inc. Development Team and supported by the open-source community.
105+
106+
[1]: http://www.xe.com
107+
[2]: http://www.xe.com/xecurrencydata/XE_Currency_Data_API_Specifications.pdf
108+
[3]: http://semver.org/
109+
[4]: https://gradle.org/
110+
[5]: https://xecd.xe.com/account/signup.php?freetrial
111+
[6]: http://www.xe.com/xecurrencydata/

build.gradle

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
apply plugin: 'java-library'
2+
apply plugin: 'maven-publish'
3+
4+
group = 'com.xe.xecd'
5+
version = '0.1.0'
6+
7+
description = "XE Currency Data API Client"
8+
9+
dependencies {
10+
implementation 'org.apache.httpcomponents:httpclient:4.+'
11+
implementation 'org.apache.httpcomponents:httpcore:4.+'
12+
implementation 'com.google.code.gson:gson:2.+'
13+
implementation 'org.slf4j:slf4j-api:[1.3.0, 1.8.0-alpha0)'
14+
implementation 'junit:junit:4.+'
15+
16+
testImplementation 'ch.qos.logback:logback-classic:1.+'
17+
testImplementation 'joda-time:joda-time:2.+'
18+
testImplementation 'org.mockito:mockito-all:1.+'
19+
}
20+
21+
jar {
22+
manifest {
23+
attributes(
24+
'Implementation-Title': project.name,
25+
'Implementation-Version': project.version
26+
)
27+
}
28+
}
29+
30+
publishing {
31+
publications {
32+
mavenJava(MavenPublication) {
33+
from components.java
34+
}
35+
}
36+
}

gradle/wrapper/gradle-wrapper.jar

53.4 KB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
zipStoreBase=GRADLE_USER_HOME
4+
zipStorePath=wrapper/dists
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

gradlew

Lines changed: 172 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)