Monthly Archives: November 2016

Best practices for restful services versioning and documentation

http://stackoverflow.com/questions/389169/best-practices-for-api-versioning?rq=1 http://stackoverflow.com/questions/28853483/rest-api-versioning-with-swagger-2-0 http://stackoverflow.com/questions/35783349/setting-the-api-version-with-swagger-ui https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-Jersey-2.X-Project-Setup-1.5 https://github.com/swagger-api/swagger-core/wiki/Annotations-1.5.X#swaggerdefinition Swagger Specification  Swagger Specification http://tech.asimio.net/2016/05/07/Documenting-multiple-REST-API-versions-using-Spring-Boot-Jersey-and-Swagger.html   Handling versioning with dispatchers http://maxenglander.com/2013/05/28/separate-resource-versions-with-context-resolvers-in-jersey.html

Date and SimpleDateFormat

http://stackoverflow.com/questions/1459656/how-to-get-the-current-time-in-yyyy-mm-dd-hhmisec-millisecond-format-in-java date.toString() would do if wanted to have a SimpleDateFormat(yyyy-MM-dd HH mm ss SSS)   Parsing back to Date from String.. http://stackoverflow.com/questions/9431927/how-to-convert-date-tostring-back-to-date Date d = new Date(); long l = d.getTime(); Date theSameDate = new Date(l); Date d = new Date(); String s = d.toString; Date theSameDate = new SimpleDateFormat(“EEE MMM dd HH:mm:ss zzz yyyy”).parse(s);… Read More »

My Todo Reads

Is open source security software too much of a risk for enterprises? http://searchsecurity.techtarget.com/answer/Is-open-source-security-software-too-much-of-a-risk-for-enterprises?utm_content=control&utm_medium=EM&asrc=EM_ERU_68477221&utm_campaign=20161123_ERU%20Transmission%20for%2011/23/2016%20(UserUniverse:%202234794)&utm_source=ERU&src=5581443   Creating successful RESTful API design http://searchsoa.techtarget.com/tip/Creating-successful-RESTful-API-design?utm_content=control&utm_medium=EM&asrc=EM_ERU_68545778&utm_campaign=20161124_ERU%20Transmission%20for%2011/24/2016%20(UserUniverse:%202235959)&utm_source=ERU&src=5582024

CMD Commands and usage

Netstat command to know the process and ports in use.. http://www.computerweekly.com/tip/How-to-use-a-netstat-command-in-Windows-to-watch-open-ports netstat –an 1 | find “3333” The command will check every second and print the results if a process starts listening on TCP port 3333. The local address entries beginning 127.0.0.1 are processes listening for connections from the PC itself, not from the Internet… Read More »

Understanding Servlet Filters

http://otndnld.oracle.co.jp/document/products/as10g/101300/B25221_03/web.1013/b14426/filters.htm http://otndnld.oracle.co.jp/document/products/as10g/101300/B25221_03/web.1013/b14426/filters.htm#BCFIAAAH

Java problem solving Question and Answers

http://www.sanfoundry.com/java-programming-examples-graph-problems-algorithms/ https://www.quora.com/How-can-I-implement-Graph-Tree-algorithms-in-java http://algs4.cs.princeton.edu/code/ Order of static, init, constructor execution: http://stackoverflow.com/questions/19561332/in-what-order-do-static-blocks-and-initialization-blocks-execute-when-using-inhe Parent static block Child static block Parent initialization block Parent Constructor Child initialization block Child Constructor

Temporary table creations in database

DB2 temporary table creation CREATE GLOBAL TEMPORARY TABLE TEMPPROD (SERIALNO CHAR(8) NOT NULL, DESCRIPTION VARCHAR(60) NOT NULL, MFGCOSTAMT DECIMAL(8,2) , MFGDEPTNO CHAR(3) , MARKUPPCT SMALLINT , SALESDEPTNO CHAR(3) , CURDATE DATE NOT NULL); http://www.ibm.com/support/knowledgecenter/SSEPEK_10.0.0/intro/src/tpc/db2z_creationoftemporarytables.html Postgresql temporary table creation Example: CREATE TEMPORARY TABLE temp_location ( city VARCHAR(80), street VARCHAR(80) ) ON COMMIT DELETE ROWS; http://www.sqlines.com/postgresql/statements/create_temporary_table Oracle… Read More »

IN clause limit with databases – Oracle DB2

Few solutions read for ORACLE were, No issue if IN clause values comes from a sub-query  – no limit Storing the IN clause values in global temporary table and using them Using ORs in between 1000s of INs – performance impact http://www.orafaq.com/forum/t/41437/0/ https://community.oracle.com/thread/235143 Postgresql doesn’t have any limit: http://stackoverflow.com/questions/1009706/postgresql-max-number-of-parameters-in-in-clause SQL Server has higher limit: (closer… Read More »

Containerization Docker notes

https://www.udemy.com/the-docker-for-devops-course-from-development-to-production/ https://www.udemy.com/docker-tutorial-for-devops-run-docker-containers/ https://runnable.com/docker/java/dockerize-your-java-application http://www.javaworld.com/article/3000781/development-tools/open-source-java-projects-docker.html Docker for Java Developers: How to sandbox your app in a clean environment Orchestration http://getcloudify.org/2015/06/11/orchestration-docker-cloud-automation-openstack-heat-tosca-kubernetes.html http://kubernetes.io/docs/whatisk8s/

Open source tools

Automation testing open source tools 6 Open Source Test Automation Frameworks You Need to Know I like it though not used till now.. http://redwoodhq.com/

RESTful services automated testing

WebApplication automated testing http://wiremock.org/ http://stackoverflow.com/questions/31025753/jbehave-for-testing-rest-web-application You could use WireMock. It’s a library that works really good with http requests. You could start your WireMock server in @BeforeStory and it will start recording and then shut it down in your @AfterStory in your steps class. You will have your response for your request stored in a… Read More »

Loadbalancer concepts different configurations questions

https://support.rackspace.com/how-to/cloud-load-balancers/ https://tomcat.apache.org/connectors-doc/common_howto/loadbalancers.html   What is proxy server? What is proxy server? obscuring a client’s IP Address, blocking malicious traffic, log site, blogging activity, and improving performance. explanation Forward and Reverse Proxy Server Complete understanding about proxies   http://tutorials.jenkov.com/software-architecture/load-balancing.html Load balancing different ways https://docs.oracle.com/cd/E19900-01/819-4812/aboaq/index.html http://www.javaworld.com/article/2077921/architecture-scalability/server-load-balancing-architectures–part-1–transport-level-load-balancing.html http://www.javaworld.com/article/2077922/architecture-scalability/server-load-balancing-architectures-part-2-application-level-load-balanci.html https://dzone.com/articles/load-balance-your-web-applicat http://archive.oreilly.com/pub/a/onjava/2001/09/26/load.html Clustering vs. Load Balancing – What is the… Read More »

RESTful services references

Bean validation https://jersey.java.net/documentation/latest/bean-validation.html http://www.makeinjava.com/validation-request-query-parameters-standard-annotations-jersey-bean-validation/ http://www.makeinjava.com/validation-of-rest-parameters-using-jersey-framework-part-2/ Blogs https://jersey.java.net/bloggers.html Quick guide https://www.tutorialspoint.com/restful/restful_quick_guide.htm Status codes: Sr. No. HTTP Code Description 1 200 OK, shows success. 2 201 CREATED, when a resource is successful created using POST or PUT request. Return link to newly created resource using location header. 3 204 NO CONTENT, when response body is empty for example, a… Read More »

Web Application Security – Vulnerability concepts

Cross site scripting (XSS) https://www.owasp.org/index.php/Cross-site_Scripting_(XSS) https://www.owasp.org/index.php/Testing_for_Cross_site_scripting SQL Injection https://www.checkmarx.com/knowledge/knowledgebase/SQLi https://www.checkmarx.com/2014/04/07/one-vulnerability-to-rule-them-all-sql-injection/ Prevention cheat sheet https://www.owasp.org/index.php/SQL_Injection_Prevention_Cheat_Sheet Securing RESTful services https://www.owasp.org/index.php/REST_Security_Cheat_Sheet User input validation for Jersey https://jersey.java.net/documentation/latest/bean-validation.html https://www.w3.org/TR/html40/appendix/notes.html#non-ascii-chars

IoT reference

IoT Protocols Part 3: IoT Protocol Stack Options IoT Agent https://www.opswat.com/blog/gears-open-source-agent-for-linux-iot