Package com.fullcontact.apilib.enrich
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 classFullContact.FullContactBuilderBuilder 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.CompanyRequestBuilderbuildCompanyRequest()static com.fullcontact.apilib.models.Request.PersonRequest.PersonRequestBuilderbuildPersonRequest()voidclose()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.voidfinalize()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.
-
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 authheaders- custom client headersuserAgent- client UserAgentconnectTimeoutMillis- connection timout for all requestsretryAttempts- number of retry attempts allowedretryDelayMillis- 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.FullContactExceptionMethod 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.FullContactExceptionMethod 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.FullContactExceptionMethod 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:
closein interfacejava.lang.AutoCloseable
-
finalize
public void finalize()This method will be called by GC to close the client.
-