Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
SANE (Public)
drasyl
Commits
6b5b12d4
Commit
6b5b12d4
authored
Oct 26, 2020
by
bornholdt
Browse files
Fix some code smells
parent
59025e1d
Pipeline
#40918
passed with stages
in 5 minutes and 31 seconds
Changes
8
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
drasyl-core/src/main/java/org/drasyl/peer/connection/message/AbstractMessage.java
View file @
6b5b12d4
...
...
@@ -62,15 +62,6 @@ abstract class AbstractMessage implements Message {
this
.
hopCount
=
hopCount
;
}
protected
AbstractMessage
(
final
MessageId
id
,
final
String
userAgent
,
final
int
networkId
,
final
CompressedPublicKey
sender
,
final
ProofOfWork
proofOfWork
,
final
CompressedPublicKey
recipient
)
{
this
(
id
,
userAgent
,
networkId
,
sender
,
proofOfWork
,
recipient
,
(
short
)
0
);
}
protected
AbstractMessage
(
final
int
networkId
,
final
CompressedPublicKey
sender
,
final
ProofOfWork
proofOfWork
,
...
...
@@ -86,12 +77,12 @@ abstract class AbstractMessage implements Message {
this
(
networkId
,
sender
,
proofOfWork
,
recipient
,
(
short
)
0
);
}
p
ublic
AbstractMessage
(
final
MessageId
id
,
final
int
networkId
,
final
CompressedPublicKey
sender
,
final
ProofOfWork
proofOfWork
,
final
CompressedPublicKey
recipient
,
final
short
hopCount
)
{
p
rotected
AbstractMessage
(
final
MessageId
id
,
final
int
networkId
,
final
CompressedPublicKey
sender
,
final
ProofOfWork
proofOfWork
,
final
CompressedPublicKey
recipient
,
final
short
hopCount
)
{
this
(
id
,
userAgentGenerator
.
get
(),
networkId
,
sender
,
proofOfWork
,
recipient
,
hopCount
);
}
...
...
drasyl-core/src/main/java/org/drasyl/peer/connection/message/AbstractResponseMessage.java
View file @
6b5b12d4
...
...
@@ -28,35 +28,24 @@ import static java.util.Objects.requireNonNull;
abstract
class
AbstractResponseMessage
<
R
extends
RequestMessage
>
extends
AbstractMessage
implements
ResponseMessage
<
R
>
{
protected
final
MessageId
correspondingId
;
protected
AbstractResponseMessage
(
final
MessageId
id
,
final
String
userAgent
,
final
int
networkId
,
protected
AbstractResponseMessage
(
final
int
networkId
,
final
CompressedPublicKey
sender
,
final
ProofOfWork
proofOfWork
,
final
CompressedPublicKey
recipient
,
final
MessageId
correspondingId
)
{
super
(
id
,
userAgent
,
networkId
,
sender
,
proofOfWork
,
recipient
);
super
(
networkId
,
sender
,
proofOfWork
,
recipient
);
this
.
correspondingId
=
requireNonNull
(
correspondingId
);
}
protected
AbstractResponseMessage
(
final
int
networkId
,
@SuppressWarnings
({
"java:S107"
})
protected
AbstractResponseMessage
(
final
MessageId
id
,
final
String
userAgent
,
final
int
networkId
,
final
CompressedPublicKey
sender
,
final
ProofOfWork
proofOfWork
,
final
CompressedPublicKey
recipient
,
final
short
hopCount
,
final
MessageId
correspondingId
)
{
super
(
networkId
,
sender
,
proofOfWork
,
recipient
);
this
.
correspondingId
=
requireNonNull
(
correspondingId
);
}
@SuppressWarnings
({
"java:S107"
})
public
AbstractResponseMessage
(
final
MessageId
id
,
final
String
userAgent
,
final
int
networkId
,
final
CompressedPublicKey
sender
,
final
ProofOfWork
proofOfWork
,
final
CompressedPublicKey
recipient
,
final
short
hopCount
,
final
MessageId
correspondingId
)
{
super
(
id
,
userAgent
,
networkId
,
sender
,
proofOfWork
,
recipient
,
hopCount
);
this
.
correspondingId
=
requireNonNull
(
correspondingId
);
}
...
...
drasyl-core/src/main/java/org/drasyl/peer/connection/message/RelayableMessage.java
deleted
100644 → 0
View file @
59025e1d
/*
* Copyright (c) 2020.
*
* This file is part of drasyl.
*
* drasyl is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* drasyl is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with drasyl. If not, see <http://www.gnu.org/licenses/>.
*/
package
org.drasyl.peer.connection.message
;
public
interface
RelayableMessage
extends
Message
{
}
\ No newline at end of file
drasyl-core/src/main/java/org/drasyl/pipeline/AbstractEndHandler.java
View file @
6b5b12d4
...
...
@@ -32,13 +32,13 @@ import java.util.concurrent.CompletableFuture;
*/
@SuppressWarnings
({
"common-java:DuplicatedBlocks"
})
abstract
class
AbstractEndHandler
extends
AbstractHandlerContext
implements
Handler
{
p
ublic
AbstractEndHandler
(
final
String
name
,
final
DrasylConfig
config
,
final
Pipeline
pipeline
,
final
Scheduler
scheduler
,
final
Identity
identity
,
final
TypeValidator
inboundValidator
,
final
TypeValidator
outboundValidator
)
{
p
rotected
AbstractEndHandler
(
final
String
name
,
final
DrasylConfig
config
,
final
Pipeline
pipeline
,
final
Scheduler
scheduler
,
final
Identity
identity
,
final
TypeValidator
inboundValidator
,
final
TypeValidator
outboundValidator
)
{
super
(
name
,
config
,
pipeline
,
scheduler
,
identity
,
inboundValidator
,
outboundValidator
);
}
...
...
drasyl-core/src/main/java/org/drasyl/pipeline/AbstractHandlerContext.java
View file @
6b5b12d4
...
...
@@ -44,13 +44,13 @@ abstract class AbstractHandlerContext implements HandlerContext {
private
volatile
AbstractHandlerContext
prev
;
private
volatile
AbstractHandlerContext
next
;
p
ublic
AbstractHandlerContext
(
final
String
name
,
final
DrasylConfig
config
,
final
Pipeline
pipeline
,
final
Scheduler
scheduler
,
final
Identity
identity
,
final
TypeValidator
inboundValidator
,
final
TypeValidator
outboundValidator
)
{
p
rotected
AbstractHandlerContext
(
final
String
name
,
final
DrasylConfig
config
,
final
Pipeline
pipeline
,
final
Scheduler
scheduler
,
final
Identity
identity
,
final
TypeValidator
inboundValidator
,
final
TypeValidator
outboundValidator
)
{
this
(
null
,
null
,
name
,
config
,
pipeline
,
scheduler
,
identity
,
inboundValidator
,
outboundValidator
);
}
...
...
drasyl-core/src/main/resources/reference.conf
View file @
6b5b12d4
...
...
@@ -5,7 +5,7 @@ drasyl {
# to other nodes and form a private network. If you’re planning to create your own network on the
# Internet, it’s best to choose a network ID that isn’t already used.
# Note: Make sure that the configured Super Peers use the same network ID.
network
.
id
=
1
network
.
id
=
-
2542
1
# Each node has a unique identity. It is composed of a public-private key pair. The address
# of the node is derived from the public key. In a future release, messages will be signed
...
...
@@ -110,7 +110,7 @@ drasyl {
# List of endpoints that are used to connect to a Super Peer. Entries at the beginning of
# the list are first tried.
# Note: Make sure that the configured Super Peers use the same network ID as this node.
endpoints
= [
"wss://
production
.env.drasyl.org#0
25fff6f625f5dee816d9f8fe43895479aecfda187cb6a3330894a07e698bc5bd8
"
]
endpoints
= [
"wss://
staging
.env.drasyl.org#0
3096ae3080a369829a44847d5af1f652bef3f9921e9e1bbad64970babe6d3c502
"
]
# If the connection to the super peer is lost, a new connection is attempted after a some
# time. Here you can specify a list with the desired delays, which the node will wait before
...
...
@@ -226,7 +226,7 @@ drasyl {
# Every outgoing message starts with the value defined here. Each node decreases the
# message's hop-limit value before routing it to the next node. If the hop-limit value reaches
# zero before the message arrives at its destination, then the message is discarded.
hop
-
limit
=
64
hop
-
limit
=
8
}
# Size of the TCP Flush Buffer. Is used to minimize IO overhead.
...
...
drasyl-plugin-groups-client/src/main/java/org/drasyl/plugin/groups/client/event/GroupMemberActionEvent.java
View file @
6b5b12d4
...
...
@@ -7,12 +7,12 @@
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* drasyl is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with drasyl. If not, see <http://www.gnu.org/licenses/>.
*/
...
...
@@ -27,8 +27,8 @@ abstract class GroupMemberActionEvent implements GroupEvent {
protected
final
CompressedPublicKey
member
;
protected
final
Group
group
;
p
ublic
GroupMemberActionEvent
(
final
CompressedPublicKey
member
,
final
Group
group
)
{
p
rotected
GroupMemberActionEvent
(
final
CompressedPublicKey
member
,
final
Group
group
)
{
this
.
member
=
member
;
this
.
group
=
group
;
}
...
...
drasyl-plugin-groups-client/src/main/java/org/drasyl/plugin/groups/client/message/MemberActionMessage.java
View file @
6b5b12d4
...
...
@@ -29,9 +29,8 @@ import static java.util.Objects.requireNonNull;
abstract
class
MemberActionMessage
extends
GroupActionMessage
{
protected
final
CompressedPublicKey
member
;
public
MemberActionMessage
(
@JsonProperty
(
"member"
)
final
CompressedPublicKey
member
,
@JsonProperty
(
"group"
)
final
Group
group
)
{
protected
MemberActionMessage
(
@JsonProperty
(
"member"
)
final
CompressedPublicKey
member
,
@JsonProperty
(
"group"
)
final
Group
group
)
{
super
(
group
);
this
.
member
=
requireNonNull
(
member
);
}
...
...
bornholdt
@bornholdt
mentioned in commit
ff0e16ce
·
Oct 26, 2020
mentioned in commit
ff0e16ce
mentioned in commit ff0e16ce8ca6e3bfa080b0b6bdacd49bbeb7a465
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment