|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ofbiz.entityext.synchronization.EntitySyncContext
public class EntitySyncContext
Entity Engine Sync Services
Nested Class Summary | |
---|---|
static class |
EntitySyncContext.SyncAbortException
This class signifies an abort condition, so the state and such of the EntitySync value in the datasource should not be changed |
static class |
EntitySyncContext.SyncDataErrorException
This class signifies an error condition, so the state of the EntitySync value and the EntitySyncHistory value in the datasource should be changed to reflect the error |
static class |
EntitySyncContext.SyncErrorException
|
static class |
EntitySyncContext.SyncOtherErrorException
This class signifies an error condition, so the state of the EntitySync value and the EntitySyncHistory value in the datasource should be changed to reflect the error |
static class |
EntitySyncContext.SyncServiceErrorException
This class signifies an error condition, so the state of the EntitySync value and the EntitySyncHistory value in the datasource should be changed to reflect the error |
Constructor Summary | |
---|---|
EntitySyncContext(DispatchContext dctx,
java.util.Map<java.lang.String,? extends java.lang.Object> context)
|
Method Summary | |
---|---|
void |
advanceRunTimes()
|
java.util.LinkedList<GenericEntity> |
assembleKeysToRemove()
|
java.util.ArrayList<GenericValue> |
assembleValuesToCreate()
|
java.util.ArrayList<GenericValue> |
assembleValuesToStore()
|
void |
createInitialHistory()
create history record, target service should run in own tx |
protected static java.sql.Timestamp |
getCurrentRunStartTime(java.sql.Timestamp lastSuccessfulSynchTime,
java.util.List<ModelEntity> entityModelToUseList,
GenericDelegator delegator)
|
static java.util.Set |
getEntitySyncModelNamesToUse(LocalDispatcher dispatcher,
java.lang.String entitySyncId)
Static method to obtain a list of entity names which will be synchronized |
protected static long |
getMaxRunningNoUpdateMillis(GenericValue entitySync)
|
protected java.sql.Timestamp |
getNextRunEndTime()
|
protected static long |
getOfflineSyncSplitMillis(GenericValue entitySync)
|
protected static long |
getSyncEndBufferMillis(GenericValue entitySync)
|
protected static long |
getSyncSplitMillis(GenericValue entitySync)
|
boolean |
hasMoreTimeToSync()
|
boolean |
isEntitySyncRunning()
To see if it is running check: - in the running status - AND when the entitySync was last updated, and if it was more than maxRunningNoUpdateMillis ago, then don't consider it to be running |
protected java.util.List<ModelEntity> |
makeEntityModelToUseList()
prepare a list of all entities we want to synchronize: remove all view-entities and all entities that don't match the patterns attached to this EntitySync |
java.util.Set<java.lang.String> |
makeEntityNameToUseSet()
|
void |
runOfflineStartRunning()
|
void |
runPullStartOrRestoreSavedResults()
|
void |
runPushSendData(java.util.ArrayList<GenericValue> valuesToCreate,
java.util.ArrayList<GenericValue> valuesToStore,
java.util.List<GenericEntity> keysToRemove)
|
void |
runPushStartRunning()
|
void |
runSaveOfflineSyncInfo(long rowsInSplit)
|
void |
saveFinalSyncResults()
|
void |
saveResultsReportedFromDataStore()
|
void |
saveSyncErrorInfo(java.lang.String runStatusId,
java.util.List<java.lang.Object> errorMessages)
|
protected void |
setCurrentRunEndTime()
|
void |
setSplitStartTime()
|
long |
setTotalRowCounts(java.util.ArrayList<GenericValue> valuesToCreate,
java.util.ArrayList<GenericValue> valuesToStore,
java.util.List<GenericEntity> keysToRemove)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String module
public static final long defaultSyncSplitMillis
public static final long defaultOfflineSyncSplitMillis
public static final long defaultSyncEndBufferMillis
public static final long defaultMaxRunningNoUpdateMillis
public GenericDelegator delegator
public LocalDispatcher dispatcher
public java.util.Map<java.lang.String,? extends java.lang.Object> context
public GenericValue userLogin
public boolean isOfflineSync
public java.lang.String entitySyncId
public GenericValue entitySync
public java.lang.String targetServiceName
public java.lang.String targetDelegatorName
public java.sql.Timestamp syncEndStamp
public long offlineSyncSplitMillis
public long syncSplitMillis
public long syncEndBufferMillis
public long maxRunningNoUpdateMillis
public java.sql.Timestamp lastSuccessfulSynchTime
public java.util.List<ModelEntity> entityModelToUseList
public java.util.Set<java.lang.String> entityNameToUseSet
public java.sql.Timestamp currentRunStartTime
public java.sql.Timestamp currentRunEndTime
public java.util.Map<java.lang.String,java.sql.Timestamp> nextEntityCreateTxTime
public java.util.Map<java.lang.String,java.sql.Timestamp> nextEntityUpdateTxTime
public java.sql.Timestamp nextCreateTxTime
public java.sql.Timestamp nextUpdateTxTime
public java.sql.Timestamp nextRemoveTxTime
public java.sql.Timestamp startDate
Constructor Detail |
---|
public EntitySyncContext(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context) throws EntitySyncContext.SyncDataErrorException, EntitySyncContext.SyncAbortException
EntitySyncContext.SyncDataErrorException
EntitySyncContext.SyncAbortException
Method Detail |
---|
public boolean isEntitySyncRunning()
public boolean hasMoreTimeToSync()
protected void setCurrentRunEndTime()
protected java.sql.Timestamp getNextRunEndTime()
public void advanceRunTimes()
public void setSplitStartTime()
protected static long getSyncSplitMillis(GenericValue entitySync)
protected static long getOfflineSyncSplitMillis(GenericValue entitySync)
protected static long getSyncEndBufferMillis(GenericValue entitySync)
protected static long getMaxRunningNoUpdateMillis(GenericValue entitySync)
public void createInitialHistory() throws EntitySyncContext.SyncDataErrorException, EntitySyncContext.SyncServiceErrorException
EntitySyncContext.SyncDataErrorException
EntitySyncContext.SyncServiceErrorException
public java.util.ArrayList<GenericValue> assembleValuesToCreate() throws EntitySyncContext.SyncDataErrorException
EntitySyncContext.SyncDataErrorException
public java.util.ArrayList<GenericValue> assembleValuesToStore() throws EntitySyncContext.SyncDataErrorException
EntitySyncContext.SyncDataErrorException
public java.util.LinkedList<GenericEntity> assembleKeysToRemove() throws EntitySyncContext.SyncDataErrorException
EntitySyncContext.SyncDataErrorException
public void saveResultsReportedFromDataStore() throws EntitySyncContext.SyncDataErrorException, EntitySyncContext.SyncServiceErrorException
EntitySyncContext.SyncDataErrorException
EntitySyncContext.SyncServiceErrorException
public void saveFinalSyncResults() throws EntitySyncContext.SyncDataErrorException, EntitySyncContext.SyncServiceErrorException
EntitySyncContext.SyncDataErrorException
EntitySyncContext.SyncServiceErrorException
public java.util.Set<java.lang.String> makeEntityNameToUseSet()
protected java.util.List<ModelEntity> makeEntityModelToUseList() throws GenericEntityException
GenericEntityException
protected static java.sql.Timestamp getCurrentRunStartTime(java.sql.Timestamp lastSuccessfulSynchTime, java.util.List<ModelEntity> entityModelToUseList, GenericDelegator delegator) throws GenericEntityException
GenericEntityException
public void saveSyncErrorInfo(java.lang.String runStatusId, java.util.List<java.lang.Object> errorMessages)
public void runPushStartRunning() throws EntitySyncContext.SyncDataErrorException, EntitySyncContext.SyncServiceErrorException, EntitySyncContext.SyncAbortException
EntitySyncContext.SyncDataErrorException
EntitySyncContext.SyncServiceErrorException
EntitySyncContext.SyncAbortException
public long setTotalRowCounts(java.util.ArrayList<GenericValue> valuesToCreate, java.util.ArrayList<GenericValue> valuesToStore, java.util.List<GenericEntity> keysToRemove)
public void runPushSendData(java.util.ArrayList<GenericValue> valuesToCreate, java.util.ArrayList<GenericValue> valuesToStore, java.util.List<GenericEntity> keysToRemove) throws EntitySyncContext.SyncOtherErrorException, EntitySyncContext.SyncServiceErrorException
EntitySyncContext.SyncOtherErrorException
EntitySyncContext.SyncServiceErrorException
public void runPullStartOrRestoreSavedResults() throws EntitySyncContext.SyncDataErrorException, EntitySyncContext.SyncServiceErrorException, EntitySyncContext.SyncAbortException
EntitySyncContext.SyncDataErrorException
EntitySyncContext.SyncServiceErrorException
EntitySyncContext.SyncAbortException
public void runOfflineStartRunning() throws EntitySyncContext.SyncDataErrorException, EntitySyncContext.SyncServiceErrorException, EntitySyncContext.SyncAbortException
EntitySyncContext.SyncDataErrorException
EntitySyncContext.SyncServiceErrorException
EntitySyncContext.SyncAbortException
public void runSaveOfflineSyncInfo(long rowsInSplit) throws EntitySyncContext.SyncDataErrorException, EntitySyncContext.SyncServiceErrorException, EntitySyncContext.SyncAbortException
EntitySyncContext.SyncDataErrorException
EntitySyncContext.SyncServiceErrorException
EntitySyncContext.SyncAbortException
public static java.util.Set getEntitySyncModelNamesToUse(LocalDispatcher dispatcher, java.lang.String entitySyncId) throws EntitySyncContext.SyncDataErrorException, EntitySyncContext.SyncAbortException
EntitySyncContext.SyncDataErrorException
EntitySyncContext.SyncAbortException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |