Package org.nuxeo.ecm.core.event.impl
Class ReconnectedEventBundleImpl
- java.lang.Object
-
- org.nuxeo.ecm.core.event.impl.ReconnectedEventBundleImpl
-
- All Implemented Interfaces:
Serializable,Iterable<Event>,EventBundle,ReconnectedEventBundle
public class ReconnectedEventBundleImpl extends Object implements ReconnectedEventBundle
Default implementation for anEventBundlethat need to be reconnected to a usable Session.- Author:
- tiry
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected StringlistenerNameLister name or names.protected NuxeoLoginContextloginCtxprotected CoreSessionreconnectedCoreSessionprotected List<Event>reconnectedEventsprotected EventBundlesourceEventBundle-
Fields inherited from interface org.nuxeo.ecm.core.event.ReconnectedEventBundle
SKIP_REFETCH_DOCUMENT_CONTEXT_KEY
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedReconnectedEventBundleImpl()ReconnectedEventBundleImpl(EventBundle sourceEventBundle)ReconnectedEventBundleImpl(EventBundle sourceEventBundle, String listenerName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsEventName(String eventName)Check is bundle contains the specified event.voiddisconnect()Manage cleanup after processing.List<String>getEventNames()StringgetName()Gets the bundle name.protected CoreSessiongetReconnectedCoreSession(String repoName, String originatingUsername)protected List<Event>getReconnectedEvents()VMIDgetSourceVMID()Returns the VMID of the JVM where the bundle was created.booleanhasRemoteSource()Tests whether or not this event bundle was created on a remote machine.booleanisEmpty()Tests whether or not this bundle is empty.Iterator<Event>iterator()Eventpeek()Gets the first event in that bundle.voidpush(Event event)Adds an event in that bundle at the end of the list.protected booleanrefetchDocumentModel(CoreSession session, Object eventProperty)intsize()Gets the size of that bundle.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
sourceEventBundle
protected EventBundle sourceEventBundle
-
listenerName
protected String listenerName
Lister name or names.
-
loginCtx
protected transient NuxeoLoginContext loginCtx
-
reconnectedCoreSession
protected transient CoreSession reconnectedCoreSession
-
-
Constructor Detail
-
ReconnectedEventBundleImpl
protected ReconnectedEventBundleImpl()
-
ReconnectedEventBundleImpl
public ReconnectedEventBundleImpl(EventBundle sourceEventBundle)
-
ReconnectedEventBundleImpl
public ReconnectedEventBundleImpl(EventBundle sourceEventBundle, String listenerName)
- Since:
- 5.6
-
-
Method Detail
-
getReconnectedCoreSession
protected CoreSession getReconnectedCoreSession(String repoName, String originatingUsername)
-
refetchDocumentModel
protected boolean refetchDocumentModel(CoreSession session, Object eventProperty)
-
getName
public String getName()
Description copied from interface:EventBundleGets the bundle name.This is usually the first event repository name in the bundle but the implementation may decide to change this behavior.
- Specified by:
getNamein interfaceEventBundle- Returns:
- the bundle name. Can be null only if the bundle is empty.
-
getSourceVMID
public VMID getSourceVMID()
Description copied from interface:EventBundleReturns the VMID of the JVM where the bundle was created.- Specified by:
getSourceVMIDin interfaceEventBundle
-
hasRemoteSource
public boolean hasRemoteSource()
Description copied from interface:EventBundleTests whether or not this event bundle was created on a remote machine.- Specified by:
hasRemoteSourcein interfaceEventBundle- Returns:
- true if the event bundle was fired from a remote machine, false otherwise
-
isEmpty
public boolean isEmpty()
Description copied from interface:EventBundleTests whether or not this bundle is empty.- Specified by:
isEmptyin interfaceEventBundle
-
peek
public Event peek()
Description copied from interface:EventBundleGets the first event in that bundle.- Specified by:
peekin interfaceEventBundle- Returns:
- the first event. Can be null if the bundle is empty
-
push
public void push(Event event)
Description copied from interface:EventBundleAdds an event in that bundle at the end of the list.The bundle implementation must ignore redundant events and events marked as inline.
- Specified by:
pushin interfaceEventBundle- Parameters:
event- the event to append.
-
size
public int size()
Description copied from interface:EventBundleGets the size of that bundle.- Specified by:
sizein interfaceEventBundle- Returns:
- the number of events in that bundle
-
disconnect
public void disconnect()
Description copied from interface:ReconnectedEventBundleManage cleanup after processing.- Specified by:
disconnectin interfaceReconnectedEventBundle
-
containsEventName
public boolean containsEventName(String eventName)
Description copied from interface:EventBundleCheck is bundle contains the specified event.- Specified by:
containsEventNamein interfaceEventBundle
-
-