org.apache.openjpa.event
Class RemoteCommitEvent

java.lang.Object
  extended by org.apache.openjpa.event.RemoteCommitEvent
All Implemented Interfaces:
Externalizable, Serializable

public class RemoteCommitEvent
extends Object
implements Externalizable

Event 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
static int PAYLOAD_EXTENTS
          Names of added, updated, and deleted classes only.
static int PAYLOAD_LOCAL_STALE_DETECTION
          The local BrokerFactory detected that local data is out of date with the data store.
static int PAYLOAD_OIDS
          Names of added classes, updated and deleted Object IDs.
static int PAYLOAD_OIDS_WITH_ADDS
          Names of added classes, added, updated and deleted Object IDs.
 
Constructor Summary
RemoteCommitEvent()
          Constructor used during externalization.
RemoteCommitEvent(int payloadType, Collection addIds, Collection addClasses, Collection updates, Collection deletes)
          Constructor.
 
Method Summary
 Collection getDeletedObjectIds()
          When the event type is not PAYLOAD_EXTENTS, return the set of object IDs for deleted objects.
 Collection getDeletedTypeNames()
          When the event type is PAYLOAD_EXTENTS, return the set of class names for the classes of deleted objects.
 int getPayloadType()
          The event PAYLOAD constant.
 Collection getPersistedObjectIds()
          When the event type is PAYLOAD_OIDS_WITH_ADDS, return the set of object IDs for added objects.
 Collection getPersistedTypeNames()
          For all event types, return the set of class names for the classes of inserted objects.
 Collection getUpdatedObjectIds()
          When the event type is not PAYLOAD_EXTENTS, return the set of object IDs for updated objects.
 Collection getUpdatedTypeNames()
          When the event type is PAYLOAD_EXTENTS, return the set of class names for the classes of updated objects.
 void readExternal(ObjectInput in)
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 local BrokerFactory detected 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,
                         Collection addIds,
                         Collection addClasses,
                         Collection updates,
                         Collection deletes)
Constructor. All collections will be proxied with unmodifiable views.

Parameters:
payloadType - PAYLOAD constant for type of data in this event
addIds - set of object IDs for added instances, or null
addClasses - set of class names for added instances
updates - set of class names or object IDs for updated instances
deletes - set of class names or object IDs for deleted instances
Method Detail

getPayloadType

public int getPayloadType()
The event PAYLOAD constant.


getPersistedObjectIds

public 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 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 Collection getDeletedObjectIds()
When the event type is not PAYLOAD_EXTENTS, return the set of object IDs for deleted objects.


getPersistedTypeNames

public Collection getPersistedTypeNames()
For all event types, return the set of class names for the classes of inserted objects.


getUpdatedTypeNames

public Collection getUpdatedTypeNames()
When the event type is PAYLOAD_EXTENTS, return the set of class names for the classes of updated objects.


getDeletedTypeNames

public 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(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException
Specified by:
readExternal in interface Externalizable
Throws:
IOException


Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.