@@ -16,8 +16,10 @@ public class DiscoveryClientConfig implements AutoCloseable {
1616 final private String region ;
1717 final private int maxConnections ;
1818 final private HttpProxyOptions proxyOptions ;
19+ final private String ggServerName ;
1920
2021 /**
22+ * Constructor for DiscoveryClientConfig creates the correct endpoint if not in a special region
2123 *
2224 * @param bootstrap client bootstrap to use to establish network connections
2325 * @param tlsContextOptions tls configuration for client network connections. For greengrass discovery, the
@@ -41,6 +43,35 @@ public DiscoveryClientConfig(
4143 this .region = region ;
4244 this .maxConnections = maxConnections ;
4345 this .proxyOptions = proxyOptions ;
46+ this .ggServerName = "" ;
47+ }
48+
49+ /**
50+ * Default Constructor for DiscoveryClientConfig that allows the specification of a specific ggServerName to use in special regions
51+ *
52+ * @param bootstrap client bootstrap to use to establish network connections
53+ * @param tlsContextOptions tls configuration for client network connections. For greengrass discovery, the
54+ * tls context must be initialized with the certificate and private key of the
55+ * device/thing that is querying greengrass core availability.
56+ * @param socketOptions socket configuration for client network connections
57+ * @param maxConnections maximum concurrent http connections within the client
58+ * @param proxyOptions proxy configuration for client network connections
59+ * @param ggServerName full endpoint to use when connecting in special regions
60+ */
61+ public DiscoveryClientConfig (
62+ final ClientBootstrap bootstrap ,
63+ final TlsContextOptions tlsContextOptions ,
64+ final SocketOptions socketOptions ,
65+ final int maxConnections ,
66+ final HttpProxyOptions proxyOptions ,
67+ final String ggServerName ) {
68+ this .bootstrap = bootstrap ;
69+ this .tlsContext = new TlsContext (tlsContextOptions );
70+ this .socketOptions = socketOptions ;
71+ this .region = "" ;
72+ this .maxConnections = maxConnections ;
73+ this .proxyOptions = proxyOptions ;
74+ this .ggServerName = ggServerName ;
4475 }
4576
4677 /**
@@ -85,6 +116,10 @@ public HttpProxyOptions getProxyOptions() {
85116 return proxyOptions ;
86117 }
87118
119+ public String getGGServerName () {
120+ return ggServerName ;
121+ }
122+
88123 @ Override
89124 public void close () {
90125 if (tlsContext != null ) {
0 commit comments