Prior to this change, the contents of io.bisq.core.network were in fact
all seednode-related, and the main public type in this package,
DefaultSeedNodeRepository, is an implementation of
io.bisq.network.p2p.seed.SeedNodeRepository. This repackaging makes
better reflects these facts, making it more obvious to the unitiated
what this package is all about, and preserving the unqualified
io.bisq.core.network package for future expansion into non-seednode
related areas.
Public members of package-private classes are in effect still
package-private. Leaving the public modifier in place on these members
(as opposed to marking all members package-private) is beneficial for
two reasons:
1. It leaves these members looking "normal" to the trained Java eye.
Readers are not left wondering why constructors and methods are
package-private. They can notice, if and when appropriate, that the
class itself is package-private, and can understand the transitive
visibility of each member on that basis. Otherwise, the class is left
looking conventional, unsurprising, and therefore as easy as possible to
read and understand.
2. It leaves the visibility of these members controlled by a single
modifier at the class level as opposed to N+1 modifiers (one for every
member + the class itself). Should the class in question for some reason
need to be promoted to public visibility, for example if it were to be
moved to a different package, its members would automatically inherit
the now-public visibility of the class, which is likely to be the
desired state, because if the class needs to be public, at least some of
its members will need to be public too. The maintainer making that
change can (and should) reduce the visibility of any members that should
remain package-private (e.g. those that exist only for for testing
purposes), but in doing so, they make an explicit and self-documenting
decision that will show up at the level of a Git diff.
The original name was intended to distinguish that this implementation
is the implentation that lives within Bisq's 'core' module. This commit
renames the class to DefaultSeedNodeRepository as this is more idiomatic
and intention-revealing. This implementation is in fact the only one
ever gets used; it is the 'default' (and only) implementation.
The idiomatic approach to naming domain-driven design (DDD)-style
repositories is to use the singular form of the object being
encapsulated by the repository, e.g. BookRepository vs. BooksRepository.
Thus far, the repository interfaces and implementations created here in
Bisq have used the latter, plural form, but going forward we should
revert to the norm. To this end, this commit renames SeedNodesRepository
and its single implementation to SeedNodeRepository and
CoreSeedNodeRepository respectively.
NetworkStressTest has been ignored for months because it had become
"outdated" and is therefore now dead code. It is the only place that the
CoreSeedNodesRepository#setTorSeedNodeAddresses
and #setLocalhostSeedNodeAddresses methods were called. Removing it
completely allows for removing these methods and marking the underlying
fields in CoreSeedNodesRepository as final.