public class MessageIDMapper extends Object
MessageIDMapper is a singleton that allows applications to create id mappings in a transactional
manner.
MessageIDMapper mapper = MessageIDMapper.getInstance();
mapper.createIDMap(mid1, mid2);
| Modifier and Type | Method and Description |
|---|---|
void |
createIDMap(MessageKey mkey1,
MessageKey mkey2,
long archiveAfter,
boolean callPMIAgent,
boolean transactional)
Creates a map between two message keys.
|
void |
createIDMap(String mid1,
String mid2,
long archiveAfter) |
void |
createIDMap(String mid1,
String mid2,
long archiveAfter,
boolean transactional)
Creates a map between two message ids.
|
void |
decrementDuplicateCount(String mid1,
int duplicateThreshold)
Decrements the duplicate count for message id MSG_ID1
|
void |
decrementDuplicateCount(String mid1,
int duplicateThreshold,
boolean transactional)
Decrements the duplicate count for message id MSG_ID1
|
com.sap.aii.af.service.idmap.IDMap |
getIDMapExt(String mid)
Get ID Map Extended.
|
static MessageIDMapper |
getInstance()
Gets the singleton
MessageIDMapper |
String |
getMappedId(String mid)
Retrieves a message id from the mapped message ids.
|
MessageKey |
getMappedKey(MessageKey mkey)
Retrieves a message key from the mapped message keys.
|
void |
incrementDuplicateCount(String mid1)
Increments the duplicate count for message id MSG_ID1
|
void |
incrementDuplicateCount(String mid1,
boolean transactional)
Increments the duplicate count for message id MSG_ID1
|
LinkedList<String[]> |
readIDMapEntries()
Reads all IDMap entries available in the DB and returns them as a LinkedList of IDMap objects.
|
String |
remove(String mid) |
String |
remove(String mid,
boolean transactional)
Removes the message id map entry for this id.
|
void |
removeExpiredIDMaps() |
void |
removeExpiredIDMaps(Timestamp timeStamp)
Deletes all IDMapper entries, where the persist duration has already expired.
|
void |
removeExpiredIDMaps(Timestamp timeStamp,
int bulkLimit)
Deletes all IDMapper entries, where the persist duration has already expired.
|
void |
updateIDMap(String mid1,
String new_mid2,
long archiveAfter,
boolean transactional)
Updates the mapped message identifier for a given MSG_ID1.
|
public static MessageIDMapper getInstance()
MessageIDMapperpublic String getMappedId(String mid)
mid - the message id.public com.sap.aii.af.service.idmap.IDMap getIDMapExt(String mid)
mid - the message id (MSG_ID1).public MessageKey getMappedKey(MessageKey mkey)
mkey - the message key.public String remove(String mid, boolean transactional)
mid - the message id for which to remove the map.transactional - Should the operation happen in it's own transactionpublic void createIDMap(String mid1, String mid2, long archiveAfter) throws UtilException
UtilExceptionpublic void createIDMap(String mid1, String mid2, long archiveAfter, boolean transactional) throws UtilException
mid1 - the first message id.mid2 - the second message id.archiveAfter - a point in time represented in milliseconds as per the java standard after which this message
id mapping will no longer be required and can be archived.transactional - specifies if the IDMap entry should be written in an existing transactional contextUtilException - if one of the ids is null or already exists in the database.public void updateIDMap(String mid1, String new_mid2, long archiveAfter, boolean transactional) throws UtilException
mid1 - the unique message identifier, unique index on MSG_ID1 is introduced with note 1656793new_mid2 - the new mapped message identifier, which mid1 is mapped toarchiveAfter - Archive the entry after this timetransactional - Use a new DB transactionUtilException - in case there was an error in the DB operation or the update of the DB entrypublic void createIDMap(MessageKey mkey1, MessageKey mkey2, long archiveAfter, boolean callPMIAgent, boolean transactional) throws UtilException
mkey1 - the first message key.mkey2 - the second message key.archiveAfter - a point in time represented in milliseconds as per the java standard after which this message
id mapping will no longer be required and can be archived.transactional - specifies if the IDMap entry should be created as part or a transactional contextcallPMIAgent - specifies if the IDMapping PMI agent should be calledUtilException - if one of the ids is null or already exists in the database.public void incrementDuplicateCount(String mid1) throws UtilException
mid1 - the first message id.UtilException - in case of any exceptionpublic void incrementDuplicateCount(String mid1, boolean transactional) throws UtilException
mid1 - the first message id.transactional - specifies if the IDMap entry should be written in an existing transactional contextUtilException - in case of any exceptionpublic void decrementDuplicateCount(String mid1, int duplicateThreshold) throws UtilException
mid1 - the first message id.duplicateThreshold - limit for duplicate messagesUtilException - in case of any exceptionpublic void decrementDuplicateCount(String mid1, int duplicateThreshold, boolean transactional) throws UtilException
mid1 - the first message id.duplicateThreshold - limit for duplicate messagestransactional - specifies if the IDMap entry should be written in an existing transactional contextUtilException - in case of any exceptionpublic void removeExpiredIDMaps(Timestamp timeStamp)
timeStamp - delete all entries with PERSIST_UNTIL older than the timeStamppublic void removeExpiredIDMaps(Timestamp timeStamp, int bulkLimit)
timeStamp - delete all entries with PERSIST_UNTIL older than the timeStampbulkLimit - the bulk sizepublic void removeExpiredIDMaps()
public LinkedList<String[]> readIDMapEntries()
| Access Rights |
|---|
| SC | DC | Public Part | ACH |
|---|---|---|---|
[sap.com] SAP_XIAF
|
[sap.com] com.sap.aii.af.svc.facade
|
api
|
BC-XI
|
Copyright 2017 SAP AG Complete Copyright Notice