@Service public class ExternalCallServiceImpl extends Object implements ExternalCallService
ExternalCallService
interface.
Supports specifying a RegEx pattern to skip matched operation URIs.Constructor and Description |
---|
ExternalCallServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
complete(ExternalCall extCall)
Marks the external call as a successfully executed call.
|
void |
failed(ExternalCall extCall)
Marks the external call as an unsuccessfully executed call.
|
void |
initPattern() |
ExternalCall |
prepare(String operationUri,
String operationKey,
Message message)
Prepares a new external call for the specified unique operation invocation.
|
@PostConstruct public void initPattern()
@Transactional public ExternalCall prepare(String operationUri, String operationKey, Message message)
ExternalCallService
The attempted external call might not be allowed.
This could happen if the external call is either duplicate or outdated.
To verify it's a new call, the provided Message.getMsgTimestamp()
will be compared with an existing known one (if any) for this invocation:
if the provided timestamp is newer, the call is considered new,
otherwise the call is considered outdated or duplicate.
prepare
in interface ExternalCallService
operationUri
- the operation URI that the external call is done viaoperationKey
- the operation key that is to be unique for this operation URI
(object ID for edits, correlation ID for single-entity creation messages, etc.)message
- the message with the correct msg timestampExternalCall
, if the attempted call is new and is prepared to be made;
null if the call is duplicate or outdated and should NOT be made@Transactional public void complete(ExternalCall extCall)
ExternalCallService
complete
in interface ExternalCallService
extCall
- the external call to be finalized.@Transactional public void failed(ExternalCall extCall)
ExternalCallService
failed
in interface ExternalCallService
extCall
- the external call to be finalized.Copyright © 2018 Pivotal Software, Inc.. All rights reserved.