@ Override public IApiConnector createConnector ( ApiRequest req , Api api , RequiredAuthType authType , boolean hasDataPolicy , IConnectorConfig connectorConfig ) { return ( request , resultHandler ) -> { // Apply options from config as our base case ApimanHttpConnectorOptions httpOptions = new ApimanHttpConnectorOptions ( config ) . setHasDataPolicy ( hasDataPolicy ) . setRequiredAuthType ( authType ) . setTlsOptions ( tlsOptions ) . setUri ( parseApiEndpoint ( api ) ) . setSsl ( api . getEndpoint ( ) . toLowerCase ( ) . startsWith ( "https" ) ) ; //$NON-NLS-1$ // If API has endpoint properties indicating timeouts, then override config. setAttributesFromApiEndpointProperties ( api , httpOptions ) ; // Get from cache HttpClient client = clientFromCache ( httpOptions ) ; return new HttpConnector ( vertx , client , request , api , httpOptions , connectorConfig , resultHandler ) . connect ( ) ; } ; }
In the future we can switch to different back - end implementations here!