Interface IRestCommunication
-
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
IFirstTranslationService
- All Known Implementing Classes:
EmptyFirstTranslationService
public interface IRestCommunication extends Serializable
- Author:
- Phillip Austerfield
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IRestResponse
downloadDatabaseMonitoredFiles()
Download database CSVIRestResponse
downloadLogfile()
Download the current logfileIRestResponse
downloadLogfiles()
Download all logfilesIRestResponse
downloadTranslatedXML(boolean bSuccesses, String sXmlName)
Get Translated XML file listIRestResponse
encryptString(String sUri, String sPort, String sApiAccessKey, String sMessage)
Encrypt a given stringIRestResponse
getTranslatedXMLs(boolean bSuccesses)
Get Translated XML file listIRestResponse
historyDownloadCSV(long lProjectId)
Download historyIRestResponse
historyRemove(List<Long> vplDatasetIds)
Download historyIRestResponse
immediateTranslation(String sText, boolean bIsXml, String sSourceLanguageAbbreviation, String sTargetLanguageAbbreviation, String sConnectorId, long lProjectId, String sFormElementName)
Translate immediately via AWS/Google Translateboolean
pingExchangeService(String sUri, String sPort, String sApiKey, boolean bUseHttps)
boolean
pingTranslationStudio()
Ping the translation studio instance to make sure it is available and readyIRestResponse
queryTranslationStatusPage(long lProjectId, long lPageId, long lElementId)
Query Page Status XMLIRestResponse
queryTranslationStatusReport(Map<String,String> pParams)
IRestResponse
requestFSConnectionTest(String sTranslationStudioUri, String sTranslationStudioPort, String sApiAccessKey, boolean bUseTsHttps, String sFirstSpiritUri, String sFirstSpiritPort, boolean bFirstSpiritConnectionModeHttp, String sFirstSpiritUser, String sFirstSpiritPassword)
Test FirstSpirit ConnectionIRegistrationTransferAction
requestRegisterTransferAction()
Create action to submit translation requestIRestResponse
requestSmtpTestMail(String sTranslationStudioUri, String sTranslationStudioPort, String sApiAccessKey, boolean bUseHttps, String sRecipient, String sSender, String sSmtpServerAddress, String sSmtpServerPort, String sSmtpUser, String sSmtpPassword, boolean bTlsEnable)
Test FirstSpirit ConnectionIRestResponse
requestTmsCommunication(String sUri, String sPort, String sMessage, String sApiAccessKey, boolean bUseHttps, int nTimeout)
IRestResponse
sendCustomEvent(ICustomEventMessage pEvent)
Send a custom request to TranslationStudioboolean
submitTranslationRequest(String psJson, boolean isUrgent)
Submit a translation request jsonIRestResponse
updateMonitoredFileStatusFinished(String sDatasetId, String sProjectId, boolean bResetRetryCounter)
Set status to "FINISHED", either by dataset id OR project idIRestResponse
updateMonitoredFileStatusInProgress(String sDatasetId, String sProjectId, boolean bResetRetryCounter)
Set status to "IN PROGRESS", either by dataset id OR project idIRestResponse
updateMonitoredFileStatusObsolete(String sDatasetId, String sProjectId, boolean bResetRetryCounter)
Set status to "OBSOLETE", either by dataset id OR project idIRestResponse
updateMonitoredFileStatusRemove(String sDatasetId)
Remove entry by idIRestResponse
uploadXmlFile(String sContent)
Upload a given XML content
-
-
-
Method Detail
-
requestFSConnectionTest
IRestResponse requestFSConnectionTest(String sTranslationStudioUri, String sTranslationStudioPort, String sApiAccessKey, boolean bUseTsHttps, String sFirstSpiritUri, String sFirstSpiritPort, boolean bFirstSpiritConnectionModeHttp, String sFirstSpiritUser, String sFirstSpiritPassword)
Test FirstSpirit Connection- Parameters:
sTranslationStudioUri
- FirstSpirit UrisTranslationStudioPort
- FirstSpirit PortsApiAccessKey
-bUseTsHttps
-sFirstSpiritUri
- URLsFirstSpiritPort
- PortbFirstSpiritConnectionModeHttp
- Use FirstSpirit Connection Mode HTTPsFirstSpiritUser
- UsersFirstSpiritPassword
- Password- Returns:
- success state
-
requestSmtpTestMail
IRestResponse requestSmtpTestMail(String sTranslationStudioUri, String sTranslationStudioPort, String sApiAccessKey, boolean bUseHttps, String sRecipient, String sSender, String sSmtpServerAddress, String sSmtpServerPort, String sSmtpUser, String sSmtpPassword, boolean bTlsEnable)
Test FirstSpirit Connection- Parameters:
sTranslationStudioUri
- FirstSpirit UrisTranslationStudioPort
- FirstSpirit PortsApiAccessKey
-bUseHttps
-sRecipient
-sSender
-sSmtpServerAddress
- SMTP Server AddresssSmtpServerPort
- PortsSmtpUser
- UsersSmtpPassword
- PasswordbTlsEnable
-- Returns:
- success state
-
queryTranslationStatusReport
@NotNull IRestResponse queryTranslationStatusReport(@NotNull Map<String,String> pParams)
-
requestTmsCommunication
@NotNull IRestResponse requestTmsCommunication(String sUri, String sPort, String sMessage, String sApiAccessKey, boolean bUseHttps, int nTimeout)
- Parameters:
sUri
- Exchange Service UrisPort
- Exchange Service PortsMessage
- Message to be sentsApiAccessKey
-bUseHttps
-nTimeout
-- Returns:
- Answer
-
pingExchangeService
boolean pingExchangeService(String sUri, String sPort, String sApiKey, boolean bUseHttps)
- Parameters:
sUri
-sPort
-sApiKey
-bUseHttps
-- Returns:
-
queryTranslationStatusPage
@NotNull IRestResponse queryTranslationStatusPage(long lProjectId, long lPageId, long lElementId)
Query Page Status XML- Parameters:
lProjectId
-lPageId
-lElementId
-- Returns:
-
encryptString
@NotNull IRestResponse encryptString(String sUri, String sPort, String sApiAccessKey, @NotNull String sMessage)
Encrypt a given string- Parameters:
sUri
-sPort
-sApiAccessKey
-sMessage
- Plain Input- Returns:
- Encrypted message
-
sendCustomEvent
@NotNull IRestResponse sendCustomEvent(@NotNull ICustomEventMessage pEvent) throws IllegalArgumentException
Send a custom request to TranslationStudio- Parameters:
pEvent
-- Returns:
- Throws:
IllegalArgumentException
-
immediateTranslation
@NotNull IRestResponse immediateTranslation(@NotNull String sText, boolean bIsXml, @NotNull String sSourceLanguageAbbreviation, @NotNull String sTargetLanguageAbbreviation, @NotNull String sConnectorId, long lProjectId, @NotNull String sFormElementName)
Translate immediately via AWS/Google Translate- Parameters:
sText
-bIsXml
-sSourceLanguageAbbreviation
-sTargetLanguageAbbreviation
-sConnectorId
-lProjectId
-sFormElementName
-- Returns:
-
requestRegisterTransferAction
@NotNull IRegistrationTransferAction requestRegisterTransferAction()
Create action to submit translation request- Returns:
-
submitTranslationRequest
boolean submitTranslationRequest(@NotNull String psJson, boolean isUrgent)
Submit a translation request json- Parameters:
psJson
-isUrgent
-- Returns:
-
pingTranslationStudio
boolean pingTranslationStudio()
Ping the translation studio instance to make sure it is available and ready- Returns:
-
downloadLogfile
@NotNull IRestResponse downloadLogfile()
Download the current logfile- Returns:
-
downloadLogfiles
@NotNull IRestResponse downloadLogfiles()
Download all logfiles- Returns:
-
downloadDatabaseMonitoredFiles
@NotNull IRestResponse downloadDatabaseMonitoredFiles()
Download database CSV- Returns:
-
uploadXmlFile
@NotNull IRestResponse uploadXmlFile(@NotNull String sContent)
Upload a given XML content- Parameters:
sContent
-- Returns:
-
getTranslatedXMLs
@NotNull IRestResponse getTranslatedXMLs(boolean bSuccesses)
Get Translated XML file list- Parameters:
bSuccesses
-- Returns:
-
downloadTranslatedXML
@NotNull IRestResponse downloadTranslatedXML(boolean bSuccesses, String sXmlName)
Get Translated XML file list- Parameters:
bSuccesses
-sXmlName
- XML File name- Returns:
-
updateMonitoredFileStatusRemove
@NotNull IRestResponse updateMonitoredFileStatusRemove(@NotNull String sDatasetId)
Remove entry by id- Parameters:
sDatasetId
- Dataset id to remove- Returns:
-
updateMonitoredFileStatusInProgress
@NotNull IRestResponse updateMonitoredFileStatusInProgress(@NotNull String sDatasetId, @NotNull String sProjectId, boolean bResetRetryCounter)
Set status to "IN PROGRESS", either by dataset id OR project id- Parameters:
sDatasetId
- Dataset id (takes precedence)sProjectId
- Project idbResetRetryCounter
- Set number of retries to 0 again- Returns:
-
updateMonitoredFileStatusFinished
@NotNull IRestResponse updateMonitoredFileStatusFinished(@NotNull String sDatasetId, @NotNull String sProjectId, boolean bResetRetryCounter)
Set status to "FINISHED", either by dataset id OR project id- Parameters:
sDatasetId
- Dataset id (takes precedence)sProjectId
- Project idbResetRetryCounter
- Set number of retries to 0 again- Returns:
-
updateMonitoredFileStatusObsolete
@NotNull IRestResponse updateMonitoredFileStatusObsolete(@NotNull String sDatasetId, @NotNull String sProjectId, boolean bResetRetryCounter)
Set status to "OBSOLETE", either by dataset id OR project id- Parameters:
sDatasetId
- Dataset id (takes precedence)sProjectId
- Project idbResetRetryCounter
- Set number of retries to 0 again- Returns:
-
historyDownloadCSV
@NotNull IRestResponse historyDownloadCSV(long lProjectId)
Download history- Parameters:
lProjectId
-- Returns:
-
historyRemove
@NotNull IRestResponse historyRemove(@NotNull List<Long> vplDatasetIds)
Download history- Parameters:
vplDatasetIds
-- Returns:
-
-