SteemJ v0.4.2 is available now ~ Use the Steem API in your Java Project
utopian-io·@dez1337·
0.000 HBDSteemJ v0.4.2 is available now ~ Use the Steem API in your Java Project
*SteemJ v0.4.2 allows you to use the official `https://api.steemit.com` endpoint by adding a HTTP Client.* <center>  </center> <center> Previous 0.4.x releases: [v0.4.2pr1](steemj-v0-4-2pr1-is-available-now-use-the-steem-api-in-your-java-project), [v0.4.1](https://steemit.com/steemdev/@dez1337/steemj-v0-4-1-has-been-released-use-the-steem-api-in-your-java-project), [v0.4.0](https://steemit.com/steemdev/@dez1337/steemj-v0-4-0-has-been-released-integrate-steem-into-your-java-project) </center> # SteemJ v0.4.2 is available now ~ Use the Steem API in your Java Project Hello Steemians! I spend this weekend to add the features which were still missing in [v0.4.2pr1](steemj-v0-4-2pr1-is-available-now-use-the-steem-api-in-your-java-project) to SteemJ and can now proudly announce that v0.4.2 has been released. # What's new? # HTTP Client The main feature is the HTTP Client which is now used by default. If you are interested in the details of this feature and the reasons behind this you should check out the [previous update](steemj-v0-4-2pr1-is-available-now-use-the-steem-api-in-your-java-project). As stated in the [Update your STEEM apps! Big changes coming for 3rd party developers](https://steemit.com/steemitdev/@steemitdev/update-your-steem-apps-big-changes-coming-for-3rd-party-developers) post, using the WebSocket endpoint provided by Steem is deprecated. So if you want to stay with the WebSocket connections make sure that you use a different endpoint than [wss://steemd.steemit.com](wss://steemd.steemit.com). This [wiki article](https://github.com/marvin-we/steem-java-api-wrapper/wiki/SteemJConfig#nodeEndpoints) shows how to add and use WebSocket Endpoints instead of the HTTP Client. <center>  [Source - https://ahrefs.com](https://ahrefs.com/blog/wp-content/uploads/2015/01/Why-your-social-media-account-is-not-getting-the-right-attention.jpg) </center> If you were unable to connect to a WebSocket endpoint as described in Issue [#143](https://github.com/marvin-we/steem-java-api-wrapper/issues/143) this update will finally allow you to use SteemJ. According to @sanjeevm who faced the problem too, the Http Client is working for him. # Improved Permlink Generation Another shout out goes to [philip-healy](https://github.com/philip-healy), who submitted [#144](https://github.com/marvin-we/steem-java-api-wrapper/pull/144) that cleaned up the code for the permlink generation. # Improved Exception Creation The last big change is the error handling which has been refactored: When I've started to develop SteemJ I had the vision to provide a detailed object for an error response returned by Steem Node. Sadly, the `data` field which provides detailed information about the root cause of the error, is really dynamic and totally depends on the call that has been made. Older SteemJ versions tried to push this data field into a pre-defined structure which often caused errors because the structure did not fit for a lot of cases. With SteemJ 0.4.2 this problem is gone, because now all error responses are wrapped by the new `SteemResponseException`. The new Exception could now be thrown by every api call and has the following three fields: * The `code` field is an Integer and can be requested using the `.getCode()` method. * The `message` field is of type String. You can get its value calling the `.getMessage()` method. * The `data` field is now of type JsonNode - This allows you to analyse and parse it on your own. # Full Changelog * [#139](https://github.com/marvin-we/steem-java-api-wrapper/issues/139) Implement a HTTP Client * [#110](https://github.com/marvin-we/steem-java-api-wrapper/issues/101) Refactor the communication process * [#34](https://github.com/marvin-we/steem-java-api-wrapper/issues/34) Improve error handling * [#144](https://github.com/marvin-we/steem-java-api-wrapper/issues/144) Hyphenated permlinks * [#125](https://github.com/marvin-we/steem-java-api-wrapper/issues/125) Replace app version during release process # General information ## What is SteemJ? SteemJ is a project that allows you to communicate with a Steem node using Java. So far, the project supports most of the API calls and is also able to broadcast most of the common operation types. Further information can be found on [GitHub](https://github.com/marvin-we/steem-java-api-wrapper). > https://github.com/marvin-we/steem-java-api-wrapper ## Quick Start Guide ### Add SteemJ to your project SteemJ binaries are pushed into the maven central repository and can be integrated with a bunch of build management tools like Maven. The [Wiki](https://github.com/marvin-we/steem-java-api-wrapper/wiki/How-to-add-SteemJ-to-your-project) provides a lot of examples for the most common build tools. If you do not use a build management tool you can download the binaries as described [here](https://github.com/marvin-we/steem-java-api-wrapper/wiki/How-to-add-SteemJ-to-your-project#download). To add this release to your project paste the following snippet into your 'pom.xml' ```XML <dependency> <groupId>eu.bittrade.libs</groupId> <artifactId>steemj-core</artifactId> <version>0.4.2pr1</version> </dependency> ``` ### Start posting ```Java SteemJConfig myConfig = SteemJConfig.getInstance(); myConfig.setDefaultAccount(new AccountName("YOUR-ACCOUNT")); List<ImmutablePair<PrivateKeyType, String>> privateKeys = new ArrayList<>(); privateKeys.add(new ImmutablePair<>(PrivateKeyType.POSTING, "YOUR-PRIVATE-POSTING-KEY")); myConfig.getPrivateKeyStorage().addAccount(myConfig.getDefaultAccount(), privateKeys); steemJ.createComment(new AccountName("steemj"), new Permlink("testofsteemj040"), "Example comment without no link but with a @user .", new String[] { "test" }); ``` ### Further information The [sample module](https://github.com/marvin-we/steem-java-api-wrapper/tree/master/sample) of the SteemJ project provides showcases for the most common acitivies and operations users want to perform. Beside that you can find a lot of snippets and examples in the different [Wiki sections](https://github.com/marvin-we/steem-java-api-wrapper/wiki). ## Contribute The project became quite big and there is still a lot to do. If you want to support the project simply clone the git repository and submit a pull request. I would really appreciate it =). > git clone https://github.com/marvin-we/steem-java-api-wrapper.git ## Get in touch! Most of my projects are pretty time consuming and I always try to provide some useful stuff to the community. What keeps me going for that is your feedback and your support. For that reason I would love to get some Feedback from you <3. Just contact me here on [Steemit](https://steemit.com/@dez1337) or ping me on [GitHub](https://github.com/marvin-we/steem-java-api-wrapper). <hr> <center>If you want to stay up to date or just like the stuff I am doing it would be great if you could upvote and resteem this post =). Thanks for reading and best regards, @dez1337 </center><br /><hr/><em>Open Source Contribution posted via <a href="https://utopian.io/utopian-io/@dez1337/steemj-v0-4-2-is-available-now-use-the-steem-api-in-your-java-project">Utopian.io</a></em><hr/>
👍 dez1337, steemj, simch, jjb777, helmirenggrik, gutzofter, gerber, steemitboard, lypec, piaristmonk, yocir, myxuy, inertia, masterthematrix, bycz, gikitiki, letc, livingfree, mangos, dehenne, earisu, sergey44, littleboy, hlarin2012, gorpin00, pomorina1el, vitalijmixal, belova, katyusha, lenapotach, malyschkina, sweetnina, karchenaya, otedovin, muksihs, teamsteem, turymenecier, mrs.agsexplorer, bitcoiner, siavach, arjane, berkah, lauralemons, greenstar, natra, pnc, hitmeasap, lamech-m, markhalen, sushnanda, somadeb, samarbbsr, thehumanbot, sanjeevm, ranjangjang, sanmi, sweetbbsr, soubhagya, xpnexindia, shreyansh, utopian-io, promoted, felixxx, newsrx, oroger, towfiqhasan,