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 Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract String
    fetch(org.apache.maven.search.SearchRequest searchRequest, String serviceUri)
    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.
    protected String
    Exposes this backend version, for example to be used in HTTP User-Agent string, never null.
    protected String
    Exposes full HTTP User-Agent string ready to be used by HTTP clients, never null.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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(org.apache.maven.search.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