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

1.1.0 #18

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
57 changes: 29 additions & 28 deletions .classpath
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ Feed SDK CHANGE LOG
====================
Change log for Feed SDK which helps to download and filter the item feed files.

* 1.0.0.beta-RELEASE
* 1.0.0.beta-RELEASE (#1.0.0.beta-RELEASE)
* [1.0.1.beta-RELEASE](#1.0.1.beta-RELEASE)
* [1.0.2.beta-RELEASE](#1.0.2.beta-RELEASE)
* [1.1.0-RELEASE](#1.1.0-RELEASE)

# 1.1.0-RELEASE (2021/09/03)
Enhancement Requests:
* Updated sdk with item snapshot feature support


# 1.0.2.beta-RELEASE (2018/10/26)
[Full Changelog](https://github.com/eBay/FeedSDK/compare/1.0.1.beta-RELEASE...1.0.2.beta-RELEASE)
Expand Down
78 changes: 51 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Feed SDK
==========
Java SDK for downloading and filtering item feed files
Java SDK for downloading and filtering item and snapshot feed files

Table of contents
==========
Expand Down Expand Up @@ -34,9 +34,9 @@ Table of contents

# Summary

The item feed files provide a rich set of data regarding active ebay listings. The feed files for any supported marketplace can be downloaded through the feed API.
The item and snapshot feed files provide a rich set of data regarding active ebay listings. The feed files for any supported marketplace can be downloaded through the feed API.

However, since the volume of data is large, the download operation is performed in chunks, which may be cumbersome.
However, since the volume of data is large, the download operation is performed in chunks, which may be cumbersome.

The feed SDK abstracts all the complexities and provides a very simple interface to -
* [Download](#downloading-feed-files)
Expand All @@ -52,11 +52,11 @@ You are most welcome to collaborate and enhance the existing code base.
## Add as maven dependency

```
<!-- https://mvnrepository.com/artifact/com.ebay.api/feed-sdk -->
<!-- -->
<dependency>
<groupId>com.ebay.api</groupId>
<artifactId>feed-sdk</artifactId>
<version>1.0.1.beta-RELEASE</version>
<version>1.1.0-RELEASE</version>
</dependency>
```

Expand All @@ -70,7 +70,7 @@ This should generate an uber jar with the following naming convention
__feed-sdk-{version}-uber.jar__

## Downloading feed files
Since the feed API supports feed files which may be as big as 5 GB, there is a capability which was built into the system to download the file in chunks of 100 MB.
Since the feed API supports feed files which may be as big as 5 GB, there is a capability which was built into the system to download the file in chunks of 100 MB and have resume capability in a case if token get expired.

The SDK abstracts the complexity involved in calculating the request header '__range__' based on the response header '__content-range__'.

Expand All @@ -85,12 +85,23 @@ builder.feedScope("ALL_ACTIVE")
.categoryId("1")
.siteId("EBAY_US")
.token(<TOKEN>)
.type(FeedTypeEnum.ITEM);
.type("ITEM");

Feed feed = new FeedImpl();

GetFeedResponse response = feed.get(builder.build(), null);

GetFeedResponse response = feed.get(builder.build(), null, null);

```

### Credential File Location

The default download location is the current working directory.
The credential config file location can be changed by specifying the optional 'credentialConfigFilePath' parameter in the feed method.
For example, credentials.yaml location __sample-credentials/credentials.yaml__ -

```

feed.get(builder.build(), null, "sample-credentials/credentials.yaml");
```
The __GetFeedResponse.filePath__ denotes the location where the file was downloaded.

Expand All @@ -101,6 +112,7 @@ The download location can be changed by specifying the optional 'downloadDirecto
For example, to download to the location __/tmp/feed__ -

```

feed.get(builder.build(), "/tmp/feed");
```
---
Expand Down Expand Up @@ -240,10 +252,11 @@ All the capabilities of the SDK can be invoked using the command line.

To see the available options and filters , use '-help'
```
java -jar feed-sdk-1.0.0.beta-RELEASE-uber.jar -help
java -jar feed-sdk-1.1.0-RELEASE-uber.jar -help
usage: Feed SDK CLI
-help display help
-dt <arg> the date when feed file was generated
-sdt <arg> the snapshot_date when feed file was generated
-c1 <arg> the l1 category id of the feed file
-scope <arg> the feed scope. Available scopes are
ALL_ACTIVE or NEWLY_LISTED
Expand Down Expand Up @@ -279,19 +292,26 @@ usage: Feed SDK CLI
located
-authscopes,--oauthscopes <arg> list of scopes
-env <arg> Environment Type. Supported Environments are SANDBOX and PRODUCTION
-type <arg> Supported feed types are ITEM and ITEM_SNAPSHOT


```

For example, to use the command line options to download, unzip and filter feed files

Using token
Using token For Item
```
java -jar feed-sdk-1.1.0-SNAPSHOT-uber.jar -dt 20180701 -type ITEM -c1 1281 -scope ALL_ACTIVE -lf 46310 177789 -mkt EBAY_US -c3f 177792 116381 -pricelf 2 -priceuf 100 -locf US CN -token xxx
```

Using token For ITEM_SNAPSHOT
```
java -jar feed-sdk-1.0.0.beta-RELEASE-uber.jar -dt 20180701 -c1 1281 -scope ALL_ACTIVE -lf 46310 177789 -mkt EBAY_US -c3f 177792 116381 -pricelf 2 -priceuf 100 -locf US CN -token xxx
java -jar feed-sdk-1.1.0-RELEASE-uber.jar -sdt 2021-06-10T02:00:00.000Z -type ITEM_SNAPSHOT -env SANDBOX -c1 625 -mkt EBAY_US -pricelf 2 -priceuf 100 -locf US CN -token xxx
```

Using credentials file
```
java -jar feed-sdk-1.0.0.beta-RELEASE-uber.jar -dt 20180801 -c1 11700 -scope ALL_ACTIVE -mkt EBAY_US -pricelf 2 -priceuf 100 -locf US CN -cl <absolute path of credentials file>
java -jar feed-sdk-1.1.0-RELEASE-uber.jar -dt 20180801 -c1 11700 -scope ALL_ACTIVE -mkt EBAY_US -pricelf 2 -priceuf 100 -locf US CN -cl <absolute path of credentials file>
```

### Using config file driven approach
Expand Down Expand Up @@ -324,30 +344,33 @@ The structure of the config file
```
An example of using the SDK through a config file is located at

[Config file based approach example - ConfigFileBasedExample.java](https://github.com/eBay/FeedSDK/tree/master/src/main/java/com/ebay/feed/example/ConfigFileBasedExample.java)
[Config file based approach example - ConfigFileBasedExample.java](https://github.com/eBay/FeedSDK/blob/1.1.0/src/main/java/com/ebay/feed/example/ConfigFileBasedExample.java)

[Example config file - 1](https://github.com/eBay/FeedSDK/blob/master/sample-config/config-file-download-unzip-filter)
[Example config file - 1](https://github.com/eBay/FeedSDK/tree/1.1.0/sample-config/config-file-download-unzip-filter)

[Example config file - 2](https://github.com/eBay/FeedSDK/blob/master/sample-config/config-file-filter)
[Example config file - 2](https://github.com/eBay/FeedSDK/tree/1.1.0/sample-config/config-file-filter)

### Using java method calls

Samples showing the usage of available operations and filters.

#### Examples

All the examples are located [__here__](https://github.com/eBay/FeedSDK/tree/master/src/main/java/com/ebay/feed/example)
All the examples are located [__here__](https://github.com/eBay/FeedSDK/blob/1.1.0/src/main/java/com/ebay/feed/example)

* [Filter by item location](https://github.com/eBay/FeedSDK/tree/master/src/main/java/com/ebay/feed/example/FilterByItemLocation.java)
* [Filter by leaf categories](https://github.com/eBay/FeedSDK/tree/master/src/main/java/com/ebay/feed/example/FilterByLeafCategories.java)
* [Filter by price](https://github.com/eBay/FeedSDK/tree/master/src/main/java/com/ebay/feed/example/FilterByPrice.java)
* [Filter by seller user names](https://github.com/eBay/FeedSDK/tree/master/src/main/java/com/ebay/feed/example/FilterBySellerUserNames.java)
* [Combining multiple filters](https://github.com/eBay/FeedSDK/tree/master/src/main/java/com/ebay/feed/example/CombiningFilters.java)
* [Filter on level three category](https://github.com/eBay/FeedSDK/tree/master/src/main/java/com/ebay/feed/example/FilterByLevelThreeCategory.java)
* [Filter on EPID](https://github.com/eBay/FeedSDK/tree/master/src/main/java/com/ebay/feed/example/FilterByEpids.java)
* [Filter on GTIN](https://github.com/eBay/FeedSDK/tree/master/src/main/java/com/ebay/feed/example/FilterByGtins.java)
* [Filter on item IDs](https://github.com/eBay/FeedSDK/tree/master/src/main/java/com/ebay/feed/example/FilterByItemIds.java)
* [Filter by 'env'](https://github.com/eBay/FeedSDK/tree/master/src/main/java/com/ebay/feed/example/FilterByEnv.java)
* [Filter by item location](https://github.com/eBay/FeedSDK/blob/1.1.0/src/main/java/com/ebay/feed/example/FilterByItemLocation.java)
* [Filter by leaf categories](https://github.com/eBay/FeedSDK/blob/1.1.0/src/main/java/com/ebay/feed/example/FilterByLeafCategories.java)
* [Filter by price](https://github.com/eBay/FeedSDK/blob/1.1.0/src/main/java/com/ebay/feed/example/FilterByPrice.java)
* [Filter by seller user names](https://github.com/eBay/FeedSDK/blob/1.1.0/src/main/java/com/ebay/feed/example/FilterBySellerUserNames.java)
* [Combining multiple filters](https://github.com/eBay/FeedSDK/blob/1.1.0/src/main/java/com/ebay/feed/example/CombiningFilters.java)
* [Filter on level three category](https://github.com/eBay/FeedSDK/blob/1.1.0/src/main/java/com/ebay/feed/example/FilterByLevelThreeCategory.java)
* [Filter on EPID](https://github.com/eBay/FeedSDK/blob/1.1.0/src/main/java/com/ebay/feed/example/FilterByEpids.java)
* [Filter on GTIN](https://github.com/eBay/FeedSDK/blob/1.1.0/src/main/java/com/ebay/feed/example/FilterByGtins.java)
* [Filter on item IDs](https://github.com/eBay/FeedSDK/blob/1.1.0/src/main/java/com/ebay/feed/example/FilterByItemIds.java)
* [Filter by env](https://github.com/eBay/FeedSDK/blob/1.1.0/src/main/java/com/ebay/feed/example/FilterByEnv.java)
* [Feed type item_snapshot](https://github.com/eBay/FeedSDK/blob/1.1.0/src/main/java/com/ebay/feed/example/FeedTypeItemSnapShot.java)
* [Multithreading usage MutliThreading](https://github.com/eBay/FeedSDK/blob/1.1.0/src/main/java/com/ebay/feed/example/UsingMutliThread.java)
* [Credential file usage 'Credential'](https://github.com/eBay/FeedSDK/blob/1.1.0/src/main/java/com/ebay/feed/example/UsingCredentialFileForSandBoxEnv.java)


---
Expand All @@ -368,6 +391,7 @@ All the examples are located [__here__](https://github.com/eBay/FeedSDK/tree/mas
* Ensure there is enough storage for unzipped files
* Ensure that the log and file storage directories have appropriate write permissions
* In case of failure in downloading due to network issues, the process needs to start again. There is no capability at the moment, to resume.
* The credentials need to be set in the credentials.yml to avail resume capability.

## License

Expand Down
7 changes: 7 additions & 0 deletions credentials.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name:

api.ebay.com:
appid:
certid:
devid:
redirecturi:
46 changes: 46 additions & 0 deletions nbactions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<actions>
<action>
<actionName>run</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:3.0.0:exec</goal>
</goals>
<properties>
<exec.args>-classpath %classpath com.ebay.feed.example.UsingCredentialFileForSandBoxEnv</exec.args>
<exec.executable>java</exec.executable>
</properties>
</action>
<action>
<actionName>debug</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:3.0.0:exec</goal>
</goals>
<properties>
<exec.args>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath com.ebay.feed.example.UsingCredentialFileForSandBoxEnv</exec.args>
<exec.executable>java</exec.executable>
<jpda.listen>true</jpda.listen>
</properties>
</action>
<action>
<actionName>profile</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:3.0.0:exec</goal>
</goals>
<properties>
<exec.args>-classpath %classpath com.ebay.feed.example.UsingCredentialFileForSandBoxEnv</exec.args>
<exec.executable>java</exec.executable>
</properties>
</action>
</actions>
Loading