public class Event extends AbstractEvent
Event.java
provides methods that operate on XEP Events
(storing events, creating a query, setting a filter, indexing etc)GENERATED_KEYS, INDEX_MODE_ASYNC_OFF, INDEX_MODE_ASYNC_ON, INDEX_MODE_SYNC, indexMode, MAX_BUFFER_SIZE, NO_ID_KEYS, UPDATE_INDEXES, USER_KEYS
Modifier and Type | Method and Description |
---|---|
void |
close()
Releases all resources held by this event.
|
<E> EventQuery<E> |
createQuery(String sqlText)
Create a EventQuery instance.
|
void |
deleteObject(long id)
Deletes an object given its database id.
|
void |
deleteObject(Object[] idkeys)
Deletes an object given its IDKEY.
|
boolean |
exists(com.intersystems.xep.internal.AbstractClassInfo classInfo,
Object[] ids)
Note: This method is for internal use only.
|
com.intersystems.xep.internal.ClassInfo |
getClassInfo() |
ListReader |
getData(com.intersystems.xep.internal.AbstractClassInfo classInfo,
Object[] ids)
Note: This method is for internal use only.
|
static Object[] |
getIdValues(Object object,
com.intersystems.xep.internal.ClassInfo classInfo,
boolean simple)
For internal use only
|
Object |
getObject(long id)
Retrieves an object given its database id.
|
Object |
getObject(Object[] idkeys)
Gets an object given its IDKEY.
|
protected void |
initIndexing() |
static void |
isEvent(Object objectOrClass)
Checks whether an object (or class) is an event in the XEP sense.
|
void |
parallelStore(Object[] objects,
int splitFactor)
Stores an array of Java objects taking advantage of java.util.concurrent
utilities for potential insert performance speedup.
|
void |
runBulkFetchTask(com.intersystems.xep.internal.ClassInfo classInfo,
int start,
int end)
Note: This method is for internal use only.
|
void |
runBulkStoreTask(int idKeyType,
com.intersystems.xep.internal.ClassInfo classInfo,
int objectCount)
Note: This method is for internal use only.
|
void |
runSerializeTask(Object[] objects,
com.intersystems.xep.internal.ClassInfo classInfo,
int start,
int end)
Note: This method is for internal use only.
|
void |
runStoreTask(Object[] objects,
com.intersystems.xep.internal.ClassInfo classInfo)
Note: This method is for internal use only.
|
void |
setData(com.intersystems.xep.internal.AbstractClassInfo classInfo,
byte[] data,
int length,
Object[] idKeys)
Note: This method is for internal use only.
|
void |
startIndexing()
Start populating indexes asynchronously.
|
void |
stopIndexing()
Stop populating indexes asynchronously.
|
long |
store(Object object)
Stores the Java object.
|
long[] |
store(Object[] objects)
Stores an array of Java objects.
|
void |
updateObject(long id,
Object object)
Updates an existing object given its database id.
|
void |
updateObject(Object[] idkeys,
Object object)
Updates an object given its IDKEY.
|
boolean |
waitForIndexing(int timeout)
Wait for asynchronous indexing to be completed for this class.
|
bulkStore, storeSimpleObjectArray
public static void isEvent(Object objectOrClass)
objectOrClass
- java object or class objectXEPException
- if the supplied object/class is an event in the XEP sensepublic static Object[] getIdValues(Object object, com.intersystems.xep.internal.ClassInfo classInfo, boolean simple)
object
- objectclassInfo
- classInfosimple
- simplepublic final void close()
public final long store(Object object)
object
- Java object to be savedpublic final long[] store(Object[] objects)
objects
- array of Java objects to be savedpublic final void parallelStore(Object[] objects, int splitFactor)
objects
- array of Java objects to be savedsplitFactor
- number of parallel tasks used to serialize the datapublic final <E> EventQuery<E> createQuery(String sqlText)
E
- typesqlText
- SQL textpublic final Object getObject(long id)
id
- database idpublic final void updateObject(long id, Object object)
id
- database idobject
- new objectpublic final void deleteObject(long id)
id
- database idpublic final Object getObject(Object[] idkeys)
idkeys
- composite IDKEYXEPException
- if the underlying class has no composite IDKEYs
or if any of the keys supplied is equal to null
or of an invalid typepublic final void updateObject(Object[] idkeys, Object object)
idkeys
- composite IDKEYobject
- object to be updatedXEPException
- if the underlying class has no composite IDKEYs
or if any of the keys supplied is equal to null
or of an invalid typepublic final void deleteObject(Object[] idkeys)
idkeys
- composite IDKEYXEPException
- if the underlying class has no composite IDKEYs
or if any of the keys supplied is equal to null
or of an invalid typepublic final void startIndexing()
public final void stopIndexing()
public final boolean waitForIndexing(int timeout)
timeout
- Seconds to wait before timing out, -1 for no timeout (wait forever)public ListReader getData(com.intersystems.xep.internal.AbstractClassInfo classInfo, Object[] ids)
classInfo
- classInfoids
- idspublic boolean exists(com.intersystems.xep.internal.AbstractClassInfo classInfo, Object[] ids)
classInfo
- classInfoids
- id valuespublic void setData(com.intersystems.xep.internal.AbstractClassInfo classInfo, byte[] data, int length, Object[] idKeys)
classInfo
- classInfodata
- datalength
- lengthidKeys
- id keysprotected void initIndexing()
public void runBulkStoreTask(int idKeyType, com.intersystems.xep.internal.ClassInfo classInfo, int objectCount) throws Exception
idKeyType
- id key typeclassInfo
- class infoobjectCount
- object countException
- throws Exceptionpublic void runStoreTask(Object[] objects, com.intersystems.xep.internal.ClassInfo classInfo) throws Exception
objects
- objectsclassInfo
- class infoException
- throws Exceptionpublic final void runSerializeTask(Object[] objects, com.intersystems.xep.internal.ClassInfo classInfo, int start, int end) throws InterruptedException
objects
- objectsclassInfo
- class infostart
- startend
- endInterruptedException
- throws InterruptedExceptionpublic void runBulkFetchTask(com.intersystems.xep.internal.ClassInfo classInfo, int start, int end) throws Exception
classInfo
- class infostart
- startend
- endException
- throws Exceptionpublic com.intersystems.xep.internal.ClassInfo getClassInfo()
getClassInfo
in class AbstractEvent
© 2024 InterSystems Corporation, Cambridge, MA. All rights reserved. Privacy & Terms Guarantee Accessibility