{"id":24901743,"url":"https://github.com/antonsjava/sb-sampler","last_synced_at":"2025-03-27T18:19:54.334Z","repository":{"id":214721764,"uuid":"737205248","full_name":"antonsjava/sb-sampler","owner":"antonsjava","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-01T16:20:14.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T21:17:26.162Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/antonsjava.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-12-30T07:09:19.000Z","updated_at":"2023-12-30T07:16:32.000Z","dependencies_parsed_at":"2024-02-01T18:20:38.672Z","dependency_job_id":"89933b1c-ee8e-47b1-b864-3688323e383b","html_url":"https://github.com/antonsjava/sb-sampler","commit_stats":null,"previous_names":["antonsjava/sb-sampler"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonsjava%2Fsb-sampler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonsjava%2Fsb-sampler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonsjava%2Fsb-sampler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonsjava%2Fsb-sampler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antonsjava","download_url":"https://codeload.github.com/antonsjava/sb-sampler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245898314,"owners_count":20690466,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-01T21:17:35.201Z","updated_at":"2025-03-27T18:19:54.309Z","avatar_url":"https://github.com/antonsjava.png","language":"Java","readme":"# sb-sampler\n\nDummy springboot application which shows usage of some my libraries. (Mostly logging libraries.)\nMain purpose is to provide documentation samples for that libraries. \n\nApplication provides \n - simple jdbc [database](https://github.com/antonsjava/sb-sampler/blob/main/src/main/resources/db/books.sql)  (H2) configured to ./target/db/books.h2 \n - implements a jdbc [api](https://github.com/antonsjava/sb-sampler/blob/main/src/main/java/sk/antons/sbsampler/repo/BookRepo.java) for manipulating data \n - [configure](https://github.com/antonsjava/sb-sampler/blob/main/src/main/java/sk/antons/sbsampler/repo/BookRepo.java#L51) that api to log sql statements \n - implements a rest [api](https://github.com/antonsjava/sb-sampler/blob/main/src/main/java/sk/antons/sbsampler/rest/book/BookController.java) for providing that jdbc api\n - [configure](https://github.com/antonsjava/sb-sampler/blob/main/src/main/java/sk/antons/sbsampler/rest/RestConf.java#L40) logging for rest api (also for ws api)\n - [configure](https://github.com/antonsjava/sb-sampler/blob/main/src/main/java/sk/antons/sbsampler/rest/JsonExceptionAdvice.java) rest api to log exceptions and convert them to json\n - implements a rest [client](https://github.com/antonsjava/sb-sampler/blob/main/src/main/java/sk/antons/sbsampler/rest/book/BookRestClient.java) using RestTemplate and configure to [log](https://github.com/antonsjava/sb-sampler/blob/main/src/main/java/sk/antons/sbsampler/rest/book/BookClientConf.java#L69) req/res\n - implements a [soap web service](https://github.com/antonsjava/sb-sampler/blob/main/src/main/resources/META-INF/book/BookService.wsdl) which receive requests and storees them as xml files in ./target/fs/input\n - implements a soap web service [client](https://github.com/antonsjava/sb-sampler/blob/main/src/main/java/sk/antons/sbsampler/ws/book/BookServiceClient.java) using spring web service which logs requests and responses\n - implements integration [flow](https://github.com/antonsjava/sb-sampler/blob/main/src/main/java/sk/antons/sbsampler/flow/XmlFlowConfigurator.java#L75) which reads ./target/fs/input dir and process soap requests by calling rest api and moving files to backup od file folder\n\n## sb-sampler\nto test rest \n~~~\ncurl 'http://localhost:8080/rest/book?title=Potter'\ncurl 'http://localhost:8080/rest/book?authorId=a1'\ncurl 'http://localhost:8080/rest/book/jkr1'\ncurl -X POST -H \"Content-Type: application/json\" -d '{\"title\": \"The Big Show\", \"abstractInfo\": \"THE BIG SHOW is as close as you''ll ever get to fighting for your life from the cockpit of a Spitfire or Typhoon. Perhaps the most viscerally exciting book ever written by a fighter pilot.\", \"author\": {\"name\":\"Pierre Clostermann\"}}' 'http://localhost:8080/rest/book'\n\ncurl 'http://localhost:8080/rest/author?name=o'\ncurl 'http://localhost:8080/rest/author/a1'\ncurl -X POST -H \"Content-Type: application/json\" -d '{\"name\":\"Self Made Writer\"}' 'http://localhost:8080/rest/author'\n~~~\n\nto test ws just start implemented ws [client](https://github.com/antonsjava/sb-sampler/blob/main/src/main/java/sk/antons/sbsampler/ws/book/BookServiceClient.java#L226) or start \n~~~\ncurl -X POST -H \"Content-Type: text/xml\" -d '\u003cSOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"\u003e\u003cSOAP-ENV:Header/\u003e\u003cSOAP-ENV:Body\u003e\u003cns3:updateBookRequest xmlns:ns3=\"http://sample.antons.sk/book/1.0\"\u003e\u003cbook\u003e\u003ctitle\u003enew book\u003c/title\u003e\u003cabstract\u003esomething long\u003c/abstract\u003e\u003cauthor\u003et1\u003c/author\u003e\u003c/book\u003e\u003c/ns3:updateBookRequest\u003e\u003c/SOAP-ENV:Body\u003e\u003c/SOAP-ENV:Envelope\u003e' 'http://localhost:8080/ws/book'\n~~~\n\nThis is example of [log](https://github.com/antonsjava/sb-sampler/blob/main/src/main/other-resources/application.log) which is produced by calling implemented soap web service client \n - ws is called - file is stored to input dir\n - file is processed by flow - rest service is called using rest client\n - rest service is called and book is stored to db\n\n## rest doc\n\nif you want to see usage of io.github.antonsjava:sb-rest-doclet you can start \n~~~\nmvn javadoc::javadoc\n~~~\nand look to ./target/site/apidocs/index-rest.html (most of code is not documented) \n\n\n## mimic servlet\n\nif you want to mock some static data you can look to RestConf how to configure servlet to provide some dummy data.  \n\n~~~\ncurl -X POST -d '\n\u003cenv:Envelope xmlns:env=\"http://www.w3.org/2003/05/soap-envelope\"\u003e\n  \u003cenv:Body\u003e\n    \u003cPerson\u003e\n      \u003cName\u003ePeter\u003c/Name\u003e\n    \u003c/Person\u003e\n  \u003c/env:Body\u003e\n\u003c/env:Envelope\u003e\n' http://localhost:8080/mock/testsoap\n~~~\n\n~~~\ncurl -X POST -d '\n\u003cenv:Envelope xmlns:env=\"http://www.w3.org/2003/05/soap-envelope\"\u003e\n  \u003cenv:Body\u003e\n    \u003cPerson\u003e\n      \u003cName\u003ePetex\u003c/Name\u003e\n    \u003c/Person\u003e\n  \u003c/env:Body\u003e\n\u003c/env:Envelope\u003e\n' http://localhost:8080/mock/testsoap\n~~~\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonsjava%2Fsb-sampler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantonsjava%2Fsb-sampler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonsjava%2Fsb-sampler/lists"}