Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove String[] args from network service class constructors #31

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public DefaultServiceProvider(ApplicationOptions applicationOptions, String[] ar
keyPairService = new KeyPairService(keyPairRepositoryConf);

NetworkService.Config networkServiceConfig = NetworkServiceConfigFactory.getConfig(applicationOptions.baseDir(),
getConfig("misq.networkServiceConfig"), args);
getConfig("misq.networkServiceConfig"));
networkService = new NetworkService(networkServiceConfig, keyPairService);

identityService = new IdentityService(networkService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ public class NetworkNodeServiceProvider extends ServiceProvider {
private final NetworkService networkService;
private final ApplicationOptions applicationOptions;

public NetworkNodeServiceProvider(ApplicationOptions applicationOptions, String[] args) {
public NetworkNodeServiceProvider(ApplicationOptions applicationOptions) {
super("Seed");
this.applicationOptions = applicationOptions;

KeyPairService.Conf keyPairRepositoryConf = KeyPairRepositoryConfigFactory.getConfig(applicationOptions.baseDir());
keyPairService = new KeyPairService(keyPairRepositoryConf);

NetworkService.Config networkServiceConfig = NetworkServiceConfigFactory.getConfig(applicationOptions.baseDir(),
getConfig("misq.networkServiceConfig"), args);
getConfig("misq.networkServiceConfig"));
networkService = new NetworkService(networkServiceConfig, keyPairService);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,8 @@
*/
@Slf4j
public class NetworkServiceConfigFactory {
public static NetworkService.Config getConfig(String baseDir, Config typesafeConfig) {
return getConfig(baseDir, typesafeConfig, Optional.empty());
}

public static NetworkService.Config getConfig(String baseDir, Config typesafeConfig, String[] args) {
return getConfig(baseDir, typesafeConfig, Optional.of(args));
}

private static NetworkService.Config getConfig(String baseDir, Config typesafeConfig, Optional<String[]> args) {
public static NetworkService.Config getConfig(String baseDir, Config typesafeConfig) {
// Set<Transport.Type> supportedTransportTypes = Set.of(Transport.Type.CLEAR, Transport.Type.TOR, Transport.Type.I2P);
Set<Transport.Type> supportedTransportTypes = Set.of(Transport.Type.CLEAR, Transport.Type.TOR);
// Set<Transport.Type> supportedTransportTypes = Set.of(Transport.Type.CLEAR);
Expand Down