Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Building Serverless Architectures

You're reading from   Building Serverless Architectures Unleash the power of AWS Lambdas for your applications

Arrow left icon
Product type Paperback
Published in Jul 2017
Publisher Packt
ISBN-13 9781787129191
Length 242 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Cagatay Gurturk Cagatay Gurturk
Author Profile Icon Cagatay Gurturk
Cagatay Gurturk
Arrow right icon
View More author details
Toc

Creating User Service

We will now start implementing our first service, User Service. In the beginning, we will only implement a method that returns a User object for a given token string. If a user can't be found in the repository, the method will return UserNotFoundException, which should be caught by the AWS Lambda function and translated into the decline policy.

We can start implementing our User Service in the way we already know. Let's add our new module's name to the settings.gradle file using a simple echo command:

    $ echo "include 'services-user'" >> settings.gradle

Create the required folder using the following command:

    $ mkdir -p services-user/src/main/java/com/serverlessbook/services/user 

It is a good time to create a User object for our project now. The User class will have the ID, email, and username properties,...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £16.99/month. Cancel anytime