Skip to content
This repository was archived by the owner on Jan 29, 2021. It is now read-only.

Commit 31b8b59

Browse files
authored
Merge pull request #72 from bbenno/release/v1.0.0
Release/v1.0.0
2 parents 545d6f5 + db1e1f1 commit 31b8b59

34 files changed

+827
-50
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
HELP.md
21
target/
32
!.mvn/wrapper/maven-wrapper.jar
43
!**/src/main/**/target/
54
!**/src/test/**/target/
65

76
### Doc ###
87
src/doc/*.png
8+
src/doc/*.pdf
99

1010
### STS ###
1111
.apt_generated
@@ -31,3 +31,5 @@ build/
3131
*.iml
3232

3333
/out/
34+
35+
*.cache

README.adoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,13 @@ mvn install:install-file -Dfile=lib/com.othr.swvigopay-0.0.1SNAPSHOT.jar -Dgroup
4343
. Start webserverfootnote:[See sample link:src/production-run.sh[run script]] +
4444
[source, bash]
4545
java -jar chat-<VERSION>.jar >> console.log 2>> error.log &
46+
. Ensure that there are at least two bots with the usernames `payment_service` and `bank_service` present in the database. +
47+
If not run link:src/main/resources/import.sql[import.sql] within the context of the database.
48+
49+
== License
50+
51+
Copyright 2021 Benno Bielmeier
52+
53+
Code licensed under the EUPL v1.2 License: https://opensource.org/licenses/EUPL-1.2
54+
55+
Graphics from https://github.com/twitter/twemoji/ licensed under CC-BY 4.0: https://creativecommons.org/licenses/by/4.0/

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<!-- The Basics -->
88
<groupId>de.othr.bib48218</groupId>
99
<artifactId>chat</artifactId>
10-
<version>0.7.0-SNAPSHOT</version>
10+
<version>1.0.0</version>
1111
<packaging>jar</packaging>
1212
<dependencies>
1313
<dependency>

src/doc/milestone-2.adoc

Lines changed: 66 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,30 @@
1-
= Milestone 2: Requirements
1+
= Milestone 2
22
Benno Bielmeier <benno.bielmeier@st.oth-regensburg.de>
3+
2021-01-28
34
:lang: en
45
:icons: font
6+
:toc:
7+
8+
== About
9+
10+
.About the project
11+
. The project is available on https://github.com/bbenno/oth-sw[GitHub] under EUPL v1.2 License. +
12+
image:https://img.shields.io/github/commit-activity/w/bbenno/oth-sw[GitHub commit activity]
13+
image:https://img.shields.io/github/commits-since/bbenno/oth-sw/milestone-1[GitHub commits since tagged version (branch)]
14+
image:https://img.shields.io/github/languages/code-size/bbenno/oth-sw[GitHub code size in bytes]
15+
image:https://img.shields.io/github/repo-size/bbenno/oth-sw[GitHub repo size]
16+
image:https://img.shields.io/github/languages/top/bbenno/oth-sw[GitHub top language]
17+
image:https://img.shields.io/github/downloads/bbenno/oth-sw/total[GitHub all releases]
18+
image:https://img.shields.io/github/stars/bbenno/oth-sw?style=social[GitHub Repo stars]
19+
. The Project was developed using the "`GitFlow" process.
20+
21+
.About the application
22+
. A continuous integration workflow was designed and realized. +
23+
-> link:../../.github/workflows/[see GitHub workflows]
24+
. The application is localized for German and English.
25+
The user can change the displaying language by appending `?lang=de` for German or `?lang=en` for English to URL.
26+
27+
== Requirements
528

629
[NOTE]
730
====
@@ -20,13 +43,13 @@ _MAY_ be separated by different deployment components
2043
* [x] Application _MUST_ contain at least one custom producer method for bean creation.
2144
This method _MUST_ be used. +
2245
__-> e.g. injected `HttpHeaders` provided by producer methods in link:../main/java/de/othr/bib48218/chat/integration/PartnerServiceConfig.java[`PartnerServiceConfiguration`] that are used in link:../main/java/de/othr/bib48218/chat/rest/[REST controllers]__
23-
* [ ] Each CDI bean _MUST_ have an appropriate scope.
46+
* [x] Each CDI bean _MUST_ have an appropriate scope.
2447

2548
.Persistence
2649
* [x] Database access _MUST_ only be done via spring persistence (entities and repositories). +
2750
__-> only exception: insertion of required service bot users after database creation in link:../main/resources/import.sql[`import.sql`]__
2851
* [x] It _MUST NOT_ access a database directly via JDBC and native SQL.
29-
* [ ] Embeddables _SHOULD_ be used.
52+
* [x] Embeddables _SHOULD_ be used.
3053
* [x] Cascading _SHOULD_ be used at least once.
3154
Purpose _MUST_ be understood. +
3255
__-> e.g. in link:../main/java/de/othr/bib48218/chat/entity/User.java[`User`] class__
@@ -79,3 +102,43 @@ The inclusion of foreign code _MUST NOT_ fulfill essential requirements of the a
79102
* [x] Additional dependencies _MAY_ be used.
80103
If so, they _MUST_ be imported via Maven. +
81104
__-> see link:../../pom.xml[`pom.xml`]__
105+
106+
== Changes since last milestone
107+
108+
Following the change since milestone 1 are highlighted.
109+
[green]#Green# means it was _initially not planed but realized_.
110+
[red]#Red# means it was _initially planed but not realized_ due to certain reasons.
111+
112+
=== Use Case
113+
114+
.Changes
115+
. [[as, service credentials are obsolete]]
116+
Usecase "`Store foreign service account credentials`" is obsolete.
117+
Initially it was meant that the user allows the service/application to do some actions in his name by putting some credentials in his private profile.
118+
As the partner services authenticates the service/application as a whole the "`allowance`" at user level does not make sense anymore.
119+
. Change usecase "`Change group membership of user`" to usecase "`Add a new member to group chat`".
120+
. Add a member of class `ServiceType` to User
121+
122+
plantuml::uml-usecase_v2.puml[png]
123+
124+
=== Domain
125+
126+
.Changes
127+
. Remove obsolete class `ServiceCredentials`. (see <<as>>)
128+
. Add member of class `ServiceType` to class `User`.
129+
The partner service using this service/application is injecting some of his users.
130+
In order to be able to separate the different user bases each user has a service type to which he belongs.
131+
132+
plantuml::uml-domain_v2.puml[png]
133+
134+
=== Component
135+
136+
.Changes
137+
* -> See notes in the diagram.
138+
139+
plantuml::uml-component_v2.puml[png]
140+
141+
:leveloffset: +1
142+
143+
[%hardbreaks]
144+
include::uml-usecase-description_v2_delta.adoc[]

src/doc/uml-component_v2.puml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
@startuml chat-component
2+
allow_mixing
3+
hide circle
4+
5+
skinparam component {
6+
BorderColor black
7+
BackgroundColor white
8+
ArrowColor black
9+
}
10+
11+
skinparam interface {
12+
BorderColor black
13+
BackgroundColor lightgray
14+
}
15+
16+
' Presentation Layer
17+
package "Presentation" {
18+
component ChatApp
19+
}
20+
21+
' Business (Logic) Layer
22+
package "Business" {
23+
component UserService
24+
component ChatService
25+
component MessageService
26+
() IFUserService
27+
() IFChatService
28+
() IFMessageService
29+
UserService -up- IFUserService
30+
ChatService -up- IFChatService
31+
MessageService -up- IFMessageService
32+
33+
' Provided interface
34+
() "IFSendMessage" as IFSendMessageLolli
35+
MessageService -up- IFSendMessageLolli
36+
}
37+
38+
' Partner service Webshop (initially planed to use)
39+
component WebshopOrderService <<partner service>> #red
40+
() IFOrderServiceExtern #red
41+
WebshopOrderService -up- IFOrderServiceExtern #red
42+
MessageService -up-( IFOrderServiceExtern #red
43+
44+
' Partner service payment
45+
component PaymentTransferService <<partner service>> #green
46+
() TransferServiceExternalIF #green
47+
PaymentTransferService -up- TransferServiceExternalIF #green
48+
MessageService -up-( TransferServiceExternalIF #green
49+
50+
' Partner service bank
51+
component BankSupportService <<partner service>>
52+
BankSupportService --( IFSendMessageLolli
53+
54+
' Persistence Layer
55+
package "Persistence" {
56+
component UserRepository
57+
component ChatRepository
58+
component MessageRepository
59+
() IFPersonRepository
60+
() IFBotRepository
61+
() IFPeerChatRepository
62+
() IFGroupChatRepository
63+
() IFMessageRepository
64+
UserRepository -up- IFPersonRepository
65+
UserRepository -up- IFBotRepository
66+
ChatRepository -up- IFPeerChatRepository
67+
ChatRepository -up- IFGroupChatRepository
68+
MessageRepository -up- IFMessageRepository
69+
}
70+
71+
interface IFSendMessage <<interface>> {
72+
getUser(username : String) : User
73+
getChatWithUserByUsername(username : String) : Chat
74+
sendMessage(message : Message) : Boolean
75+
pullMessages(chat : Chat, dateTime : LocalDateTime) : List<Message>
76+
}
77+
78+
IFSendMessageLolli .up. IFSendMessage
79+
80+
' Connect presentation layer to business layer
81+
ChatApp .down.( IFUserService
82+
ChatApp .down.( IFChatService
83+
ChatApp .down.( IFMessageService
84+
85+
' Connect business layer to persistence layer
86+
UserService .down.( IFPersonRepository
87+
UserService .down.( IFBotRepository
88+
ChatService .down.( IFPeerChatRepository
89+
ChatService .down.( IFGroupChatRepository
90+
MessageService .down.( IFMessageRepository
91+
92+
@enduml

src/doc/uml-domain_v2.puml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
@startuml chat-domain
2+
3+
skinparam class {
4+
BorderColor black
5+
BackgroundColor white
6+
ArrowColor black
7+
}
8+
9+
' classes in alphabetical order
10+
class Attachment <<Embeddable>> {
11+
size : int
12+
name : String
13+
mimeType : String
14+
}
15+
16+
abstract class Chat
17+
18+
class ChatMembership
19+
20+
enum ChatMemberStatus <<enumeration>> {
21+
Administrator
22+
Member
23+
Restricted
24+
Left
25+
Kicked
26+
}
27+
28+
class ChatProfile {
29+
description : String
30+
}
31+
32+
class GroupChat
33+
34+
enum GroupVisibility <<enumeration>> {
35+
Private
36+
Public
37+
}
38+
39+
class Message {
40+
text : String
41+
timestamp : Datetime
42+
}
43+
44+
class Person {
45+
firstName : String
46+
lastName : String
47+
email : String
48+
}
49+
50+
class PeerChat
51+
52+
abstract class Profile {
53+
name : String
54+
photo : Image
55+
}
56+
57+
class ServiceCredentials #red {
58+
loginToken : String
59+
}
60+
61+
enum ServiceType <<enumeration>> {
62+
Chat
63+
Webshop
64+
Bank
65+
Payment
66+
}
67+
68+
abstract class User {
69+
username : String
70+
password : String
71+
}
72+
73+
class UserProfile {
74+
bio : String
75+
country : String
76+
}
77+
78+
' Inheritance
79+
'' Profile
80+
Profile <|-up- ChatProfile
81+
Profile <|-left- UserProfile
82+
'' Chat inheritance
83+
Chat <|-- PeerChat
84+
Chat <|-- GroupChat
85+
86+
'' Person inheritance
87+
User <|-- Person
88+
User <|-- Bot
89+
90+
' Relations
91+
'' to Chat
92+
ChatMembership "0..*" --> "1\nuser" User
93+
ChatMembership "0..*" -up-> "1\nchat" Chat
94+
95+
'' to Message
96+
Message "0..*" --> "1\nauthor" User
97+
Chat "1" --> "0..*\nmessages" Message
98+
Message "1" --> "0..1\nattachment" Attachment
99+
Message "0..*" --> "0..1\nreplyOf" Message
100+
101+
'' with Enumerations
102+
ServiceCredentials "0..*" .up.> "1\nserviceType" ServiceType #red
103+
User "0..*" .> "1\nserviceType" ServiceType #green
104+
ChatMembership "0..*" .up.> "1\nstatus" ChatMemberStatus
105+
GroupChat "0..*" ..> "1\nvisibility" GroupVisibility
106+
107+
'' Misc
108+
Person "1" -up-> "0..*\ncredentials" ServiceCredentials #red
109+
User "1" --> "1\nprofile" UserProfile
110+
GroupChat "1" --> "1\nprofile" ChatProfile
111+
112+
note bottom of Profile: public accessible information
113+
note bottom of ServiceCredentials: login credentials to authenticate to partner service
114+
note top of PeerChat: peer-to-peer chat between two users
115+
@enduml

0 commit comments

Comments
 (0)