Class FullContact

java.lang.Object
com.fullcontact.apilib.enrich.FullContact
All Implemented Interfaces:
java.lang.AutoCloseable

public class FullContact
extends java.lang.Object
implements java.lang.AutoCloseable
The FullContact class represents FullContact client. It supports V3 Person Enrich, Company Enrich and Company Search. It uses in-built HttpClient for sending all requests. All requests are converted to JSON and sent via POST method asynchronously
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  FullContact.FullContactBuilder
    Builder class for building FullContact client.
  • Constructor Summary

    Constructors 
    Constructor Description
    FullContact​(com.fullcontact.apilib.auth.CredentialsProvider credentialsProvider, java.lang.String userAgent, java.util.Map<java.lang.String,​java.lang.String> headers, long connectTimeoutMillis, int retryAttempts, int retryDelayMillis)
    FullContact client constructor used to initialise the client
  • Method Summary

    Modifier and Type Method Description
    static com.fullcontact.apilib.models.Request.CompanyRequest.CompanyRequestBuilder buildCompanyRequest()  
    static com.fullcontact.apilib.models.Request.PersonRequest.PersonRequestBuilder buildPersonRequest()  
    void close()
    This method is used to call shutdown on the ScheduledThreadPoolExecutor and close the FullContact client.
    java.util.concurrent.CompletableFuture<com.fullcontact.apilib.models.Response.CompanyResponse> enrich​(com.fullcontact.apilib.models.Request.CompanyRequest companyRequest)
    Method for Company Enrich.
    java.util.concurrent.CompletableFuture<com.fullcontact.apilib.models.Response.PersonResponse> enrich​(com.fullcontact.apilib.models.Request.PersonRequest personRequest)
    Method for Person Enrich.
    void finalize()
    This method will be called by GC to close the client.
    java.util.concurrent.CompletableFuture<com.fullcontact.apilib.models.Response.CompanySearchResponseList> search​(com.fullcontact.apilib.models.Request.CompanyRequest companyRequest)
    Method for Company Search.

    Methods inherited from class java.lang.Object

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

    • FullContact

      public FullContact​(com.fullcontact.apilib.auth.CredentialsProvider credentialsProvider, java.lang.String userAgent, java.util.Map<java.lang.String,​java.lang.String> headers, long connectTimeoutMillis, int retryAttempts, int retryDelayMillis)
      FullContact client constructor used to initialise the client
      Parameters:
      credentialsProvider - for auth
      headers - custom client headers
      userAgent - client UserAgent
      connectTimeoutMillis - connection timout for all requests
      retryAttempts - number of retry attempts allowed
      retryDelayMillis - delay time for each retry
  • Method Details

    • buildPersonRequest

      public static com.fullcontact.apilib.models.Request.PersonRequest.PersonRequestBuilder buildPersonRequest()
      Returns:
      Person Request Builder for Person Enrich request
    • buildCompanyRequest

      public static com.fullcontact.apilib.models.Request.CompanyRequest.CompanyRequestBuilder buildCompanyRequest()
      Returns:
      Company Request Builder for Company Enrich and Company Search requests
    • enrich

      public java.util.concurrent.CompletableFuture<com.fullcontact.apilib.models.Response.PersonResponse> enrich​(com.fullcontact.apilib.models.Request.PersonRequest personRequest) throws com.fullcontact.apilib.FullContactException
      Method for Person Enrich. It converts the request to json, send the Asynchronous request using HTTP POST method. It also handles retries based on retry condition.
      Parameters:
      personRequest - original request sent by client
      Returns:
      completed CompletableFuture with PersonResponse
      Throws:
      com.fullcontact.apilib.FullContactException - exception if client is shutdown
      See Also:
      CompletableFuture
    • enrich

      public java.util.concurrent.CompletableFuture<com.fullcontact.apilib.models.Response.CompanyResponse> enrich​(com.fullcontact.apilib.models.Request.CompanyRequest companyRequest) throws com.fullcontact.apilib.FullContactException
      Method for Company Enrich. It converts the request to json, send the Asynchronous request using HTTP POST method. It also handles retries based on retry condition.
      Parameters:
      companyRequest - original request sent by client
      Returns:
      completed CompletableFuture with CompanyResponse
      Throws:
      com.fullcontact.apilib.FullContactException - exception if client is shutdown or request validation
      See Also:
      CompletableFuture
    • search

      public java.util.concurrent.CompletableFuture<com.fullcontact.apilib.models.Response.CompanySearchResponseList> search​(com.fullcontact.apilib.models.Request.CompanyRequest companyRequest) throws com.fullcontact.apilib.FullContactException
      Method for Company Search. It converts the request to json, send the Asynchronous request using HTTP POST method. It also handles retries based on retry condition.
      Parameters:
      companyRequest - original request sent by client
      Returns:
      completed CompletableFuture with CompanySearchResponseList
      Throws:
      com.fullcontact.apilib.FullContactException - exception if client is shutdown or request validation
      See Also:
      CompletableFuture
    • close

      public void close()
      This method is used to call shutdown on the ScheduledThreadPoolExecutor and close the FullContact client.
      Specified by:
      close in interface java.lang.AutoCloseable
    • finalize

      public void finalize()
      This method will be called by GC to close the client.