Class ODCConnectionTransport

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.sonatype.ossindex.service.client.transport.Transport

    public class ODCConnectionTransport
    extends java.lang.Object
    implements org.sonatype.ossindex.service.client.transport.Transport
    ODC connection transport is used instead of HttpUrlConnectionTransport because the proxy information is already configured.
    Author:
    Jeremy Long
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.sonatype.ossindex.service.client.transport.Transport

        org.sonatype.ossindex.service.client.transport.Transport.TransportException
    • Constructor Summary

      Constructors 
      Constructor Description
      ODCConnectionTransport​(org.sonatype.ossindex.service.client.OssindexClientConfiguration config, org.sonatype.ossindex.service.client.transport.UserAgentSupplier userAgent)
      Constructs a new transport object to connect to the OSS Index.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void init​(org.sonatype.ossindex.service.client.OssindexClientConfiguration configuration)  
      java.lang.String post​(java.net.URI url, java.lang.String payloadType, java.lang.String payload, java.lang.String acceptType)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ODCConnectionTransport

        public ODCConnectionTransport​(org.sonatype.ossindex.service.client.OssindexClientConfiguration config,
                                      org.sonatype.ossindex.service.client.transport.UserAgentSupplier userAgent)
        Constructs a new transport object to connect to the OSS Index.
        Parameters:
        config - the OSS client configuration
        userAgent - the user agent to send to OSS Index
    • Method Detail

      • init

        public void init​(org.sonatype.ossindex.service.client.OssindexClientConfiguration configuration)
        Specified by:
        init in interface org.sonatype.ossindex.service.client.transport.Transport
      • post

        public java.lang.String post​(java.net.URI url,
                                     java.lang.String payloadType,
                                     java.lang.String payload,
                                     java.lang.String acceptType)
                              throws org.sonatype.ossindex.service.client.transport.Transport.TransportException,
                                     java.io.IOException
        Specified by:
        post in interface org.sonatype.ossindex.service.client.transport.Transport
        Throws:
        org.sonatype.ossindex.service.client.transport.Transport.TransportException
        java.io.IOException
      • close

        public void close()
                   throws java.lang.Exception
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.lang.Exception