Package org.apache.openjpa.event
Class RemoteCommitEvent
- java.lang.Object
-
- org.apache.openjpa.event.RemoteCommitEvent
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable
public class RemoteCommitEvent extends java.lang.Object implements java.io.ExternalizableEvent type to hold the IDs of additions, updates, and deletes. This event type is also fully serializable for remote communication.- Since:
- 0.3.0
- Author:
- Patrick Linskey, Abe White
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intPAYLOAD_EXTENTSNames of added, updated, and deleted classes only.static intPAYLOAD_LOCAL_STALE_DETECTIONThe localBrokerFactorydetected that local data is out of date with the data store.static intPAYLOAD_OIDSNames of added classes, updated and deleted Object IDs.static intPAYLOAD_OIDS_WITH_ADDSNames of added classes, added, updated and deleted Object IDs.
-
Constructor Summary
Constructors Constructor Description RemoteCommitEvent()Constructor used during externalization.RemoteCommitEvent(int payloadType, java.util.Collection addIds, java.util.Collection addClasses, java.util.Collection updates, java.util.Collection deletes)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.CollectiongetDeletedObjectIds()When the event type is not PAYLOAD_EXTENTS, return the set of object IDs for deleted objects.java.util.CollectiongetDeletedTypeNames()When the event type is PAYLOAD_EXTENTS, return the set of class names for the classes of deleted objects.intgetPayloadType()The event PAYLOAD constant.java.util.CollectiongetPersistedObjectIds()When the event type is PAYLOAD_OIDS_WITH_ADDS, return the set of object IDs for added objects.java.util.CollectiongetPersistedTypeNames()For all event types, return the set of class names for the classes of inserted objects.java.util.CollectiongetUpdatedObjectIds()When the event type is not PAYLOAD_EXTENTS, return the set of object IDs for updated objects.java.util.CollectiongetUpdatedTypeNames()When the event type is PAYLOAD_EXTENTS, return the set of class names for the classes of updated objects.voidreadExternal(java.io.ObjectInput in)voidwriteExternal(java.io.ObjectOutput out)
-
-
-
Field Detail
-
PAYLOAD_OIDS
public static final int PAYLOAD_OIDS
Names of added classes, updated and deleted Object IDs.- See Also:
- Constant Field Values
-
PAYLOAD_OIDS_WITH_ADDS
public static final int PAYLOAD_OIDS_WITH_ADDS
Names of added classes, added, updated and deleted Object IDs.- See Also:
- Constant Field Values
-
PAYLOAD_EXTENTS
public static final int PAYLOAD_EXTENTS
Names of added, updated, and deleted classes only.- See Also:
- Constant Field Values
-
PAYLOAD_LOCAL_STALE_DETECTION
public static final int PAYLOAD_LOCAL_STALE_DETECTION
The localBrokerFactorydetected that local data is out of date with the data store. Stale object IDs will be in t he updated set, although it is possible that records were actually deleted, rather than updated.- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RemoteCommitEvent
public RemoteCommitEvent()
Constructor used during externalization.
-
RemoteCommitEvent
public RemoteCommitEvent(int payloadType, java.util.Collection addIds, java.util.Collection addClasses, java.util.Collection updates, java.util.Collection deletes)Constructor. All collections will be proxied with unmodifiable views.- Parameters:
payloadType- PAYLOAD constant for type of data in this eventaddIds- set of object IDs for added instances, or nulladdClasses- set of class names for added instancesupdates- set of class names or object IDs for updated instancesdeletes- set of class names or object IDs for deleted instances
-
-
Method Detail
-
getPayloadType
public int getPayloadType()
The event PAYLOAD constant.
-
getPersistedObjectIds
public java.util.Collection getPersistedObjectIds()
When the event type is PAYLOAD_OIDS_WITH_ADDS, return the set of object IDs for added objects. This will only be callable when the backward compatability property transmitAddObjectIds is true.
-
getUpdatedObjectIds
public java.util.Collection getUpdatedObjectIds()
When the event type is not PAYLOAD_EXTENTS, return the set of object IDs for updated objects. When the event type is PAYLOAD_LOCAL_STALE_DETECTION, items in this list may actually have been deleted from the database.
-
getDeletedObjectIds
public java.util.Collection getDeletedObjectIds()
When the event type is not PAYLOAD_EXTENTS, return the set of object IDs for deleted objects.
-
getPersistedTypeNames
public java.util.Collection getPersistedTypeNames()
For all event types, return the set of class names for the classes of inserted objects.
-
getUpdatedTypeNames
public java.util.Collection getUpdatedTypeNames()
When the event type is PAYLOAD_EXTENTS, return the set of class names for the classes of updated objects.
-
getDeletedTypeNames
public java.util.Collection getDeletedTypeNames()
When the event type is PAYLOAD_EXTENTS, return the set of class names for the classes of deleted objects.
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException- Specified by:
writeExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException- Specified by:
readExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
-