ConsumerMiddleware
extends AbstractConsumerMiddleware
in package
Consumer middleware for both service and blocker templates.
Table of Contents
Properties
- $consumer : mixed
- $suspended : mixed
- $td : TemporaryTextDomain
- Temporary text domain.
Methods
- __construct() : mixed
- C'tor.
- afterDownloadAndPersistFromDataSource() : void
- Teardown of `beforeDownloadAndPersistFromDataSource`. This is also invoked when the database throws the `AbortDataSourceDownloadException` exception.
- afterUseTemplate() : void
- Teardown of `beforeDownloadAndPersistFromDataSource`.
- beforeDownloadAndPersistFromDataSource() : void
- Before downloading from specified datasources. This allows you to e.g. change the language of the context to make translations work as expected.
- beforeUseTemplate() : void
- Before using a template and running all the middlewares of `AbstractTemplateMiddleware`.
- failedDownloadAndPersistFromDataSource() : void
- The download from a data source failed with an exception.
- getConsumer() : mixed
- Getter.
- getVariableResolver() : mixed
- Getter.
- isSuspended() : mixed
- Check if the middleware is suspended.
- suspend() : mixed
- Allows to suspend or resume the middleware to take effect. This is efficient if a middleware could be called recursively.
- applyAcknowledgementMode() : mixed
- Disallow the creation of a service in the scanner. Additionally, you can add a message to the consumer data which is shown to the user. The user can only acknowledge to the message and not create the service.
- setRetryIn() : mixed
- Set the retry-in variable in all available consumers within the consumer pools.
Properties
$consumer
private
mixed
$consumer
$suspended
private
mixed
$suspended
= false
$td
Temporary text domain.
private
TemporaryTextDomain
$td
Methods
__construct()
C'tor.
public
__construct(ServiceCloudConsumer $consumer) : mixed
Parameters
- $consumer : ServiceCloudConsumer
afterDownloadAndPersistFromDataSource()
Teardown of `beforeDownloadAndPersistFromDataSource`. This is also invoked when the database throws the `AbortDataSourceDownloadException` exception.
public
afterDownloadAndPersistFromDataSource(mixed $exception, mixed $templates) : void
Parameters
- $exception : mixed
-
null
when persist worked as expected, otherwise anException
- $templates : mixed
-
The persisted templates within this consumer
afterUseTemplate()
Teardown of `beforeDownloadAndPersistFromDataSource`.
public
afterUseTemplate(mixed $template) : void
Parameters
- $template : mixed
beforeDownloadAndPersistFromDataSource()
Before downloading from specified datasources. This allows you to e.g. change the language of the context to make translations work as expected.
public
beforeDownloadAndPersistFromDataSource() : void
beforeUseTemplate()
Before using a template and running all the middlewares of `AbstractTemplateMiddleware`.
public
beforeUseTemplate(mixed $template) : void
Parameters
- $template : mixed
failedDownloadAndPersistFromDataSource()
The download from a data source failed with an exception.
public
failedDownloadAndPersistFromDataSource(mixed $exception) : void
Parameters
- $exception : mixed
getConsumer()
Getter.
public
getConsumer() : mixed
Tags
getVariableResolver()
Getter.
public
getVariableResolver() : mixed
Tags
isSuspended()
Check if the middleware is suspended.
public
isSuspended() : mixed
suspend()
Allows to suspend or resume the middleware to take effect. This is efficient if a middleware could be called recursively.
public
suspend(bool $state) : mixed
Parameters
- $state : bool
applyAcknowledgementMode()
Disallow the creation of a service in the scanner. Additionally, you can add a message to the consumer data which is shown to the user. The user can only acknowledge to the message and not create the service.
protected
applyAcknowledgementMode(AbstractTemplate $template[, array<string|int, string> $paragraphs = [] ][, array<string|int, string> $accordion = null ][, string $buttonLabel = null ][, string $buttonAction = null ]) : mixed
Parameters
- $template : AbstractTemplate
- $paragraphs : array<string|int, string> = []
- $accordion : array<string|int, string> = null
-
A list of accordions with key as headline and value as message.
- $buttonLabel : string = null
-
The label of the button.
- $buttonAction : string = null
-
The action of the button, can be "ignore", "create" or "close".
setRetryIn()
Set the retry-in variable in all available consumers within the consumer pools.
protected
setRetryIn(mixed $value) : mixed
Parameters
- $value : mixed