@Component(value="blSandBoxHelper") public class DefaultSandBoxHelper extends Object implements SandBoxHelper
SandBoxHelperSandBoxHelper.OriginalIdResponse| Constructor and Description |
|---|
DefaultSandBoxHelper() |
| Modifier and Type | Method and Description |
|---|---|
Long |
getCascadedProductionStateId(Class<?> linkedObjectType,
Long requestedParent) |
SandBoxHelper.OriginalIdResponse |
getOriginalId(Class<?> type,
Long id)
Return the original id for the requested id.
|
Long |
getOriginalId(Object test) |
SandBoxHelper.OriginalIdResponse |
getProductionOriginalId(Class<?> type,
Long id)
Return the original id for the requested id as if this was a production request.
|
Long |
getProductionRecordIdIfApplicable(javax.persistence.EntityManager em,
Object startFieldValue) |
com.google.common.collect.BiMap<Long,Long> |
getSandBoxToOriginalMap(Class<?> type,
Long... originalIds)
Retrieve a map keyed by sandbox id, with the value being the matching original
item id for that sandbox item.
|
Long |
getSandBoxVersionId(Class<?> linkedObjectType,
Long requestedParent)
Return the sandbox version id for the requested original id.
|
boolean |
isPromote()
Is the current thread involved in a promote operation?
|
boolean |
isReject()
Is the current thread involved in a reject operation?
|
boolean |
isSandBoxable(String className)
Whether or not the class is sandboxable
|
List<Long> |
mergeCloneIds(Class<?> type,
Long... originalIds)
Retrieve a list of values that includes the the original ids passed in and any
sandbox versions of those ids, if available.
|
void |
optionallyIncludeDeletedItemsInQueriesAndCollections(Runnable runnable,
boolean includeDeleted)
For the passed in code block (Runnable), whether or not sandbox entities marked
as deleted should be included in any results from queries or lazy collection
retrievals.
|
public Long getSandBoxVersionId(Class<?> linkedObjectType, Long requestedParent)
SandBoxHelpergetSandBoxVersionId in interface SandBoxHelperlinkedObjectType - the type of the entity in questionrequestedParent - the id to checkpublic Long getCascadedProductionStateId(Class<?> linkedObjectType, Long requestedParent)
getCascadedProductionStateId in interface SandBoxHelperpublic List<Long> mergeCloneIds(Class<?> type, Long... originalIds)
SandBoxHelpermergeCloneIds in interface SandBoxHelpertype - the type of the entity in questionoriginalIds - one or more ids values for which sandbox versions should be includedpublic com.google.common.collect.BiMap<Long,Long> getSandBoxToOriginalMap(Class<?> type, Long... originalIds)
SandBoxHelpergetSandBoxToOriginalMap in interface SandBoxHelpertype - the type of the entity in questionoriginalIds - list of ids to checkpublic SandBoxHelper.OriginalIdResponse getOriginalId(Class<?> type, Long id)
SandBoxHelpergetOriginalId in interface SandBoxHelpertype - the type of the entity in questionid - the id to checkpublic Long getOriginalId(Object test)
getOriginalId in interface SandBoxHelperpublic SandBoxHelper.OriginalIdResponse getProductionOriginalId(Class<?> type, Long id)
SandBoxHelpergetProductionOriginalId in interface SandBoxHelperpublic boolean isSandBoxable(String className)
SandBoxHelperisSandBoxable in interface SandBoxHelperclassName - the classname to checkpublic boolean isPromote()
SandBoxHelperisPromote in interface SandBoxHelperpublic boolean isReject()
SandBoxHelperisReject in interface SandBoxHelperpublic void optionallyIncludeDeletedItemsInQueriesAndCollections(Runnable runnable, boolean includeDeleted)
SandBoxHelperoptionallyIncludeDeletedItemsInQueriesAndCollections in interface SandBoxHelperrunnable - the block of code for which this setting should be in effectincludeDeleted - whether or not to include deleted sandbox itemspublic Long getProductionRecordIdIfApplicable(javax.persistence.EntityManager em, Object startFieldValue)
getProductionRecordIdIfApplicable in interface SandBoxHelperCopyright © 2017. All rights reserved.