Class SmoSearchTransportSupport

java.lang.Object
org.apache.maven.search.backend.smo.internal.SmoSearchTransportSupport
Direct Known Subclasses:
UrlConnectionSmoSearchTransport

public abstract class SmoSearchTransportSupport extends Object
A trivial "transport abstraction" to make possible pluggable implementations.
  • Constructor Details

    • SmoSearchTransportSupport

      public SmoSearchTransportSupport()
  • Method Details

    • getClientVersion

      protected String getClientVersion()
      Exposes this backend version, for example to be used in HTTP User-Agent string, never null.
    • getUserAgent

      protected String getUserAgent()
      Exposes full HTTP User-Agent string ready to be used by HTTP clients, never null.
    • fetch

      public abstract String fetch(SearchRequest searchRequest, String serviceUri) throws IOException
      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".
      Throws:
      IOException