Package com.avoka.fc.core.service.fluent
Class FluentEmailService
- java.lang.Object
-
- com.avoka.fc.core.service.BaseService
-
- com.avoka.fc.core.service.CayenneService
-
- com.avoka.fc.core.service.email.AbstractEmailService
-
- com.avoka.fc.core.service.fluent.FluentEmailService
-
- All Implemented Interfaces:
IFluentService
,IEmailService
,IServiceDefinitionAware
,IUnitTestableService
public class FluentEmailService extends AbstractEmailService implements IFluentService
Provides a Fluent API Groovy Email service.- Since:
- 5.0.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.avoka.fc.core.service.email.AbstractEmailService
AbstractEmailService.EmailFormat, AbstractEmailService.TempForm, AbstractEmailService.TempSubmission, AbstractEmailService.TempSubmissionExtractData, AbstractEmailService.TempUser
-
-
Field Summary
-
Fields inherited from class com.avoka.fc.core.service.email.AbstractEmailService
EMAIL_INFO_EVENT_LOG_PATTEN, serviceDefinition
-
Fields inherited from interface com.avoka.fc.core.service.fluent.IFluentService
PARAM_ACTION_PROPERTIES, PARAMS_FILEDATA, PARAMS_FILENAME, PARAMS_FORM, PARAMS_FORM_XML, PARAMS_FUNC_PARAM, PARAMS_JOB, PARAMS_JOB_ACTION, PARAMS_PARAMS, PARAMS_REQUEST, PARAMS_ROWS, PARAMS_SVC_DEF, PARAMS_TEST_PARAMS, PARAMS_TXN, PARAMS_USER
-
-
Constructor Summary
Constructors Constructor Description FluentEmailService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getErrorType()
Integer
getExecutionTimeout()
Return the GroovyScript execution timeout in milliseconds.String
getGroovyScript()
GroovyServiceLog
getGroovyServiceLog()
Return the GroovyServiceLog record created after executing the script.ServiceDefinition
getServiceDefinition()
Return the service definitionString
getTestLogOutput()
Return the service Unit Test Script logger output.Object
invoke(Map<String,Object> parameters)
Invoke the Fluent Service using the given parameters.Boolean
isGroovyDebugLogging()
Return true if GroovyLogger DEBUG level message recording is enabled.boolean
isGroovyLoggingEnabled()
Return true if the Groovy Service logging is enabled.Throwable
runUnitTest()
Run the service's Unit Test Script if defined for the service, returning null if succeeded or an error if it failed.void
sendEmailMessage(String subject, String message, String fromAddress, String replyToAddress, String toAddress, String ccAddress, String bccAddress, Map<String,byte[]> attachmentMap, Submission submission)
Send an email message.void
setExecutionTimeout(Integer timeout)
Return the GroovyScript execution timeout in milliseconds.void
setGroovyDebugLogging(Boolean debugEnabled)
Set whether GroovyLogger DEBUG level message recording is enabled.void
setGroovyLoggingEnabled(Boolean loggingEnabled)
Specify whether the Groovy Service logging is enabled.void
setGroovyScript(String script)
void
setLogger(Logger logger)
Set the service logger.void
setServiceDefinition(ServiceDefinition serviceDefinition)
Set the service definition.-
Methods inherited from class com.avoka.fc.core.service.email.AbstractEmailService
getTemplatedEmailMessageForPortal, getTemplatedEmailMessageForSubmission, getTemplatedEmailMessageForSubmission, queueAccountStatusNotification, queueEmail, queueEmail, queueEmail, queueEmail, queueFormReceiptEmail, queueFormReceiptEmail, queueNewAccountNotification, queueOrSendFormConfirmationReceiptMessage, queuePromotionNotificationMessage, queueSavedFormEmail, queueSavedFormEmail, queueShareFormEmail, queueSubmissionUpdateNotification, queueTemplatedMessageForPortal, renderDeploymentPropertyTemplate, sendDuplicatePaymentAlertEmailToClientAdmin, sendEmailVerification, sendEmailVerification, sendFormConfirmationMessage, sendFormReceiptMessage, sendFraudAlertEmailToClientAdmin, sendLostPasswordMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessageWithSubmissionAttachments, sendSavedFormEmail, sendSavedFormEmail, sendTaskNotification, sendTemplatedMessageForPortal, sendWelcomeUserMessage, sendWelcomeUserMessage
-
Methods inherited from class com.avoka.fc.core.service.CayenneService
commitChanges, deleteObject, deleteObjects, findObject, getDataContext, getDataDomain, getObjectForPK, getObjectStore, newObject, performNamedQuery, performNamedQuery, performNamedQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performQuery, performQuery, refetchEntity, refetchObject, registerNewObject, rollbackChanges, toMap, toMap
-
Methods inherited from class com.avoka.fc.core.service.BaseService
getLogger
-
-
-
-
Method Detail
-
sendEmailMessage
public void sendEmailMessage(String subject, String message, String fromAddress, String replyToAddress, String toAddress, String ccAddress, String bccAddress, Map<String,byte[]> attachmentMap, Submission submission)
Send an email message.- Specified by:
sendEmailMessage
in interfaceIEmailService
- Parameters:
subject
- email subjectmessage
- email message bodyfromAddress
- the from addressreplyToAddress
- the reply-to addresstoAddress
- email to addressccAddress
- email address to ccbccAddress
- email address to bccattachmentMap
- attachments mapsubmission
- the submission the email relates to (optional)- See Also:
IEmailService.sendEmailMessage(String, String, String, String, String, String, String, Map, Submission)
-
invoke
public Object invoke(Map<String,Object> parameters)
Invoke the Fluent Service using the given parameters.- Specified by:
invoke
in interfaceIFluentService
- Parameters:
parameters
- the service script parameters (required)- Returns:
- a new invocation result
- See Also:
IFluentService.invoke(Map)
-
getErrorType
public String getErrorType()
- Specified by:
getErrorType
in interfaceIFluentService
- Returns:
- the service error type to be used to classify the error logging records
- See Also:
IFluentService.getErrorType()
-
runUnitTest
public Throwable runUnitTest()
Run the service's Unit Test Script if defined for the service, returning null if succeeded or an error if it failed. If there is no 'Unit Test Script' defined, this method will return null.- Specified by:
runUnitTest
in interfaceIUnitTestableService
- Returns:
- an Exception if the test case failed, or null if the test case succeeded or no 'Unit Test Script' defined.
- See Also:
IUnitTestableService.runUnitTest()
-
getTestLogOutput
public String getTestLogOutput()
Return the service Unit Test Script logger output.- Specified by:
getTestLogOutput
in interfaceIUnitTestableService
- Returns:
- the service Unit Test Script logger output
- Since:
- 17.10.0
- See Also:
IUnitTestableService.getTestLogOutput()
-
getGroovyServiceLog
public GroovyServiceLog getGroovyServiceLog()
Return the GroovyServiceLog record created after executing the script.- Returns:
- the GroovyServiceLog record created after executing the script.
-
isGroovyDebugLogging
public Boolean isGroovyDebugLogging()
Return true if GroovyLogger DEBUG level message recording is enabled.- Returns:
- true if GroovyLogger DEBUG level message recording is enabled.
-
setGroovyDebugLogging
public void setGroovyDebugLogging(Boolean debugEnabled)
Set whether GroovyLogger DEBUG level message recording is enabled.- Parameters:
debugEnabled
- the groovyDebugLoggingEnabled to set
-
isGroovyLoggingEnabled
public boolean isGroovyLoggingEnabled()
Return true if the Groovy Service logging is enabled.- Returns:
- true if the Groovy Service logging is enabled.
-
setGroovyLoggingEnabled
public void setGroovyLoggingEnabled(Boolean loggingEnabled)
Specify whether the Groovy Service logging is enabled.- Parameters:
loggingEnabled
- specify whether the Groovy Service logging is enabled
-
getGroovyScript
public String getGroovyScript()
- Returns:
- the Groovy Script content to execute
-
setGroovyScript
public void setGroovyScript(String script)
- Parameters:
script
- the Groovy Script content to execute
-
getExecutionTimeout
public Integer getExecutionTimeout()
Return the GroovyScript execution timeout in milliseconds.- Returns:
- the GroovyScript execution timeout in milliseconds
-
setExecutionTimeout
public void setExecutionTimeout(Integer timeout)
Return the GroovyScript execution timeout in milliseconds.- Parameters:
timeout
- the GroovyScript execution timeout in milliseconds
-
getServiceDefinition
public ServiceDefinition getServiceDefinition()
Return the service definition- Specified by:
getServiceDefinition
in interfaceIServiceDefinitionAware
- Overrides:
getServiceDefinition
in classAbstractEmailService
- Returns:
- the service definition.
-
setServiceDefinition
public void setServiceDefinition(ServiceDefinition serviceDefinition)
Set the service definition.- Specified by:
setServiceDefinition
in interfaceIServiceDefinitionAware
- Overrides:
setServiceDefinition
in classAbstractEmailService
- Parameters:
serviceDefinition
- the service definition to set
-
setLogger
public void setLogger(Logger logger)
Set the service logger.- Specified by:
setLogger
in interfaceIFluentService
- Parameters:
logger
- the service logger- Since:
- 17.10.0
- See Also:
IFluentService.setLogger(Logger)
-
-