|
IBM WebSphereTM eXtreme Scale, Release 8.6 API Specification |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.websphere.objectgrid.TimeBasedDBUpdateConfig
public class TimeBasedDBUpdateConfig
This TimeBasedDBUpdateConfig represents a configuration for a time-based database updater. A TimeBasedDBUpdateConfig object contains information on how to get the newly inserted and updated records from the database and how to update the data in the correspondent ObjectGrid maps.
Users use BackingMap.setTimeBasedDBUpdateConfig(TimeBasedDBUpdateConfig)
method
to set a TimeBasedDBUpdateConfig in the backing map configuration.
A time-based database updater periodically interacts with Java Persistence API (JPA) to get the latest changes (inserts and updates) from the database using a specific timestamp field. Therefore, a JPA provider is required to use this feature. The database here can be any backend supported by the chosen JPA provider.
The time-based database updater periodically query the database using JPA interfaces to get the JPA entities which represent the newly inserted and updated records in the database. In order to do that, every record in the database should have a "timestamp" to identify the time or sequence when the record was last updated or inserted. The "timestamp" here does not have to be in a timestamp format. It can be in an integer or long format, as long as it generates a unique increasing value.
If a TimeBasedDBUpdateConfig is defined in the BackingMap or a "timeBasedDBUpdate" element is configured for a backing map in the XML configuration, a time-based database updater is automatically launched. For the distributed ObjectGrid, it will only be launched in the partition 0.
BackingMap.setTimeBasedDBUpdateConfig(TimeBasedDBUpdateConfig)
,
Serialized FormNested Class Summary | |
---|---|
static class |
TimeBasedDBUpdateConfig.DBUpdateMode
An type of DBUpdateMode specifies how the database changes should be pushed to the ObjectGrid maps. |
Constructor Summary | |
---|---|
TimeBasedDBUpdateConfig()
|
Method Summary | |
---|---|
TimeBasedDBUpdateConfig.DBUpdateMode |
getDBUpdateMode()
|
String |
getEntityClassName()
|
JPAPropertyFactory |
getJpaPropertyFactory()
|
String |
getPersistenceUnitName()
|
String |
getTimestampField()
|
void |
readExternal(ObjectInput in)
|
void |
setDBUpdateMode(TimeBasedDBUpdateConfig.DBUpdateMode mode)
Set the time-based database update mode. |
void |
setEntityClassName(String entityClassName)
Set the entity class name used to interact with the Java Persistence API (JPA) provider. |
void |
setJpaPropertyFactory(JPAPropertyFactory map)
Set the JPA property factory to override the default persistence properties. |
void |
setPersistenceUnitName(String persistenceUnitName)
Set the JPA persistence unit name. |
void |
setTimestampField(String timestampField)
The timestamp field is a field of the entity class. |
void |
writeExternal(ObjectOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TimeBasedDBUpdateConfig()
Method Detail |
---|
public void setEntityClassName(String entityClassName)
entityClassName
- The entityClassName to set.public void setDBUpdateMode(TimeBasedDBUpdateConfig.DBUpdateMode mode)
By default, the time-based database update mode is set to TimeBasedDBUpdateConfig.DBUpdateMode.INVALIDATE_ONLY
.
mode
- the time-based database update modeTimeBasedDBUpdateConfig.DBUpdateMode
public void setPersistenceUnitName(String persistenceUnitName)
By default, the persistence unit name is the name of the first persistence unit defined in your persistence.xml file.
persistenceUnitName
- the JPA persitence unit name to set.public void setTimestampField(String timestampField)
If a timestamp field is not set, then ObjectGrid will try to get the
annotated Timestamp
from the entity class. If the annotation cannot be found, an
IllegalArgumentException will be thrown.
timestampField
- the timestamp field to set.public String getEntityClassName()
public TimeBasedDBUpdateConfig.DBUpdateMode getDBUpdateMode()
public String getPersistenceUnitName()
public String getTimestampField()
public void setJpaPropertyFactory(JPAPropertyFactory map)
map
- the overriding JPA property factorypublic JPAPropertyFactory getJpaPropertyFactory()
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
|
IBM WebSphereTM eXtreme Scale, Release 8.6 API Specification |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |