Getting started with Dropwizard

Creating RESTful APIs and Microservices using Java programming language and a popular Dropwizard framework
3.7 (45 ratings) Instead of using a simple lifetime average, Udemy calculates a
course's star rating by considering a number of different factors
such as the number of ratings, the age of ratings, and the
likelihood of fraudulent ratings.
218 students enrolled
$19
$20
5% off
Take This Course
  • Lectures 64
  • Length 4 hours
  • Skill Level Intermediate Level
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works

Discover

Find online courses made by experts from around the world.

Learn

Take your courses with you and learn anywhere, anytime.

Master

Learn and practice real-world skills and achieve your goals.

About This Course

Published 11/2015 English

Course Description

In this course you'll learn how to create a simple RESTlike API using Java programming language and Dropwizard, a popular framework to build RESTful APIs and microservices. The course begins with a brief introduction to REST architecture style principles and an overview of an example application to store bookmarks, called DropBookmarks, we'll build throughout the course.

In the following parts you'll create a Hello World application using Dropwizard, learn how to test the application and use various tools to check the output of restful APIs. Also you'll learn how to connect to a relational database using Hibernate ORM framework, how to use database migrations with Liquibase and how to secure your API using Basic Authentication.

The course currently consists of 59 lectures and 4 hours of video. After taking this course you'll be able to start developing RESTlike APIs at Level 2 of Richardson Maturity Model and microservices using Java and Dropwizard. Also, some of the topics you'll learn may be useful for development of Web-based Java applications using other frameworks.

What are the requirements?

  • In order to succeed you’ll need basic knowledge of Java and SQL
  • Also, you should be able to install Java, MySQL, Git and an IDE or Maven on your computer

What am I going to get from this course?

  • create a database backed RESTlike API using Dropwizard
  • use test-driven approach to creating resources and access RESTful services using both a browser add-on and command line-tool
  • secure your API using Basic authentication and enable HTTPS using configuration
  • learn how to use database migrations

What is the target audience?

  • This is an intermediate course for those with basic knowledge of Java, relational databases and SQL
  • This is not an introductory Java programming course

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.

Curriculum

Section 1: Introduction
05:18

This lecture gives an introduction and walks you through the course.

Article

This lecture discusses the prerequisites for the course.

Section 2: What is REST
05:36

In this lecture we'll discuss how to evaluate if an API is RESTful using Richardson Maturity model and discuss the example application on which we'll be working in our course.

03:38

In this lecture will briefly discuss what is a REST architecture style and also go over some terms pertaining to the style.

Article

This lecture presents a whirlwind tour of the Level 3 of Richardson Maturity Model.

Article

REST architecture style assignments.

Section 3: Hello Dropwizard
05:26

In this lecture we'll create a Dropwizard project using Maven archetype from Command Line Interface. You can create the project from terminal and import it into your favorite IDE or skip this lecture and create the project using the IDE, which is explained in one of the following lectures.

03:12

In this lecture we'll create a Dropwizard project using Maven archetype and Netbeans

04:10

In this lecture we'll create a Dropwizard project using Maven archetype and IntelliJ IDEA.

03:20

In this lecture we'll create a Dropwizard project from Maven Archetype using Eclipse.

03:46

In this lecture we'll create a simple resource class with a single method which will allow us to output a greeting "Hello world".

02:55

In this lecture we'll learn how to run our project from Command Line Interface.

04:11

In this lecture we'll learn how to run our project using NetBeans IDE.

02:23

In this lecture we'll learn how to run our project using IntelliJ IDEA Community Edition.

03:03

In this lecture we'll learn how to run our project using Eclipse.

04:13

In this lecture you'll learn how to add testing capabilities to the project.

02:57

In this lecture you'll learn how to create a unit-test.

04:49

In this lecture you'll learn how to test resource classes using in-memory Jersey.

Section 4: Basic Authentication
01:07

In this lecture you'll learn what is the Basic Authentication and how it is used in a Dropwizard project.

04:43

In this lecture you'll learn how to add a class implementing Authenticator interface to the project.

02:43

In this lecture you'll learn how to register a class implementing Authenticator interface in the Application class.

02:06

In this lecture you'll learn how to instruct Dropwizard to prompt a user for credentials when a particular method in a resource class is accessed.

02:54

In this lecture you'll learn how to check whether a secured resource works correctly using Postman Chrome add-on. If you prefer using CLI, you can skip this lecture.

02:58

In this lecture you will learn how to access a secured resource using command-line cURL tool. You can skip this lecture if you don't like command-line interface.

08:29

In this lecture we'll start writing a unit test for a password-protected resource.

04:26

In this lecture we'll continue writing a unit test for a password-protected resource. You'll learn how to add Grizzly to your project to enable injection of User object to your method inside the test.

Section 5: Configuration and HTTPS
05:40

In this lecture you'll learn about YAML Dropwizard configuration files.

02:00

In this lecture you'll learn how to change the default port of your Dropwizard application.

04:03

In this lecture we'll discuss why we need HTTPS in our application.

03:56

In this lecture we'll switch on HTTPS support using Dropwizard configuration.

07:18

In this lecture you'll learn how to add an integration test to you application. We'll test a sad path here whereby no credentials are provided when trying to access the resource.

03:24

In this lecture we'll write a test method for the happy path, namely when the credentials are provided when trying to access the resource.

03:40

In this lecture you'll learn how to use HTTPS in your tests.

06:11

In this lecture you'll learn how to set database connection parameters in the application configuration file.

Article

Configuration assignments.

Section 6: Database Migrations with Liquibase
04:44

In this lecture we'll discuss the schema of the database of our example project and how to create and populate tables using database migrations.

05:16

In this lecture you'll learn how to write change logs.

07:30

In this lecture you'll learn about the convenient for development environment way to apply database refactorings.

05:52

In this lecture we'll continue writing database change log.

05:02

In this lecture you'll learn how to apply change sets to the database using Maven.

04:24

In this lecture we'll continue learning how to apply change sets to the database using Maven.

04:41

In this lecture you'll learn how to add a Liquibase module to the project, which will enable one to use application's CLI to apply migrations.

02:23

In this lecture you'll learn how to apply database refactorings using the command-line interface of your application.

Article

Migration assignments.

Section 7: Connecting to a Relational Database
04:38

In this lecture we'll discuss what database tables are necessary for our application and how to map classes to tables using industry standard called JPA and its certified implementation Hibernate.

05:16

In this lecture you'll learn how to write JPQL queries to fetch users from the application database.

06:17

In this lecture we'll add a DAO to manipulate users from Java code.

11:39

In this lecture we'll write a unit-test using in-memory database to check that queries return correct results.

05:25

In this lecture we'll continue writing a unit test using in-memory database.

03:03

In this lecture we'll add Hibernate bundle to the Application class.

03:20

In this lecture we'll create a new Authenticator class that uses to search database for the user by provided credentials.

04:28

In this lecture we'll modify the previously-created integration test to use separate configuration file and in-memory database.

05:42

In this lecture we'll create a Bookmark entity, map it to database and create an association with user entity.

05:35

In this lecture we'll create a DAO to manipulate bookmarks and add a couple of JPQL queries.

Article

Database assignments.

Section 8: Creating Resources
03:25

In this lecture we'll add a resource class which can access bookmark data in the database and produce JSON representations of bookmarks to a client and the first method that returns a list of bookmarks. At the end of this lecture you'll learn what annotations are used to decorate resource classes and methods and how to return a JSON representation of the list of objects.

04:09

In this lecture you'll learn how Dropwizard deals in exceptions in resource methods and what response is returned to the client in the case of an exception. We'll write a simple method that looks for a bookmark in the database by the id of a bookmark and throws an exception if the bookmark is present in the database but does not belong to authenticated user.

07:54

In this lecture a couple of sub-resource methods to manipulate bookmarks will be added.

03:48

In this lecture a method to create new bookmarks will be added to the resource class.

05:49

In this lecture we'll learn how to check if the resource methods work correctly using Chrome add-on called Postman. Some actions are needed before you can start using Postman with HTTPS. See resources section for instruction. If you prefer cURL, you could skip this lecture.

02:25

In this lecture you'll learn how to use cURL to check whether the correct results are returned by the resource class.

02:47

In this lecture you'll learn some additional cURL features suck as how to use HTTP POST and DELETE methods to add and delete bookmarks respectively.

Article

Resources assignments.

Section 9: Conclusion
Article

In this lecture we'll sum up what was accomplished in this course.

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Dmitry Noranovich, Java Developer and Entrepreneur

Dmitry Noranovich has been programming since 1993 when he learned C language to produce code to carry out computations for his research. Since then he has used C++ and Java for this purpose and as well taught an extracurricular computational physics course in a big university in south Russia. His experience also includes teaching general physics at university level. Besides Java, which is his primary programming language, Dmitry is dabbling in Angular.js and Bootstrap and is passionate about everything concerning REST APIs. Dmitry is a technology enthusiast and lifelong learner, so he periodically takes MOOCs in computer science and likes to think that someday he will produce one and also tries to learn something new on his own. When he doesn't work, he spends time with his wife and two kids. Should he have spare time, he prefers to spend it hiking or with his Kindle.

Ready to start learning?
Take This Course