Java 8 introduced the superior LocalDate and LocalDateTime, but JDBI does not work so nicely with them. You’ll find errors like: In order to bind the parameters of a JDBI DAO for these Objects, you’ll need to implement your own Binder. Using the Binder And in usage, set the binder for the @Bind annotation. This […]
Tag: java
Hibernate within Dropwizard CLI Commands
Learn how to utilize Hibernate within Dropwizard, an extensible Java framework. This guide shows how to use it in CLI commands.
LDAP Authentication with Dropwizard
Authentication for your application may be crucial to its operation. Dropwizard provides a pretty clear description of different capabilities, but I thought I’d give a simple step-by-step implementation path. 1. Dependencies The good folks at yammer have provided this open source authenticator for Dropwizard specifically for LDAP. Add this to your pom: Please note, I’m […]
Request and Response Filters in Dropwizard
When constructing a Dropwizard application, there may be some pre-processing or post-processing you’d like to do on Resource methods. It’s fairly easy to add request and response filters in Dropwizard through the implementation of ContainerRequestFilter, ContainerResponseFilter, and ResourceFilterFactory, and adding them to the environment.
Dropwizard and SSL
Dropwizard can quickly start up a web server with little configuration required. The default server implementation uses http, running on port 8080 by default. But what if you want users to log into your web application? Dropwizard provides moderately useful documentation on setting up authenticators, but you should also update your server to run over […]
Migrating from Spring MVC to Dropwizard
I’ve been going through the process of moving my Spring MVC web application to DropWizard. One benefit of this technology I hope to utilize is the ability to release an application and not affect cohabitating applications within a web container.
Getting Started on Hydra
Dependencies Maven Java 7 SDK RabbitMQ (Instructions provided below) Building 1. Checkout from Github 2. RabbitMQ As described in the Hydra Readme.mdown, Hydra uses rabbitmq for low volume commands and control message exchanges. On a modern Linux systems apt-get install rabbitmq-server and running with the default settings is adequate in most cases. For Mac OS (my environment), I used Homebrew to install it. Super easy […]
County Housing Search
From Mar 27, 2012 I recently wrote a job to identify the counties with the most houses for sale (according to the 2010 Census). To do so, I ingested the data from the Census Bureau, and wrote a MapReduce job. My goal was to have all counties and the total houses for sale in ascending […]
Using Java’s URLEncoder
We developers really should heed the warnings of deprecations. Java’s URLEncoder.encode(String); throws the deprecated warning, encouraging us to use URLEncoder.encode(String,String);. I use this tool to encode the special characters in parameters on an URL to prevent a misunderstanding with a server. Want to finally do the right thing and use that method? Here’s what you […]
Jobs in Hydra
Continuing in Hydra land, one of the pinnacle objects is the Job. These jobs represent the construction of information from a source. Think of it as the worker, milling away to create the DataTree. IJob The IJob interface lays the foundation. It has many properties defining the characteristics of a job, such as start time, […]