Skip to content

Commit de56cbb

Browse files
author
Besok
committed
change according to cgeckstyle
1 parent 74c7273 commit de56cbb

27 files changed

+825
-714
lines changed

saga/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: pattern
33
title: Saga
4-
folder: Communication
4+
folder: saga
55
permalink: /patterns/saga/
66
categories: Behavioral
77
tags:
@@ -43,4 +43,4 @@ Use the Saga pattern, if:
4343
- you can not use 2PC(two phase commit)
4444

4545
## Credits
46-
- [pattern description](https://microservices.io/patterns/data/saga.html)
46+
- [Pattern: Saga](https://microservices.io/patterns/data/saga.html)

saga/pom.xml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,23 @@
2323
THE SOFTWARE.
2424
2525
-->
26-
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
27-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
28-
<modelVersion>4.0.0</modelVersion>
29-
<parent>
30-
<groupId>com.iluwatar</groupId>
31-
<artifactId>java-design-patterns</artifactId>
32-
<version>1.22.0-SNAPSHOT</version>
33-
</parent>
26+
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
27+
xmlns="http://maven.apache.org/POM/4.0.0"
28+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
29+
<modelVersion>4.0.0</modelVersion>
30+
<parent>
31+
<groupId>com.iluwatar</groupId>
32+
<artifactId>java-design-patterns</artifactId>
33+
<version>1.22.0-SNAPSHOT</version>
34+
</parent>
3435

35-
<artifactId>saga</artifactId>
36-
<dependencies>
37-
<dependency>
38-
<groupId>junit</groupId>
39-
<artifactId>junit</artifactId>
40-
<scope>test</scope>
41-
</dependency>
42-
</dependencies>
36+
<artifactId>saga</artifactId>
37+
<dependencies>
38+
<dependency>
39+
<groupId>junit</groupId>
40+
<artifactId>junit</artifactId>
41+
<scope>test</scope>
42+
</dependency>
43+
</dependencies>
4344

4445
</project>

saga/src/main/java/com/iluwatar/saga/choreography/Chapter.java renamed to saga/src/main/java/com/iluwatar/saga/choreography/ChoreographyChapter.java

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -24,37 +24,40 @@
2424

2525

2626
/**
27-
* Chapter is an interface representing a contract for an external service.
27+
* ChoreographyChapter is an interface representing a contract for an external service.
2828
* In that case, a service needs to make a decision what to do further
2929
* hence the server needs to get all context representing {@link Saga}
30-
* */
31-
public interface Chapter {
32-
33-
/**
34-
* In that case, every method is responsible to make a decision on what to do then
35-
* @param saga incoming saga
36-
* @return saga result
37-
*/
38-
Saga execute(Saga saga);
39-
40-
/**
41-
* @return service name.
42-
*/
43-
String getName();
44-
45-
/**
46-
* The operation executed in general case.
47-
* @param saga incoming saga
48-
* @return result {@link Saga}
49-
*/
50-
Saga process(Saga saga);
51-
52-
/**
53-
* The operation executed in rollback case.
54-
* @param saga incoming saga
55-
* @return result {@link Saga}
56-
*/
57-
Saga rollback(Saga saga);
30+
*/
31+
public interface ChoreographyChapter {
32+
33+
/**
34+
* In that case, every method is responsible to make a decision on what to do then
35+
*
36+
* @param saga incoming saga
37+
* @return saga result
38+
*/
39+
Saga execute(Saga saga);
40+
41+
/**
42+
* @return service name.
43+
*/
44+
String getName();
45+
46+
/**
47+
* The operation executed in general case.
48+
*
49+
* @param saga incoming saga
50+
* @return result {@link Saga}
51+
*/
52+
Saga process(Saga saga);
53+
54+
/**
55+
* The operation executed in rollback case.
56+
*
57+
* @param saga incoming saga
58+
* @return result {@link Saga}
59+
*/
60+
Saga rollback(Saga saga);
5861

5962

6063
}

saga/src/main/java/com/iluwatar/saga/choreography/FlyBookingService.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
* Class representing a service to book a fly
2828
*/
2929
public class FlyBookingService extends Service {
30-
public FlyBookingService(ServiceDiscoveryService service) {
31-
super(service);
32-
}
30+
public FlyBookingService(ServiceDiscoveryService service) {
31+
super(service);
32+
}
3333

34-
@Override
35-
public String getName() {
36-
return "booking a Fly";
37-
}
34+
@Override
35+
public String getName() {
36+
return "booking a Fly";
37+
}
3838
}

saga/src/main/java/com/iluwatar/saga/choreography/HotelBookingService.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@
2727
* Class representing a service to book a hotel
2828
*/
2929
public class HotelBookingService extends Service {
30-
public HotelBookingService(ServiceDiscoveryService service) {
31-
super(service);
32-
}
30+
public HotelBookingService(ServiceDiscoveryService service) {
31+
super(service);
32+
}
3333

34-
@Override
35-
public String getName() {
36-
return "booking a Hotel";
37-
}
34+
@Override
35+
public String getName() {
36+
return "booking a Hotel";
37+
}
3838

3939

40-
}
40+
}

saga/src/main/java/com/iluwatar/saga/choreography/OrderService.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@
2626
/**
2727
* Class representing a service to init a new order.
2828
*/
29-
public class OrderService extends Service{
29+
public class OrderService extends Service {
3030

31-
public OrderService(ServiceDiscoveryService service) {
32-
super(service);
33-
}
31+
public OrderService(ServiceDiscoveryService service) {
32+
super(service);
33+
}
3434

35-
@Override
36-
public String getName() {
37-
return "init an order";
38-
}
35+
@Override
36+
public String getName() {
37+
return "init an order";
38+
}
3939
}

0 commit comments

Comments
 (0)