Slide 1

Slide 1 text

1 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ A Comprehensive Spring Showcase: Personal Cloud Storage Application Erdem Günay, Expert Software Developer, Turkcell @gunayus

Slide 2

Slide 2 text

2 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ About me

Slide 3

Slide 3 text

3 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ About professional me  B. Sc. Degree from Computer Engineering, Middle East Technical University, Ankara, 1999  15 years experience with Java  10 years experience with Spring  Started and contirbuted project http://www.gwt-openlayers.org/  Enterprise application architecture  Working @Turkcell for 10 years  In organization Advanced Spring Framework trainer  In the project, software architect and developer

Slide 4

Slide 4 text

4 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Agenda  Spring Boot  Spring Data  Spring Amqp  Elastic Search  Openstack  App Demo

Slide 5

Slide 5 text

5 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Mobile Cloud Middleware

Slide 6

Slide 6 text

6 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Personal Cloud Solution Architecture Clients API LAYER Frontend Storage Elastic Search file metadata index token cache Oracle DB account subscription file system structure file metadata sharing metadata Openstack keystone swift file binary data upload / downoad Social / Cloud Backend Backend Services Legacy Enterprise Backend Systems Rabbit MQ

Slide 7

Slide 7 text

7 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ spring.io

Slide 8

Slide 8 text

8 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ SPRING IO EXECUTION: Spring Boot

Slide 9

Slide 9 text

9 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Before Spring Boot – hard work on dependency management …. …. many others

Slide 10

Slide 10 text

10 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ After Spring Boot – less work on dependency management

Slide 11

Slide 11 text

11 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ After Spring Boot – still have all the jars …. …. many others

Slide 12

Slide 12 text

12 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ So easy to start & debug a web app

Slide 13

Slide 13 text

13 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ & Expose a Rest service

Slide 14

Slide 14 text

14 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ & Expose a SOAP Web service

Slide 15

Slide 15 text

15 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Deploy on a web app container

Slide 16

Slide 16 text

16 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Auto configuring properties application.properties # Spring Profiles # =============== spring.profiles.active=test, apiservice, backend # Global properties ... application-apiservice.properties # apiservice related properties # =============== api.service.url=http://... # other properties ... application-backend.properties # backend related properties # =============== backend.service.url=http://... # other properties ...

Slide 17

Slide 17 text

17 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Configuring environmental differences – DEV

Slide 18

Slide 18 text

18 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Configuring environmental differences – TEST & PROD

Slide 19

Slide 19 text

19 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ @Scheduled, @Async

Slide 20

Slide 20 text

20 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ @Scheduled, @Async

Slide 21

Slide 21 text

21 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ SPRING IO FOUNDATION: Spring Data

Slide 22

Slide 22 text

22 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ In the beginning – all work done by developers

Slide 23

Slide 23 text

23 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Spring killed the pain a bit – obtained & released resources

Slide 24

Slide 24 text

24 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Got better with JPA & Hibernate, but still coded by developers

Slide 25

Slide 25 text

25 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Finally, «no code no bug»

Slide 26

Slide 26 text

26 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ All you need is javax.persistence @Entity /** * @author Oliver Gierke */ @Entity public class Customer { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; private String firstname; private String lastname; @JsonIgnore @OneToMany(mappedBy="customer") private Set accounts = new HashSet();

Slide 27

Slide 27 text

27 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Still plain old Sql, but not coded, auto generated, time saving select customer0_.id as id1_1_, customer0_.firstname as firstnam2_1_, customer0_.lastname as lastname3_1_ from customer customer0_ where (customer0_.firstname like ?) and upper(customer0_.lastname)=upper(?) public List findByFirstnameLikeAndLastnameIgnoreCase( String firstname, String lastname);

Slide 28

Slide 28 text

28 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Custom, native, modifying queries

Slide 29

Slide 29 text

29 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Spring AMQP

Slide 30

Slide 30 text

30 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Spring AMQP – RabbitMQ Configuration

Slide 31

Slide 31 text

31 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Spring AMQP – Consumer Configuration

Slide 32

Slide 32 text

32 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Spring AMQP – Message listener

Slide 33

Slide 33 text

33 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Spring AMQP – Message producer

Slide 34

Slide 34 text

34 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Spring summary  Spring Boot : the parent of everything, auto configuration  Spring Web : Restful APIs, @RestTemplate  Spring Data JPA : Repositories, custom, native, modifying queries  Spring Security  Spring Social : sharing on Twitter, Facebook  Spring Web Services : client & server  Spring AMQP  @Async, @Scheduled, @Transactional  @Bean Java config  No XML config or web.xml at all

Slide 35

Slide 35 text

35 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Elastic Search

Slide 36

Slide 36 text

36 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Elastic Search

Slide 37

Slide 37 text

37 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Elastic Search

Slide 38

Slide 38 text

38 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Elastic Search – index a document index type id source

Slide 39

Slide 39 text

39 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Elastic Search – get a document

Slide 40

Slide 40 text

40 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Elastic Search – Integrate with Spring App Context

Slide 41

Slide 41 text

41 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Elastic Search – Index a document

Slide 42

Slide 42 text

42 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Elastic Search – Search documents

Slide 43

Slide 43 text

43 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Elastic Search – Delete user documents

Slide 44

Slide 44 text

44 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ openstack

Slide 45

Slide 45 text

45 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Openstack

Slide 46

Slide 46 text

46 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Openstack - Modules

Slide 47

Slide 47 text

47 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Openstack – Keystone authentication API

Slide 48

Slide 48 text

48 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Openstack – Authentication from Spring

Slide 49

Slide 49 text

49 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Openstack – Account creation from Spring

Slide 50

Slide 50 text

50 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Openstack – User creation from Spring

Slide 51

Slide 51 text

51 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Openstack – File upload from Spring https://{swift_url}/v1/AUTH_049037f79ea24214b2778830c96fd243/CONTAINER_MAIN/ 3b841cd9-547b-432a-98d9-3ce6211bab4f project_id container_name file_path

Slide 52

Slide 52 text

52 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Openstack – File download from Spring

Slide 53

Slide 53 text

53 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Demo Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ APPLICATION

Slide 54

Slide 54 text

54 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ The Team  Volkan Esgel – Security master  Hüseyin Özcan – The UI man  Erdem Günay – it’s me  Kemal Yılmaz – the manager of the team

Slide 55

Slide 55 text

55 Unless otherwise indicated, these slides are © 2014-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Learn More. Stay Connected.  Twitter: twitter.com/gunayus  LinkedIn: linkedin.com/in/gunayus  Github: github.com/egunay Twitter: twitter.com/springcentral YouTube: spring.io/video LinkedIn: spring.io/linkedin Google Plus: spring.io/gplus