Class InsightsFormHelper
- java.lang.Object
-
- com.avoka.fc.core.service.insights.InsightsFormHelper
-
public class InsightsFormHelper extends Object
Provides a Transact Insights Helper object to get Google Service Account OAuth2 access tokens and store transaction metadata.- Since:
- 5.0.0
-
-
Constructor Summary
Constructors Constructor Description InsightsFormHelper()
Create a new Transaction Insights Helper object.InsightsFormHelper(RequestLog requestLog)
Create a new Transaction Insights Helper object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAccessToken()
Return a signed JWT for use by the form to request OAuth tokens from EventConsumer.String
getAddressHash()
Calculates the SHA256 hash of the RequestLog's hash concatenated with the Customer's licenseClientCode, i.e.static String
getDashboardEndpoint()
static String
getDataProviderEndpoint()
static String
getEventConsumerEndpoint()
static com.google.api.client.googleapis.auth.oauth2.GoogleCredential
getGlobalTMCredential()
Return the Google credentials for TMstatic String
getProvisioningEndpoint()
String
getRequestUrl()
Returns the full (inclusive of query string parameters) request URL for the RequestLog associated with this InsightsFormHelper instance.static String
getVisualiserEndpoint()
static void
publishFormDesignMetadata(TemplateVersion tv)
Publish the form design metadata to the GCP endpoint.
-
-
-
Constructor Detail
-
InsightsFormHelper
public InsightsFormHelper() throws GeneralSecurityException, IOException
Create a new Transaction Insights Helper object.- Throws:
GeneralSecurityException
- if an error occursIOException
- if an error occurs
-
InsightsFormHelper
public InsightsFormHelper(RequestLog requestLog) throws GeneralSecurityException, IOException
Create a new Transaction Insights Helper object.- Parameters:
requestLog
- the form request log (required)- Throws:
GeneralSecurityException
- if an error occursIOException
- if an error occurs
-
-
Method Detail
-
getDataProviderEndpoint
public static String getDataProviderEndpoint()
- Returns:
- the GAE data provider module URL endpoint
-
getEventConsumerEndpoint
public static String getEventConsumerEndpoint()
- Returns:
- the GAE event consumer module URL endpoint
-
getDashboardEndpoint
public static String getDashboardEndpoint()
- Returns:
- the GAE dashboard module URL endpoint
-
getVisualiserEndpoint
public static String getVisualiserEndpoint()
-
getProvisioningEndpoint
public static String getProvisioningEndpoint()
- Returns:
- the GAE provisioning module URL endpoint
-
getAccessToken
public String getAccessToken()
Return a signed JWT for use by the form to request OAuth tokens from EventConsumer.- Returns:
- a signed JWT for use by the form to request OAuth tokens from EventConsumer
-
publishFormDesignMetadata
public static void publishFormDesignMetadata(TemplateVersion tv)
Publish the form design metadata to the GCP endpoint.- Parameters:
tv
- the form design template version (required)- Since:
- 5.1.0
-
getAddressHash
public String getAddressHash()
Calculates the SHA256 hash of the RequestLog's hash concatenated with the Customer's licenseClientCode, i.e. sha256(ip + licenseClientCode)- Returns:
- The calculated IP hash value
-
getRequestUrl
public String getRequestUrl()
Returns the full (inclusive of query string parameters) request URL for the RequestLog associated with this InsightsFormHelper instance.- Returns:
- The full (parameter-including) requestUrl
-
getGlobalTMCredential
public static com.google.api.client.googleapis.auth.oauth2.GoogleCredential getGlobalTMCredential() throws GeneralSecurityException, IOException
Return the Google credentials for TM- Returns:
- the Google credentials
- Throws:
GeneralSecurityException
- if an error occursIOException
- if an error occurs
-
-