Class ODCConnectionTransport

java.lang.Object
org.owasp.dependencycheck.data.ossindex.ODCConnectionTransport
All Implemented Interfaces:
AutoCloseable, org.sonatype.ossindex.service.client.transport.Transport

public class ODCConnectionTransport extends 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

    Modifier and Type
    Method
    Description
    void
     
    void
    init(org.sonatype.ossindex.service.client.OssindexClientConfiguration configuration)
     
    post(URI url, String payloadType, String payload, String acceptType)
     

    Methods inherited from class Object

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

    • 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 Details

    • 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 String post(URI url, String payloadType, String payload, String acceptType) throws org.sonatype.ossindex.service.client.transport.Transport.TransportException, IOException
      Specified by:
      post in interface org.sonatype.ossindex.service.client.transport.Transport
      Throws:
      org.sonatype.ossindex.service.client.transport.Transport.TransportException
      IOException
    • close

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