4.09 out of 5
4.09
270 reviews on Udemy

RESTful Web Service with Java JAX-RS. Create & Deploy to AWS

* Create REST API with JAX-RS and Jersey * Build Restful Web Service * Deploy to AWS * Implement CRUD with Hibernate *
Instructor:
Sergey Kargopolov
1,496 students enrolled
English [Auto-generated]
Install Java, Netbeans IDE, Postman, MySQL Service and Apache Tomcat on local Mac computer
Learn to send HTTP Requests with Postman client
Use Netbeans to write Java code
Create Java Project with Maven
Configure Hibernate framework to persist Java objects in MySQL database
Build RESTful Java Web Services with JAX-RS and Jersey framework
Startup AWS EC2 Linux Server in Amazon Cloud
Configure AWS EC2 Instance Firewall
Connect to AWS EC2 Instance via SSH
Create MySQL database and users
Install MySQL Server and Apache Tomcat on AWS EC2 Linux Server
Deploy RESTful Java Web Service to a remote AWS EC2 Linux Server
Implement Email Verification with AWS SES(Simple Email Service)

This is a very practical video course aimed at beginner Java developers to help them build their very first RESTful Java Web Service with JAX-RS and Jersey framework as well as implement features like: 

  • User sign up, 
  • User sign in, 
  • Token base authentication.
    Students will also learn how to encrypt user provided password, generate a public user id which is safe to pass around the network in HTTP Requests, and how to generate and securely store as well as validate a secure access token, 
  • Protect RESTful WebService endpoints, 
  • Update database records by implementing Update User Profile details feature, 
  • and learn how to Delete database records,
  • Implement Email Verification feature using Amazon AWS SES(Simple Email Service)

Students will learn how to use Postman HTTP client software to send: HTTP POST, GET, DELETE and PUT requests, as well as how to set needed HTTP Headers. We will also cover how to: 

  • Send data to your RESTful WebService via HTTP Body and 
  • How to pass data via URL Query String and as a Path parameter

You will also learn how to make your RESTful Web Service accept and respond back with JSON or XML media type. 

This video course also teaches how to install needed software on local computer to be able to build RESTful Java Web Service as well as:

  • How to start up your own Linux server in Amazon cloud( AWS EC2),
  • Install needed software on a remote EC2 instance and finally, 
  • How deploy created WebService on AWS EC2 instance. 

Please note that even though this video course covers all of the above mentioned, it is not a comprehensive guide that covers, in little details, all and everything about building Web Services. There are still things to be learned. But you will definitely benefit and gain by learning the above mentioned material. 

Source code

1
Source code

This section contains a link to download entire source code of my project.

Introduction

1
Introduction

Introduction to a course

2
Install Rest API Client Postman

In this video we will download and install Postman client which we will use in this course to send HTTP Requests to our RESTful WebService.

3
Postman overview

This video will cover Postman HTTP client user interface and show you how to use it to send HTTP Requests. 

4
Resource and Collection URIs

When building RESTful WebServices it is very important to understand what is a Resource and what is a Resource collection as well as how to structure a URL to a Resource and to a Resource collection. In this video we will learn how the URL to a Resource should be structured and look like. 

5
HTTP Methods. GET, POST, DELETE, PUT

In this video we will learn about most commonly used HTTP Methods and how they are being used in RESTful Web Services. 

6
HTTP Headers: Accept and Content Type

In this video we will learn about Accept and Content type HTTP headers and how they used with RESTful Web Services. 

Development Environment: Netbeans

1
Install Java Platform (JDK)

In this video we will download and Install Java Development Kit on our computer.

2
Download and Install NetBeans Development Environment

In this video I will give you an overview of Netbeans Development Environment which we will then download and install on our computer.

3
Create new Project with Maven

In this lesson I will introduce you to a Software Management Tool called Maven. We will then learn how to create a new Java project using Maven.

4
Adding Jersey Framework, MySQL and Hibernate Dependencies

In this video we are going to learn how to add dependency libraries to our project. We will use Maven to download and add to our project following libraries: Jersey framework, MySQL database server and Hibernate framework. 

5
Download & Add Apache Tomcat to our Project

In this lesson we will learn how to download and install on our local computer Apache Tomcat Servlet Container. We will also learn how to add Apache Tomcat to our Netbeans project. 

What if You Use IntelliJ?

1
Only if you use IntelliJ IDE
2
Create Maven project with IntelliJ
3
Add needed dependencies to pom.xml file
4
Add Tomcat to IntelliJ

What if You Use Eclipse

1
Only if you use Eclipse IDE
2
Download Eclipse
3
Create New Maven Project with Eclipse
4
Add needed dependencies to pom.xml file
5
Add Tomcat to Eclipse Project

MySQL Database on Local Computer

1
Downloading and Installing MySQL Database

In this lesson we will download and install MySQL database server. 

2
Creating MySQL Database and User

In this video we will learn how to create a new database and a new database user. 

Hibernate

1
Create Hibernate Configuration File

In this video we will talk about the Hibernate configuration file learn how to configure it so that we can use Hibernate framework to persist Java objects into MySQL database. 

Getting Started

1
Introduction to Web Service Application Layers

In this lesson I will give you an overview of how I have organized my code in this project. There are three main layers I am going to introduce you to: Presentation layer, Service layer and Data layer and you will learn what objects live in each of these layers. 

2
Create Application Starting Point

In this lesson we will create our Web Service application starting point. 

HTTP POST. Creating New User Profile

1
Users Resource Class & Create User Method

In this video we are going to create a Web Service Resource Class which will be responsible for accepting HTTP Requests and responding to those HTTP Requests and this Resource class service HTTP requests that are only related to working with User and their Profile. For example to create a new user in our application we will send an HTTP Post request, and it is this Resource class, that will be responsible for handling that HTTP request and responding to it. Or if our mobile application needs to update or delete user profile, it is also this Resource class that will be service these http requests. 

This resource class will need to be annotated with @Path annotation which will be used to specify the URI path to this resource class. For example by annotating this resource class with @Path("/users") we are making it available for http requests which are sent to a /api/users web service endpoint. 

2
New User Request & Response Model

In this video we are going to create two Plain Old Java Objects which will be used when the framework needs to convert the JSON Payload into Java object when HTTP Request arrives and then back from Java to JSON or XML when we need to send the HTTP Response back. 

And this conversion of JSON to Java and from Java back to JSON is done by the Jersey framework for us and we do not need to do anything manually other than create a Java class that will match the fields in the JSON object. 

Also, I am going to use the Java Architecture for XML Binding (JAXB) approach and will annotate my Java Model classes with @XmlRootElement. The use JAXB will allow me to support both XML and JSON as a MediaType of the Resource Representation my Web Service sends back to a mobile application. 

3
User Service Method

In this video we are going to create a UserService interface and interface implementation code. 

4
Validate the required fields

In this video we will write code to check if all the required fields are present and their values are not empty. 

Exceptions Handling

1
Create Error Messages Enum

In this video we will start talking about how to handle errors in our Web Services project and will create a first class that will hold the description of error messages that we will handle and return back with a HTTP Response. 

2
Create Custom RuntimeException

In this video we are going to create our first custom exception class which is a Missing Required Field Exception. 

3
Installing Netbeans Plugin to generate the unique value for serialVersionUID

In this video I am going to show you how to enable Netbeans hits and how to install a Netbeans plugin that generates a unique value for serialVersionUID

4
Create ErrorMessage Class

In this lesson we will create an ErrorMessage class which will eventually we converted into JSON or XML format and returned back with HTTP Response of an error took place. 

5
Return Exception Message As JSON

In this lesson we will learn how to create Exception Mapper class and how to make it return the error message we want. 

6
Sending HTTP Request to see the error message

In this video we will run our project and will send an HTTP request which should trigger and error message. We will see how an error message is triggered and returned back with HTTP response. 

7
Creating Generic Exception Handler

In those cases when an error took place and we do not have a handler for that Exception message, we will use a Generic Exception Mapper class to handle all other error messages. This way we will always return back a properly formatted error message in JSON format. 

Working with Database

1
User Database Entity Class

In thi lesson we will learn what is an Entity class and will create our very first Entity class which will be persisted into MySQL database. 

2
Add Entity Class to Hibernate Configuration File

In this video we will learn how to register Entity classes in Hibernate configuration file. 

3
Creating Data Access Object Class

In this video we will create a Database Access Object which will encapsulate code that communicates with Database. If eventually we need to go away from Hibernate and MySQL database we can simply add another Database Access Object class and will not need to rework our application much. 

4
Hibernate Session Factory

In this video we will write Java code to create a  Hibernate Session Factory class. 

5
Generate User Id

In this video we will learn how to generate a secure public user id value which is safe to pass around the network and is safe to include in HTTP requests. 

6
Secure Way of Storing User Password

In this video we will learn how to encrypt user provided clear text password and how it should be stored in a database. 

7
Save User in Database.

In this video we will write code to persist user details in a database. 

8
HTTP Post Request to Create a New User

In this video we will sent HTTP POST request to create a new user and see if the code we have put together until now works well. 

9
Update project to use C3P0 Connection Pooling

In this video we are going to configure our project to use a better connection pooling algorithm - the C3P0 Connections Pooling Provider. 

Hibernate's internal connection pooling algorithm is rudimentary, and is provided for development and testing purposes. And when our application is ready to be published into production environment it is recommended that a better connection pooling algorithm is used. 


HTTP GET. Get User Profile API Call

1
@Path and @PathParam Annotation

In this video we will learn about two new annotations and how they are used: @Path and @PathParam. 

2
Create NoRecordFoundException

In this lesson we will create a new custom Exception class - NoRecordFoundException. 

3
Service Layer and Database Access Code

In this video we will prepare Service layer and Data Access layer code for our get user profile functionality. 

4
HTTP GET Request to return user details.

In this video we will send HTTP GET request to try if the code we have put together so far works well and we can retried the user record with provided user id. 

User Sign In and Secure Access Token

1
Create Authentication Web Service Entry Point

In this video we will start working on Authentication Web Service End Point. 

2
Create AuthenticationException

In this lesson we will create an AuthenticationException which will be thrown when user authentication fails. 

3
Authentication Service class

In this video we will write Java code for an Authentication Service layer. 

4
Issue Secure Access Token

In this video we will learn how to generate a secure access token and include it in HTTP Response. 

5
Trying the Issue Access Token Code

In this video we will try how the Authentication Web Service Endpoint works and if the provided access token can be successfully validated. 

6
Reset Security Credentials

To make our Authentication mechanism more secure we will reset security credentials and the secure access token every time when user successfully sign in using our Authentication Service. 

Access Protected WS Endpoints With Access Token

1
Using @NameBinding to Create a @Secure Annotation

In this video we will learn how to use @NameBinding to create a @Secure annotation which will be used to protect WebService endpoints that required Authentication. 

2
AuthenticationFilter to Perform Token-based Authentication

In this video we will create an Authentication Filter class to perform Token-Based Authentication. 

3
Making the Get User Profile request protected

In this video we will annotate the Get User Profile WebService endpoint with @Secure annotation to make the WebService endpoint protected and require an authentication to be performed before a user details can be returned with a response. 

Get All Users. Implementing Pagination.

1
Get Users Request, @QueryParam and @DefaultValue

When the number if registered users grows to thousands it is not a good idea to return entire list of users in a single response. Mobile applications and web sites implement pagination functionality to return a certain amount of records per page. 

In this lesson I will introduce you to @QueryParam and @Default value annotations and we will learn how to implement support for "pagination" in our RESTful Webservice. 

2
Service Layer Code

In this video we will write code for the Service Layer of our Get Users http request. 

3
Data Layer Code

In this video we will write code for Data layer of our Get Users functionality. We will learn how to query a list of users from a database and limit the result list to a requested range of records. 

4
Trying The Get Users HTTP Request

In this video we will try how to Get Users HTTP Request works and if the implemented pagination supports works well and returns a requested range of records. 

HTTP PUT. Update User Details Request.

1
HTTP PUT. Update User Details

In this video we will start working on an Update User details functionality and I will introduce you to a new @PUT annotation. 

2
Update User Profile Service and Data Layers

In this video we will be working on a Service and Data layer code for our update User Profile functionality. 

3
Trying The Update User Profile API Call

In this video we will use Postman tool to send HTTP PUT request to see of the code we have prepared for the Update user profile functionality works and we can successfully update user details. 

HTTP DELETE. Delete User Details

1
HTTP DELETE. Delete User Details

In this video we will start working on the Delete user functionality and I will introduce you to a new @DELETE annotation. 

2
Delete User Profile Service and Data Layers Code

In this lesson we will be working on Service Layer and Data layer code for our Delete record functionality. 

3
Trying The Delete User Profile API Call

In this video we will user Postman tool to send HTTP DELETE request to see if out Delete record functionality works well and we can successfully delete user profile details from our database. 

Free Video Course that uses this API

1
If you are a Swift Mobile App Developer for iOS Platform

Deploy Web Service App on Amazon EC2 Linux Server

1
Startup Your Own Amazon EC2 Linux Server

In this video I will introduce you to Amazon Web Services(AWS) page and we will learn how to start up our very own AWS EC2 Linux Server. I will walk you through the needed steps and we will finish up with a new Linux server running in Amazon cloud. 

2
Connect To Your Server via SSH

In this video I will show you how to connect to your EC2 Linux server via SSH. 

3
Update Server Software Packages and Update Java

In this video we will learn how to update software packages on our newly started Linux server in Amazon cloud and how to update Java and switch to a specific version of Java we need. 

4
Download & Install Apache Tomcat on AWS EC2 Linux Server

In this video we will learn how to download and Install Apache Tomcat on our EC2 Linux Server. I will also show you how to start up, stop and restart your Apache Tomcat Servlet container on Linux Server. 

5
Configure Apache Tomcat Users

To be able to deploy your RESTful Web Service application into Tomcat Servlet Container we will need to configure a new user with proper permissions. In this video I will show you how to add a new Tomcat user. You will use the credentials we will create in this video to deploy your RESTful WebService on your EC2 instance. 

6
Download and Install MySQL Server on EC2 Linux Server

In this video you will learn how to download and install MySQL Server on your EC2 server.

7
Create Database and Add Database User

In this video you will learn how to create a new Database and a new database user. The credentials of this newly created user will need to be added to our Web Services project so that it can communicate with the database we will create in this video. 

8
Deploy Our Web Service App on Apache Tomcat

In this video we will learn how to deploy our RESTful Web Service application on to Apache Tomcat Servlet Container running on our own server in Amazon cloud. 

9
Sending HTTP Request to a WebService Deployed on a Remote Server

In this video we will use Postman tool to send HTTP request to a remote AWS EC2 instance and see of our RESTful Web Service application can successfully communicate with MySQL database and can write and read records from it. 

Implement Email Verification Feature with AWS SES (Simple Email Service)

1
Verify Email Address with Amazon SES

In this video we will learn how to use Amazon AWS SES(Simple Email Service) to verify the email address which we will use as a Sender email address. Sender email address is an email address on behalf of which an email message is sent. 

You can view and review the lecture materials indefinitely, like an on-demand channel.
Definitely! If you have an internet connection, courses on Udemy are available on any device at any time. If you don't have an internet connection, some instructors also let their students download course lectures. That's up to the instructor though, so make sure you get on their good side!
4.1
4.1 out of 5
270 Ratings

Detailed Rating

Stars 5
142
Stars 4
81
Stars 3
34
Stars 2
4
Stars 1
10
c94549ec1742e805c81ecccc542283f6
30-Day Money-Back Guarantee

Includes

9 hours on-demand video
5 articles
Full lifetime access
Access on mobile and TV
Certificate of Completion