::f10w3r:: https://www.fiorenzo.pizza ::f10w3r:: --b10g-- Sat, 09 Dec 2017 08:59:05 +0000 it-IT hourly 1 https://wordpress.org/?v=4.8.7 regular expressions in a simple way: VerbalExpressions https://www.fiorenzo.pizza/2017/12/09/regular-expressions-in-a-simple-way-verbalexpressions/ https://www.fiorenzo.pizza/2017/12/09/regular-expressions-in-a-simple-way-verbalexpressions/#respond Sat, 09 Dec 2017 08:59:05 +0000 https://www.fiorenzo.pizza/?p=101 Leggi tutto "regular expressions in a simple way: VerbalExpressions"

]]>
Surfing to find new things, i found this important library.. amd i thought:
‘how is possible survive to regular expressions, without using this VerbalExpressions???

If you worked with regex, when you read the initial example.. the smile open your face…

 

VerbalExpression testRegex = VerbalExpression.regex()
                                                .startOfLine().then("http").maybe("s")
	           				.then("://")
	           				.maybe("www.").anythingBut(" ")
	           				.endOfLine()
	           				.build();

// Create an example URL
String url = "https://www.google.com";

// Use VerbalExpression's testExact() method to test if the entire string matches the regex
testRegex.testExact(url); //True

testRegex.toString(); // Outputs the regex used:
                      // ^(?:http)(?:s)?(?:\:\/\/)(?:www\.)?(?:[^\ ]*)$

Is it very very fantastic?

https://github.com/VerbalExpressions/JavaVerbalExpressions

]]>
https://www.fiorenzo.pizza/2017/12/09/regular-expressions-in-a-simple-way-verbalexpressions/feed/ 0
api gateway: try https://www.fiorenzo.pizza/2017/12/08/api-gateway-try/ https://www.fiorenzo.pizza/2017/12/08/api-gateway-try/#respond Fri, 08 Dec 2017 16:00:50 +0000 https://www.fiorenzo.pizza/?p=97 traefik:
https://docs.traefik.io/

kong:
https://getkong.org/

]]>
https://www.fiorenzo.pizza/2017/12/08/api-gateway-try/feed/ 0
vertx web services https://www.fiorenzo.pizza/2017/02/02/vertx-web-services/ https://www.fiorenzo.pizza/2017/02/02/vertx-web-services/#respond Thu, 02 Feb 2017 16:23:48 +0000 http://www.fiorenzo.pizza/?p=88 if you need to create ws server:

  • https://groups.google.com/forum/#!topic/vertx/V20YVP3dN9Y
    • (how to generate xml in vertx – https://github.com/FasterXML/jackson-dataformat-xml)
  • http://stackoverflow.com/questions/20460870/java-soap-request-reading-soap-response
  • https://docs.oracle.com/javase/7/docs/api/javax/xml/soap/SOAPMessage.html

SAX Error – Content is not allowed in prolog

we need to find a way to parse a multipart/related txt in xml message + attachments

 

 

]]>
https://www.fiorenzo.pizza/2017/02/02/vertx-web-services/feed/ 0
vertx – login using jdbc + jdbcauth+ jwtAuth https://www.fiorenzo.pizza/2017/02/01/vertx-login/ https://www.fiorenzo.pizza/2017/02/01/vertx-login/#respond Wed, 01 Feb 2017 10:37:35 +0000 http://www.fiorenzo.pizza/?p=84 Leggi tutto "vertx – login using jdbc + jdbcauth+ jwtAuth"

]]>
scenario: api gateway + jwt token + jdbc login

using jdbc + jdbcauth+ jwtAuth

JDBCClient jdbcClient = JDBCClient.createShared(vertx, jdbcClientConfig);
JDBCAuth authProvider = JDBCAuth.create(vertx, jdbcClient);
JWTAuth jwt = JWTAuth.create(vertx, new JsonObject()
.put(“keyStore”, new JsonObject()
.put(“type”, “jceks”)
.put(“path”, “keystore.jceks”)
.put(“password”, “secret”)));

 

public void createUser(JDBCAuth auth, SQLConnection conn, String username, String password) {

String salt = auth.generateSalt();
String hash = auth.computeHash(password, salt);
// save to the database
conn.updateWithParams(“INSERT INTO user VALUES (?, ?, ?)”, new                                          JsonArray().add(username).add(hash).add(salt), res -> {
if (res.succeeded()) {
// success!
}
});
}

 

public void login(AuthProvider authProvider, RoutingContext routingContext) {
String username = routingContext.request().getParam(“username”);
String password = routingContext.request().getParam(“password”);
JsonObject authInfo = new JsonObject().put(“username”,                                                               username).put(“password”, password);
authProvider.authenticate(authInfo, res -> {
if (res.succeeded()) {
User user = res.result();
String token = jwt.generateToken(
new JsonObject()
.put(“name”, username)
.put(“id”, username)
.put(“username”, username),
new JWTOptions()
.setExpiresInSeconds(60000L)
.setSubject(username));
routingContext.response()
.putHeader(“Access-Control-Allow-Origin”, “*”)
.end(
new JsonObject()
.put(“token”, token)
.encodePrettily());
} else {
// Failed!
routingContext.response().putHeader(“Content-Type”, “text/plain”);
routingContext.response().setStatusCode(403).end();
}
});
}

// https://github.com/vert-x3/vertx-auth/blob/master/vertx-auth-jdbc/src/main/java/examples/AuthJDBCExamples.java

 

]]>
https://www.fiorenzo.pizza/2017/02/01/vertx-login/feed/ 0
enterprise logging using jboss tools https://www.fiorenzo.pizza/2016/11/07/enterprise-logging-using-jboss-tools/ https://www.fiorenzo.pizza/2016/11/07/enterprise-logging-using-jboss-tools/#respond Mon, 07 Nov 2016 08:21:46 +0000 http://www.fiorenzo.pizza/?p=80 Leggi tutto "enterprise logging using jboss tools"

]]>
Reading the errors of wildfly – weld, sometimes you can see some NUMBERS to identify the error..

/**
* Log messages for Contexts
* Message Ids: 000200 – 000299
*/

@MessageLogger(projectCode = WELD_PROJECT_CODE)
public interface ContextLogger extends WeldLogger

 

@LogMessage(level = Level.TRACE)
@Message(id = 200, value = “Looked for {0} and got {1} in {2}”, format = Format.MESSAGE_FORMAT)
void contextualInstanceFound(Object param1, Object param2, Object param3);

The theory:
https://developer.jboss.org/wiki/JBossLoggingTooling
the code:
https://github.com/wildfly/quickstart/tree/11.x/logging-tools

]]>
https://www.fiorenzo.pizza/2016/11/07/enterprise-logging-using-jboss-tools/feed/ 0
ejb3: transactions https://www.fiorenzo.pizza/2016/11/07/ejb3-transactions/ https://www.fiorenzo.pizza/2016/11/07/ejb3-transactions/#respond Mon, 07 Nov 2016 08:16:51 +0000 http://www.fiorenzo.pizza/?p=78 sometimes, i need a little review of things…

Making sense of EJB3.x Transaction Attributes – Part 2 (MANDATORY)

 

http://www.developerscrappad.com/572/java/java-ee/making-sense-of-ejb3-x-transaction-attributes-part-1-requires_new/

 

Making sense of EJB3.x Transaction Attributes – Part 4 (NEVER)

 

EJB3.x JPA: When to use rollback() and setRollbackOnly()

 

http://www.developerscrappad.com/435/java/java-ee/ejb-3-x-jpa-bean-managed-transaction-with-javax-ejb-usertransaction/

 

http://what-when-how.com/enterprise-javabeans-3/container-managed-transactions-ejb-3/

]]>
https://www.fiorenzo.pizza/2016/11/07/ejb3-transactions/feed/ 0
angular connect 2016 https://www.fiorenzo.pizza/2016/09/27/angular-connect-2016/ https://www.fiorenzo.pizza/2016/09/27/angular-connect-2016/#respond Tue, 27 Sep 2016 21:57:10 +0000 http://www.fiorenzo.pizza/?p=73 …a lot of thinks..

Angular 2 Testing for Hackers (workshop code):
https://github.com/angular-workshops/angular2-testing

Building Mobile Apps With Ionic 2 (workshop code) :
https://github.com/saniyusuf/ac-2016-todo
https://github.com/saniyusuf/ac-filminator

Managing Async With RxJS 5 and Angular 2 (workshop code) :
https://github.com/blesh/rxjs-workshop-angular

AngularConnect 2016 IoT Workshop
https://docs.google.com/document/d/1MuThvPnteYybmcsAKRhb3m87Q44WztSsR9sYq4BLRxc/edit#heading=h.1mit7hvm6z6w

https://medium.com/@urish/reverse-engineering-a-bluetooth-lightbulb-56580fcb7546#.ko2mkm27o

Bulb Ionic App (workshop code) :
https://github.com/gilf/bulb-ionic

Optimizing Angular Apps (slides):
https://docs.google.com/presentation/d/1oky6Px511zXdhfGQUmA9Pc6wdOYkkXgWxl3p7zOQP6A/preview?slide=id.p

 

]]>
https://www.fiorenzo.pizza/2016/09/27/angular-connect-2016/feed/ 0
java 2016: reactive & microservices https://www.fiorenzo.pizza/2016/09/24/java-2016-reactive-20microservices/ https://www.fiorenzo.pizza/2016/09/24/java-2016-reactive-20microservices/#respond Sat, 24 Sep 2016 15:39:52 +0000 http://www.fiorenzo.pizza/?p=69 Voilà:

https://oracle.rainfocus.com/scripts/catalog/oow16.jsp?event=javaone&search=reactive%20microservices&search.event=javaone

]]>
https://www.fiorenzo.pizza/2016/09/24/java-2016-reactive-20microservices/feed/ 0
vertx on java one 2016 https://www.fiorenzo.pizza/2016/09/24/vertx-on-java-one/ https://www.fiorenzo.pizza/2016/09/24/vertx-on-java-one/#respond Sat, 24 Sep 2016 15:39:15 +0000 http://www.fiorenzo.pizza/?p=67 Leggi tutto "vertx on java one 2016"

]]>
Vert.x – From zero to (micro)-hero
Clement Escoffier, Julien VietVersion 0.5,August 30th, 2016

 

Let’s start from the beginning…. Vert.x. What’s Vert.x ? That’s a pretty good question, and probably a good start. If you go on the Vert.x web site, Vert.x is defined as “a toolkit for building reactive applications on the JVM”. This description is rather fuzzy no ? What’s atoolkit ? What are reactive applications ? In this lab, we are going to explain these words, and build an application using Vert.x illustrating what Vert.x is. This application is going to be composed by microservices. Another buzzword to be trendy ? No, Vert.x was promoting microservices before everyone and his dog jumped on the bandwagon…..

http://escoffier.me/vertx-hol/

]]>
https://www.fiorenzo.pizza/2016/09/24/vertx-on-java-one/feed/ 0
vertx auth https://www.fiorenzo.pizza/2016/08/30/vertx-auth/ https://www.fiorenzo.pizza/2016/08/30/vertx-auth/#respond Tue, 30 Aug 2016 09:21:42 +0000 http://www.fiorenzo.pizza/?p=64 some starting points…

 

https://github.com/vert-x3/vertx-web/blob/master/vertx-web/src/test/java/io/vertx/ext/web/handler/BasicAuthHandlerTest.java

 

https://github.com/vert-x3/vertx-auth/blob/master/vertx-auth-jdbc/src/test/java/io/vertx/ext/auth/test/jdbc/JDBCAuthTest.java

]]>
https://www.fiorenzo.pizza/2016/08/30/vertx-auth/feed/ 0