Methods |
public
|
__construct(RequestInterface $request): void
Creates event object from RequestInterface object
Creates event object from RequestInterface object
Parse the request, check the format, detect all event parts.
Throws
|
#
|
public
|
getType(): string
Returns event type
Returns event type
Returns ESPF event type like 'Account/BalanceChanged'
|
#
|
public
|
getVars(): array<string, mixed>
Return all event vars as associative array
Return all event vars as associative array
|
#
|
public
|
stopOnFirstGood(): self
Set event to stop propagate after first success (200) happen
Set event to stop propagate after first success (200) happen
If methos is called once, the Event is set to stop propagate after first
succes code (200) registered by a handler.
May be called either before dispatch or by handler. In the second case,
the hahdler will be the last one and Event will stop it's propagation.
Returns
|
#
|
public
|
isPropagationStopped(): bool
Indicate to stop future processing by Dispatcher
Indicate to stop future processing by Dispatcher
Implements
|
#
|
public
|
onSuccess(): void
Event handler must call this to register processing success
Event handler must call this to register processing success
The same meaning like to call onProcessed(200), as 200 is the success code
|
#
|
public
|
onProcessed(int $code): void
Event handler must call this to register processing result
Event handler must call this to register processing result
The code given will be passed to PortaOne as http result code
See Portaone documentation
about return code meaning and ESPF action on it:
Once a response is received, the ESPF acts as follows:
- 200 OK – the event has been received. The ESPF removes the event from
the provisioning queue.
- 4xx Client Error (e.g., 400 Bad Request) – the event must not be
provisioned. The ESPF removes the event from the provisioning queue.
- Other status code – an issue appeared during provisioning. The ESPF
re-sends the event.
- If no response is received from the Application during the timeout (300
seconds by default) – the ESPF re-sends the event to the Application.
Please make sure your application can accept the same provisioning event
multiple times.
Parameters
$code |
HTTP error code to return.
|
|
#
|
public
|
getRequest(): RequestInterface
Returns original request object
Returns original request object
|
#
|
public
|
getBestResult(int $notFoundCode = 404): int
Returns the best (lowest code) of registered results
Returns the best (lowest code) of registered results
If there was no handlers return gived notfound code or default 404
Returns
The best (lowest) code of all registered
|
#
|
public
|
getWorstResult(int $notFoundCode = 404): int
Returns the worst (highest code) of registered results
Returns the worst (highest code) of registered results
If there was no handlers return gived notfound value or default 404
Returns
The worst (highest)code of all registered
|
#
|
public
|
isMatchPatterns(string[] $patterns): bool
Checks event type against array of patterns
Checks event type against array of patterns
Each pattern in the array may be a valid event type with wildcard * means
any count of letters, but not / .
Examples:
- '*/BalanceChanged' will match 'Customer/BalanceChanged' and 'Account/BalanceChanged'
- 'Account/*locked' will match 'Account/Blocked' and 'Account/Unblocked'
Parameters
$patterns |
Array of patterns to match
|
Returns
return true if match any of patterns
|
#
|
protected
|
parseData(): void
|
#
|
public
|
offsetExists($offset): bool
|
#
|
public
|
offsetGet($offset)
Actually this should be return by ref but atm cannot be.
Actually this should be return by ref but atm cannot be.
Implements
|
#
|
public
|
offsetSet($offset, $value): void
|
#
|
public
|
offsetUnset($offset): void
|
#
|
public
|
__get($name)
|
#
|
public
|
__isset($name)
|
#
|
public
|
__set($name, $value)
|
#
|
public
|
__unset($name)
|
#
|