|
39 | 39 | import java.io.DataInputStream;
|
40 | 40 | import java.io.DataOutputStream;
|
41 | 41 | import java.io.IOException;
|
| 42 | +import java.net.InetSocketAddress; |
42 | 43 | import java.net.URI;
|
43 | 44 | import java.net.UnknownHostException;
|
44 | 45 | import java.util.Arrays;
|
@@ -681,15 +682,6 @@ private String startConnector(String remoteDomain, CoreDomainInfo domainInfo)
|
681 | 682 | throws ExecutionException, InterruptedException, BadConfigException {
|
682 | 683 | checkArgument(args.hasOption("mode"), "No mode specified to run connector");
|
683 | 684 |
|
684 |
| - String cellName = "c-" + remoteDomain + '*'; |
685 |
| - String clientKey = args.getOpt("clientKey"); |
686 |
| - clientKey = |
687 |
| - (clientKey != null) && (!clientKey.isEmpty()) ? ("-clientKey=" + clientKey) : ""; |
688 |
| - String clientName = args.getOpt("clientUserName"); |
689 |
| - clientName = |
690 |
| - (clientName != null) && (!clientName.isEmpty()) ? ("-clientUserName=" + clientName) |
691 |
| - : ""; |
692 |
| - |
693 | 685 | HostAndPort where;
|
694 | 686 | SocketFactory socketFactory;
|
695 | 687 | Mode mode = Mode.fromString(args.getOption("mode"));
|
@@ -724,16 +716,10 @@ private String startConnector(String remoteDomain, CoreDomainInfo domainInfo)
|
724 | 716 | "Invalid mode to start connector: " + args.getOption("mode"));
|
725 | 717 | }
|
726 | 718 |
|
727 |
| - String cellArgs = "-domain=" + remoteDomain + ' ' |
728 |
| - + "-lm=" + getCellName() + ' ' |
729 |
| - + "-role=" + role + ' ' |
730 |
| - + "-where=" + where + ' ' |
731 |
| - + clientKey + ' ' |
732 |
| - + clientName; |
733 |
| - |
734 |
| - LOGGER.info("Starting connector with {}", cellArgs); |
735 |
| - LocationManagerConnector c = new LocationManagerConnector(cellName, cellArgs, |
736 |
| - socketFactory); |
| 719 | + String cellName = "c-" + remoteDomain + '*'; |
| 720 | + LOGGER.info("Starting connector {} to {} ({})", cellName, remoteDomain, where); |
| 721 | + InetSocketAddress tunnelEndpoint = new InetSocketAddress(where.getHost(), where.getPort()); |
| 722 | + LocationManagerConnector c = new LocationManagerConnector(cellName, socketFactory, remoteDomain, tunnelEndpoint); |
737 | 723 | c.start().get();
|
738 | 724 | return c.getCellName();
|
739 | 725 | }
|
|
0 commit comments