1818import com .mx .path .gateway .connect .filter .UpstreamRequestEventFilter ;
1919import com .mx .path .gateway .connect .filter .UpstreamRequestProcessorFilter ;
2020
21+ /**
22+ * Builds connections for gateway objects.
23+ */
2124public class ConnectionBinder {
25+
26+ /**
27+ * Build new connection instance.
28+ *
29+ * @param klass class type of connection.
30+ * @param map connections configuration map.
31+ * @param connectionName connection name.
32+ * @return new instance of connection.
33+ * @param <T> generic class type.
34+ */
2235 public static <T > Object build (Class <T > klass , ObjectMap map , String connectionName ) {
2336 ConfigurationState state = ConfigurationState .getCurrent ();
2437 AtomicReference <ConnectionConstructionContext > builderRef = new AtomicReference <>();
@@ -35,6 +48,13 @@ public static <T> Object build(Class<T> klass, ObjectMap map, String connectionN
3548 return builder .build ();
3649 }
3750
51+ /**
52+ * Helper function to build new AccessorConnectionSettings for given connection.
53+ *
54+ * @param map connection configuration object map.
55+ * @param connectionName connection name.
56+ * @return new AccessorConnectionSettings instance.
57+ */
3858 public static AccessorConnectionSettings buildConnection (ObjectMap map , String connectionName ) {
3959 AccessorConnectionSettings .AccessorConnectionSettingsBuilder connection = AccessorConnectionSettings .builder ();
4060 connection .baseUrl (map .getMap (connectionName ).getAsString ("baseUrl" ));
@@ -66,6 +86,11 @@ public static AccessorConnectionSettings buildConnection(ObjectMap map, String c
6686 return instance ;
6787 }
6888
89+ /**
90+ * Validate AccessorConnectionSettings object.
91+ *
92+ * @param connection object to be validated.
93+ */
6994 private static void validate (AccessorConnectionSettings connection ) {
7095 String keystorePassword = "" ;
7196 if (connection .getKeystorePassword () != null ) {
0 commit comments