Package de.hybris.platform.tx
Class AfterSaveEventUtils
- java.lang.Object
-
- de.hybris.platform.tx.AfterSaveEventUtils
-
public class AfterSaveEventUtils extends java.lang.Object
Utility class to encode the entity changes.
-
-
Constructor Summary
Constructors Constructor Description AfterSaveEventUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Collection<AfterSaveEvent>
createEventsFromChanges(byte[][] changes)
Creates the effective set ofAfterSaveEvent
objects from a array of encoded changes ( which are byte arrays as well).static java.util.Collection<AfterSaveEvent>
createEventsFromChanges(byte[][] changes, boolean removeUnnecessaryTypes)
Creates the effective set ofAfterSaveEvent
objects from a array of encoded changes ( which are byte arrays as well).static int
decodeChangeTypes(byte[] encodedChanges)
Decoded changes from encoded changes byte array.static PK
decodePK(byte[] encodedChanges)
Decoded PK from encoded changes byte array.static byte[]
encodeChanges(PK pk, int types)
Encodes several changes of one PK into a byte array.
-
-
-
Method Detail
-
encodeChanges
public static byte[] encodeChanges(PK pk, int types)
Encodes several changes of one PK into a byte array.- Returns:
- a byte array and its length is 9. The first eight bytes store the long value of PK, and the last one contains the type information.
- See Also:
decodeChangeTypes(byte[])
,decodePK(byte[])
-
decodePK
public static PK decodePK(byte[] encodedChanges)
Decoded PK from encoded changes byte array.- Returns:
- the decoded PK from the byte array.
- See Also:
encodeChanges(PK, int)
-
decodeChangeTypes
public static int decodeChangeTypes(byte[] encodedChanges)
Decoded changes from encoded changes byte array.- Returns:
- the type change information
- See Also:
encodeChanges(PK, int)
-
createEventsFromChanges
public static java.util.Collection<AfterSaveEvent> createEventsFromChanges(byte[][] changes)
Creates the effective set ofAfterSaveEvent
objects from a array of encoded changes ( which are byte arrays as well).Please note that unnecessary change types are silently removed.
- Returns:
- all
AfterSaveEvent
s
-
createEventsFromChanges
public static java.util.Collection<AfterSaveEvent> createEventsFromChanges(byte[][] changes, boolean removeUnnecessaryTypes)
Creates the effective set ofAfterSaveEvent
objects from a array of encoded changes ( which are byte arrays as well).- Parameters:
removeUnnecessaryTypes
- iftrue
change types that are considered unnecessary are not translated into events. These are: any UPDATE which has a matching REMOVE; any UPDATE that has a matching CREATE and no REMOVE.- Returns:
- all
AfterSaveEvent
s
-
-