Package com.acrolinx.client.sdk
Class AcrolinxEndpoint
- java.lang.Object
-
- com.acrolinx.client.sdk.AcrolinxEndpoint
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class AcrolinxEndpoint extends java.lang.Object implements java.io.Closeable
-
-
Constructor Summary
Constructors Constructor Description AcrolinxEndpoint(AcrolinxHttpClient acrolinxHttpClient, java.net.URI acrolinxUri, java.lang.String signature, java.lang.String clientVersion, java.lang.String clientLocale)
AcrolinxEndpoint(java.net.URI acrolinxURL, java.lang.String signature, java.lang.String clientVersion, java.lang.String clientLocale)
AcrolinxEndpoint(java.net.URI sdkAcrolinxURL, java.net.URI userFacingAcrolinxURL, java.lang.String signature, java.lang.String clientVersion, java.lang.String clientLocale)
Use this constructor in case the URL that is returned to the user have to differ to the URL the integration connects to.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CheckResult
check(AccessToken accessToken, CheckRequest checkRequest)
CheckResult
check(AccessToken accessToken, CheckRequest checkRequest, ProgressListener progressListener)
Submits a check and waits until result is obtained.void
close()
Close Endpoint after use.Capabilities
getCapabilities(AccessToken accessToken)
Get check capabilities of the Platformjava.lang.String
getContentAnalysisDashboard(AccessToken accessToken, java.lang.String batchId)
Get URL to Content Analysis dashboardPlatformInformation
getPlatformInformation()
Returns Information about Platform version and locales supported.boolean
isDocumentTypeCheckable(java.lang.String documentType, AccessToken accessToken)
Check if document you wish to check is supported by PlatformSignInSuccess
signInInteractive(InteractiveCallback interactiveCallback)
An interactive sign-in where user can open a URL in a browser to sign in.SignInSuccess
signInInteractive(InteractiveCallback interactiveCallback, AccessToken accessToken, long timeoutInMillis)
An interactive sign-in where user can open URL in a browser to sign in.SignInSuccess
signInWithSSO(java.lang.String genericToken, java.lang.String username)
Single sign-onCheckResponse
submitCheck(AccessToken accessToken, CheckRequest checkRequest)
Submit a check request
-
-
-
Constructor Detail
-
AcrolinxEndpoint
public AcrolinxEndpoint(java.net.URI acrolinxURL, java.lang.String signature, java.lang.String clientVersion, java.lang.String clientLocale)
- Parameters:
acrolinxURL
- URL to your Acrolinx Platform for example: https://yourcompany.acrolinx.comsignature
- License to use integration with Acrolinx.clientVersion
- Version number of your Acrolinx Integration for example: 1.2.5.34clientLocale
- Locale of environment in which the integration is deployed.
-
AcrolinxEndpoint
public AcrolinxEndpoint(java.net.URI sdkAcrolinxURL, java.net.URI userFacingAcrolinxURL, java.lang.String signature, java.lang.String clientVersion, java.lang.String clientLocale)
Use this constructor in case the URL that is returned to the user have to differ to the URL the integration connects to.Examples:
- An SSO-proxy is used to access the Scorecard and the Content Analysis dashboard, but the SDK in an automated environment isn't able to use the same route. https://yourcompany.myintegration.com/proxy/ vs. https://yourcompany.acrolinx.com.
- An integration can connect directly to the Acrolinx Platform using an internal URL, where a user has to access it using an external URL. http://localhost:8031 vs. https://yourcompany.acrolinx.com.
- Parameters:
sdkAcrolinxURL
- URL to your Acrolinx Platform for example: https://yourcompany.acrolinx.comuserFacingAcrolinxURL
- URL to your Acrolinx Platform that is returned to the user: https://yourcompany.myintegration.com/proxy/signature
- License to use integration with Acrolinx.clientVersion
- Version number of your Acrolinx Integration for example: 1.2.5.34clientLocale
- Locale of environment in which the integration is deployed.
-
AcrolinxEndpoint
public AcrolinxEndpoint(AcrolinxHttpClient acrolinxHttpClient, java.net.URI acrolinxUri, java.lang.String signature, java.lang.String clientVersion, java.lang.String clientLocale)
- Parameters:
acrolinxHttpClient
- Provide your own http Acrolinx Integration implementingAcrolinxHttpClient
interfaceacrolinxUri
- URL to your Acrolinx Platform for example: https://yourcompany.acrolinx.comsignature
- License to use integration with Acrolinx.clientVersion
- Version number of your Acrolinx Integration for example: 1.2.5.37clientLocale
- Locale of environment in which the integration is deployed.
-
-
Method Detail
-
close
public void close() throws java.io.IOException
Close Endpoint after use.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
getPlatformInformation
public PlatformInformation getPlatformInformation() throws AcrolinxException
Returns Information about Platform version and locales supported.- Throws:
AcrolinxException
-
signInWithSSO
public SignInSuccess signInWithSSO(java.lang.String genericToken, java.lang.String username) throws AcrolinxException
Single sign-on- Parameters:
genericToken
- Generic SSO token configured on your Acrolinx Platform.username
- User who wants to authenticate- Returns:
- SignInSuccess holds the access token that is required to initiate check
- Throws:
AcrolinxException
-
signInInteractive
public SignInSuccess signInInteractive(InteractiveCallback interactiveCallback) throws AcrolinxException, java.lang.InterruptedException
An interactive sign-in where user can open a URL in a browser to sign in.- Parameters:
interactiveCallback
- Provide a method that can be called to open sign-in link in the browser.- Returns:
- SignInSuccess holds the access token that is required to initiate check
- Throws:
AcrolinxException
java.lang.InterruptedException
-
signInInteractive
public SignInSuccess signInInteractive(InteractiveCallback interactiveCallback, AccessToken accessToken, long timeoutInMillis) throws AcrolinxException, java.lang.InterruptedException
An interactive sign-in where user can open URL in a browser to sign in.- Parameters:
interactiveCallback
- Provide a method that can be called to open sign-in link in the browser.accessToken
- Provide an already available access to check its validitytimeoutInMillis
- Provide timeout in milliseconds- Returns:
- SignInSuccess holds the access token that is required to initiate check
- Throws:
AcrolinxException
java.lang.InterruptedException
-
getCapabilities
public Capabilities getCapabilities(AccessToken accessToken) throws AcrolinxException
Get check capabilities of the Platform- Parameters:
accessToken
- Provide access token obtained from Sign-in Success Response or Acrolinx dashboard- Returns:
- Checking capabilities available for Platform
- Throws:
AcrolinxException
-
submitCheck
public CheckResponse submitCheck(AccessToken accessToken, CheckRequest checkRequest) throws AcrolinxException
Submit a check request- Parameters:
accessToken
- Provide access token obtained from Sign-in Success Response or Acrolinx dashboard.checkRequest
- Use CheckRequestBuilder to simplify building check request.- Returns:
- Check response contains the URL to fetch check result.
- Throws:
AcrolinxException
-
getContentAnalysisDashboard
public java.lang.String getContentAnalysisDashboard(AccessToken accessToken, java.lang.String batchId) throws AcrolinxException
Get URL to Content Analysis dashboard- Parameters:
accessToken
- Provide access token obtained from Sign-in Success Response or Acrolinx dashboardbatchId
- Provide a batch Id submitted for performing a check- Returns:
- String contains URL to Content Analysis dashboard.
- Throws:
AcrolinxException
-
check
public CheckResult check(AccessToken accessToken, CheckRequest checkRequest, ProgressListener progressListener) throws AcrolinxException
Submits a check and waits until result is obtained.- Parameters:
accessToken
- Provide access token obtained from Sign-in Success Response or Acrolinx dashboardcheckRequest
- Use CheckRequestBuilder to simplify building check request.progressListener
- Provides statistical information about check progress- Returns:
- Acrolinx Scorecard for the checked content.
- Throws:
AcrolinxException
-
check
public CheckResult check(AccessToken accessToken, CheckRequest checkRequest) throws AcrolinxException
- Throws:
AcrolinxException
-
isDocumentTypeCheckable
public boolean isDocumentTypeCheckable(java.lang.String documentType, AccessToken accessToken) throws AcrolinxException
Check if document you wish to check is supported by Platform- Parameters:
documentType
- Type of your document for example: .xml, .md, .ditaaccessToken
- Provide access token obtained from Sign-in Success Response or Acrolinx dashboard- Returns:
- true if document type is checkable and false if not.
- Throws:
AcrolinxException
-
-