@Repository @Transactional(propagation=MANDATORY) public class ExternalCallDaoJpaImpl extends Object implements ExternalCallDao
ExternalCall
entity.Constructor and Description |
---|
ExternalCallDaoJpaImpl() |
Modifier and Type | Method and Description |
---|---|
ExternalCall |
findConfirmation(Duration interval)
Finds ONE confirmation in state
ExternalCallStateEnum.FAILED . |
List<ExternalCall> |
findProcessingExternalCalls(Duration interval)
Finds "processing" external calls in specified interval.
|
ExternalCall |
getExternalCall(String operationName,
String entityId)
Finds an existing external call for the specified operation and entityId.
|
void |
insert(ExternalCall externalCall)
Inserts new call.
|
ExternalCall |
lockConfirmation(ExternalCall extCall)
Updates confirmation (set state to PROCESSING) - gets lock for this confirmation.
|
void |
lockExternalCall(ExternalCall extCall)
Updates the specified attached external call entity to
start processing a new external call (set state to PROCESSING).
|
void |
update(ExternalCall externalCall)
Updates call.
|
public void insert(ExternalCall externalCall)
ExternalCallDao
insert
in interface ExternalCallDao
externalCall
- the external callpublic void update(ExternalCall externalCall)
ExternalCallDao
update
in interface ExternalCallDao
externalCall
- the external call@Nullable @Transactional(propagation=SUPPORTS, readOnly=true) public ExternalCall getExternalCall(String operationName, String entityId)
ExternalCallDao
getExternalCall
in interface ExternalCallDao
operationName
- the operation name (uri) to find the call forentityId
- the entity id (operation key) to find the call for@Transactional(propagation=MANDATORY) public void lockExternalCall(ExternalCall extCall) throws javax.persistence.PersistenceException
ExternalCallDao
lockExternalCall
in interface ExternalCallDao
extCall
- the external call that is attached to local EntityManager
(e.g., acquired via ExternalCallDao.getExternalCall(String, String)
in the same transaction)javax.persistence.PersistenceException
- e.g., if the lock fails@Nullable public ExternalCall findConfirmation(Duration interval)
ExternalCallDao
ExternalCallStateEnum.FAILED
.findConfirmation
in interface ExternalCallDao
interval
- Interval (in seconds) between two tries of failed confirmations.null
if there is no any confirmationpublic ExternalCall lockConfirmation(ExternalCall extCall)
ExternalCallDao
lockConfirmation
in interface ExternalCallDao
extCall
- the external callpublic List<ExternalCall> findProcessingExternalCalls(Duration interval)
ExternalCallDao
findProcessingExternalCalls
in interface ExternalCallDao
interval
- the intervalCopyright © 2018 Pivotal Software, Inc.. All rights reserved.