Package com.coveo.pushapiclient
Class PlatformClient
java.lang.Object
com.coveo.pushapiclient.PlatformClient
PlatformClient handles network requests to the Coveo platform
-
Constructor Summary
ConstructorsConstructorDescriptionPlatformClient(String apiKey, String organizationId) Construct a PlatformClientPlatformClient(String apiKey, String organizationId, Environment environment) Deprecated.Please now use PlatformUrl to define your Platform environmentPlatformClient(String apiKey, String organizationId, PlatformUrl platformUrl) Construct a PlatformClientPlatformClient(String apiKey, String organizationId, HttpClient httpClient) Construct a PlatformClient -
Method Summary
Modifier and TypeMethodDescriptionappendOrderingId(long orderingId) Returns the orderingId for the query string only when a valid orderingId is available.Create a file container.createOrUpdateSecurityIdentity(String securityProviderId, SecurityIdentityModel securityIdentityModel) Create or update a security identity.createOrUpdateSecurityIdentityAlias(String securityProviderId, SecurityIdentityAliasModel securityIdentityAlias) Create or update a security identity alias.createSource(String name, SourceVisibility sourceVisibility) Create a new push sourcedeleteDocument(String sourceId, String documentId, Boolean deleteChildren) Deletes a specific item from a Push source.deleteOldSecurityIdentities(String securityProviderId, SecurityIdentityDeleteOptions batchDelete) Delete old security identities.deleteSecurityIdentity(String securityProviderId, SecurityIdentityDelete securityIdentityToDelete) Delete a security identity.manageSecurityIdentities(String securityProviderId, SecurityIdentityBatchConfig batchConfig) Manage batches of security identities.pushBinaryToFileContainer(FileContainer fileContainer, byte[] fileAsBytes) Push a binary to a File Container.pushDocument(String sourceId, String documentJSON, String documentId, CompressionType compressionType) Adds or updates an individual item in a push source.pushFileContainerContent(String sourceId, FileContainer fileContainer) Push a file container into a push source.updateSourceStatus(String sourceId, PushAPIStatus status) Update the status of a Push source.uploadContentToFileContainer(FileContainer fileContainer, String batchUpdateJson) Upload content update into a file container.
-
Constructor Details
-
PlatformClient
Construct a PlatformClient- Parameters:
apiKey- An apiKey capable of pushing documents and managing sources in a Coveo organization. See [Manage API Keys](https://docs.coveo.com/en/1718).organizationId- The Coveo Organization identifier.
-
PlatformClient
Construct a PlatformClient- Parameters:
apiKey- An apiKey capable of pushing documents and managing sources in a Coveo organization. See [Manage API Keys](https://docs.coveo.com/en/1718).organizationId- The Coveo Organization identifier.platformUrl- The PlatformUrl.
-
PlatformClient
Construct a PlatformClient- Parameters:
apiKey- An apiKey capable of pushing documents and managing sources in a Coveo organization. See [Manage API Keys](https://docs.coveo.com/en/1718).organizationId- The Coveo Organization identifier.httpClient- The HttpClient.
-
PlatformClient
Deprecated.Please now use PlatformUrl to define your Platform environment- Parameters:
apiKey- An apiKey capable of pushing documents and managing sources in a Coveo organization. See [Manage API Keys](https://docs.coveo.com/en/1718).organizationId- The Coveo Organization identifier.environment- The Environment to be used.- See Also:
-
-
Method Details
-
createSource
public HttpResponse<String> createSource(String name, SourceVisibility sourceVisibility) throws IOException, InterruptedException Create a new push source- Parameters:
name- The name of the source to createsourceVisibility- The security option that should be applied to the content of the source. See [Content Security](https://docs.coveo.com/en/1779).- Returns:
- Throws:
IOExceptionInterruptedException
-
createOrUpdateSecurityIdentity
public HttpResponse<String> createOrUpdateSecurityIdentity(String securityProviderId, SecurityIdentityModel securityIdentityModel) throws IOException, InterruptedException Create or update a security identity. See [Adding a Single Security Identity](https://docs.coveo.com/en/167) and [Security Identity Models](https://docs.coveo.com/en/139).- Parameters:
securityProviderId-securityIdentityModel-- Returns:
- Throws:
IOExceptionInterruptedException
-
createOrUpdateSecurityIdentityAlias
public HttpResponse<String> createOrUpdateSecurityIdentityAlias(String securityProviderId, SecurityIdentityAliasModel securityIdentityAlias) throws IOException, InterruptedException Create or update a security identity alias. See [Adding a Single Alias](https://docs.coveo.com/en/142) and [User Alias Definition Examples](https://docs.coveo.com/en/46).- Parameters:
securityProviderId-securityIdentityAlias-- Returns:
- Throws:
IOExceptionInterruptedException
-
deleteSecurityIdentity
public HttpResponse<String> deleteSecurityIdentity(String securityProviderId, SecurityIdentityDelete securityIdentityToDelete) throws IOException, InterruptedException Delete a security identity. See [Disabling a Single Security Identity](https://docs.coveo.com/en/84).- Parameters:
securityProviderId-securityIdentityToDelete-- Returns:
- Throws:
IOExceptionInterruptedException
-
deleteOldSecurityIdentities
public HttpResponse<String> deleteOldSecurityIdentities(String securityProviderId, SecurityIdentityDeleteOptions batchDelete) throws IOException, InterruptedException Delete old security identities. See [Disabling Old Security Identities](https://docs.coveo.com/en/33).- Parameters:
securityProviderId-batchDelete-- Returns:
- Throws:
IOExceptionInterruptedException
-
appendOrderingId
Returns the orderingId for the query string only when a valid orderingId is available.- Parameters:
orderingId-- Returns:
-
manageSecurityIdentities
public HttpResponse<String> manageSecurityIdentities(String securityProviderId, SecurityIdentityBatchConfig batchConfig) throws IOException, InterruptedException Manage batches of security identities. See [Manage Batches of Security Identities](https://docs.coveo.com/en/55).- Parameters:
securityProviderId-batchConfig-- Returns:
- Throws:
IOExceptionInterruptedException
-
pushDocument
public HttpResponse<String> pushDocument(String sourceId, String documentJSON, String documentId, CompressionType compressionType) throws IOException, InterruptedException Adds or updates an individual item in a push source. See [Adding a Single Item in a Push Source](https://docs.coveo.com/en/133).- Parameters:
sourceId-documentJSON-documentId-compressionType-- Returns:
- Throws:
IOExceptionInterruptedException
-
deleteDocument
public HttpResponse<String> deleteDocument(String sourceId, String documentId, Boolean deleteChildren) throws IOException, InterruptedException Deletes a specific item from a Push source. Optionally, the child items of that item can also be deleted. See [Deleting an Item in a Push Source](https://docs.coveo.com/en/171).- Parameters:
sourceId-documentId-deleteChildren-- Returns:
- Throws:
IOExceptionInterruptedException
-
createFileContainer
Create a file container. See [Creating a File Container](https://docs.coveo.com/en/43).- Returns:
- Throws:
IOExceptionInterruptedException
-
updateSourceStatus
public HttpResponse<String> updateSourceStatus(String sourceId, PushAPIStatus status) throws IOException, InterruptedException Update the status of a Push source. See [Updating the Status of a Push Source](https://docs.coveo.com/en/35).- Parameters:
status-- Returns:
- Throws:
IOExceptionInterruptedException
-
uploadContentToFileContainer
public HttpResponse<String> uploadContentToFileContainer(FileContainer fileContainer, String batchUpdateJson) throws IOException, InterruptedException Upload content update into a file container. See [Upload the Content Update into the File Container](https://docs.coveo.com/en/90/index-content/manage-batches-of-items-in-a-push-source#step-2-upload-the-content-update-into-the-file-container).- Parameters:
fileContainer-batchUpdateJson-- Returns:
- Throws:
IOExceptionInterruptedException
-
pushFileContainerContent
public HttpResponse<String> pushFileContainerContent(String sourceId, FileContainer fileContainer) throws IOException, InterruptedException Push a file container into a push source. See [Push the File Container into a Push Source](https://docs.coveo.com/en/90/index-content/manage-batches-of-items-in-a-push-source#step-3-push-the-file-container-into-a-push-source).- Parameters:
sourceId-fileContainer-- Returns:
- Throws:
IOExceptionInterruptedException
-
pushBinaryToFileContainer
public HttpResponse<String> pushBinaryToFileContainer(FileContainer fileContainer, byte[] fileAsBytes) throws IOException, InterruptedException Push a binary to a File Container. See [Upload the Item Data Into the File Container](https://docs.coveo.com/en/69#step-2-upload-the-item-data-into-the-file-container)- Parameters:
fileContainer-fileAsBytes-- Returns:
- Throws:
IOExceptionInterruptedException
-