Class UrlConnectionSmoSearchTransport

java.lang.Object
org.apache.maven.search.backend.smo.internal.UrlConnectionSmoSearchTransport
All Implemented Interfaces:
SmoSearchTransport

public class UrlConnectionSmoSearchTransport extends Object implements SmoSearchTransport
HttpURLConnection backed transport.
  • Constructor Details

    • UrlConnectionSmoSearchTransport

      public UrlConnectionSmoSearchTransport()
  • Method Details

    • fetch

      public String fetch(String serviceUri, Map<String,String> headers) throws IOException
      Description copied from interface: SmoSearchTransport
      This method should issue a HTTP GET requests using serviceUri and return body payload as String ONLY if the response was HTTP 200 Ok and there was a payload returned by service. In any other case, it should throw, never return null. The payload is expected to be application/json, so client may add headers to request. Also, the payload is expected to be "relatively small" that may be enforced.
      Specified by:
      fetch in interface SmoSearchTransport
      Throws:
      IOException