Class GcGrouperSyncJob
java.lang.Object
edu.internet2.middleware.grouperClient.jdbc.tableSync.GcGrouperSyncJob
- All Implemented Interfaces:
GcDbVersionable
,GcSqlAssignPrimaryKey
Status of all jobs for the sync. one record for full, one for incremental, etc
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
assignHeartbeatAndCheckForPendingJobs
(boolean isLargeJob) assign heartbeat and see if other jobs are pending or runningvoid
assign heartbeat and end jobclone()
deep clone the fields in this objectvoid
db versionboolean
if we need to update this objectvoid
take a snapshot of the data since this is what is in the dbboolean
equalsDeep
(Object obj) boolean
assign a new primary key for insert.connection name or null for defaultif the last sync had an error, this is the error messagethis the last sync had an error, this was the error timestampuuid of the job in grouper_syncheartbeat updated every minutegetId()
uuid of this record in this tablerunning, waitingForAnotherJobToFinish (if waiting for another job to finish), notRunningint of last record checkedwhen last sync startedwhen last record processed if timestamp and not integerlast time a record was processedwhen this record was last updated0-100 percent complete of the jobquartz job name if applicabletype of sync, e.g.boolean
if heartbeat is alive and wellstatic void
static void
reset()
delete all data if table is herevoid
setConnectionName
(String connectionName1) connection name or null for defaultvoid
setErrorMessage
(String errorMessage1) if the last sync had an error, this is the error messagevoid
setErrorTimestamp
(Timestamp errorTimestamp1) this the last sync had an error, this was the error timestampvoid
setGrouperSync
(GcGrouperSync gcGrouperSync) void
setGrouperSyncId
(String grouperSyncId1) uuid of the job in grouper_syncvoid
setHeartbeat
(Timestamp heartbeat1) heatbeat updated every minutevoid
uuid of this record in this tablevoid
setJobState
(GcGrouperSyncJobState gcGrouperSyncJobState) void
setJobStateDb
(String jobState1) running, waitingForAnotherJobToFinish (if waiting for another job to finish), notRunningvoid
setLastSyncIndex
(Long lastSyncIndexOrMillis1) int of last record checkedvoid
setLastSyncStart
(Timestamp lastSyncStart) when last sync startedvoid
setLastSyncTimestamp
(Timestamp lastSyncTimestamp1) when last record processed if timestamp and not integervoid
setLastTimeWorkWasDone
(Timestamp lastTimeWorkWasDone1) last time a record was processedvoid
setLastUpdated
(Timestamp lastUpdated1) when this record was last updatedvoid
setPercentComplete
(Integer percentComplete1) 0-100 percent complete of the jobvoid
setQuartzJobName
(String quartzJobName1) quartz job name if applicablevoid
setSyncType
(String syncType) type of sync, e.g.void
run this before storingtoString()
void
waitForRelatedJobsToFinishThenRun
(boolean goToPendingFirstAkaLargeJob) wait for related jobs to finish running, then run.
-
Constructor Details
-
GcGrouperSyncJob
public GcGrouperSyncJob()
-
-
Method Details
-
dbVersionReset
public void dbVersionReset()take a snapshot of the data since this is what is in the db- Specified by:
dbVersionReset
in interfaceGcDbVersionable
-
dbVersionDifferent
public boolean dbVersionDifferent()if we need to update this object- Specified by:
dbVersionDifferent
in interfaceGcDbVersionable
- Returns:
- if needs to update this object
-
dbVersionDelete
public void dbVersionDelete()db version- Specified by:
dbVersionDelete
in interfaceGcDbVersionable
-
clone
deep clone the fields in this object -
equalsDeep
-
isHeartBeatAlive
public boolean isHeartBeatAlive()if heartbeat is alive and well- Returns:
- true if heartbeat is valid (heartbeat in last 1.5 minutes)
-
getPercentComplete
0-100 percent complete of the job- Returns:
- percent complete
-
setPercentComplete
0-100 percent complete of the job- Parameters:
percentComplete1
-
-
getQuartzJobName
quartz job name if applicable- Returns:
- quartz job name
-
setQuartzJobName
quartz job name if applicable- Parameters:
quartzJobName1
-
-
reset
public static void reset()delete all data if table is here -
storePrepare
public void storePrepare()run this before storing -
getErrorMessage
if the last sync had an error, this is the error message- Returns:
- error message
-
setErrorMessage
if the last sync had an error, this is the error message- Parameters:
errorMessage1
-
-
getErrorTimestamp
this the last sync had an error, this was the error timestamp- Returns:
- error timestamp
-
setErrorTimestamp
this the last sync had an error, this was the error timestamp- Parameters:
errorTimestamp1
-
-
getGrouperSync
- Returns:
- gc grouper sync
-
setGrouperSync
- Parameters:
gcGrouperSync
-
-
getConnectionName
connection name or null for default- Returns:
- connection name
-
setConnectionName
connection name or null for default- Parameters:
connectionName1
-
-
main
- Parameters:
args
-
-
toString
-
getHeartbeat
heartbeat updated every minute- Returns:
- heartbeat
-
setHeartbeat
heatbeat updated every minute- Parameters:
heartbeat1
-
-
getId
uuid of this record in this table- Returns:
- the id
-
setId
uuid of this record in this table- Parameters:
id1
- the id to set
-
getSyncType
type of sync, e.g. for sql sync this is the job subtype- Returns:
- sync type
-
setSyncType
type of sync, e.g. for sql sync this is the job subtype- Parameters:
syncType
-
-
getGrouperSyncId
uuid of the job in grouper_sync- Returns:
- uuid of the job in grouper_sync
-
setGrouperSyncId
uuid of the job in grouper_sync- Parameters:
grouperSyncId1
-
-
getJobStateDb
running, waitingForAnotherJobToFinish (if waiting for another job to finish), notRunning- Returns:
- the jobState
-
getJobState
- Returns:
- the state or null if not there
-
setJobState
- Parameters:
gcGrouperSyncJobState
-
-
setJobStateDb
running, waitingForAnotherJobToFinish (if waiting for another job to finish), notRunning- Parameters:
jobState1
- the jobState to set
-
getLastSyncStart
when last sync started- Returns:
-
setLastSyncStart
when last sync started- Parameters:
lastSyncStart
-
-
getLastSyncTimestamp
when last record processed if timestamp and not integer- Returns:
- when processed
-
setLastSyncTimestamp
when last record processed if timestamp and not integer- Parameters:
lastSyncTimestamp1
-
-
getLastSyncIndex
int of last record checked- Returns:
- the lastSyncIndexOrMillis
-
setLastSyncIndex
int of last record checked- Parameters:
lastSyncIndexOrMillis1
- the lastSyncIndexOrMillis to set
-
getLastTimeWorkWasDone
last time a record was processed- Returns:
- the lastTimeWorkWasDone
-
setLastTimeWorkWasDone
last time a record was processed- Parameters:
lastTimeWorkWasDone1
- the lastTimeWorkWasDone to set
-
getLastUpdated
when this record was last updated- Returns:
- the lastUpdated
-
setLastUpdated
when this record was last updated- Parameters:
lastUpdated1
- the lastUpdated to set
-
gcSqlAssignNewPrimaryKeyForInsert
public boolean gcSqlAssignNewPrimaryKeyForInsert()Description copied from interface:GcSqlAssignPrimaryKey
assign a new primary key for insert. return true if assigned (insert) or false if not needed- Specified by:
gcSqlAssignNewPrimaryKeyForInsert
in interfaceGcSqlAssignPrimaryKey
-
assignHeartbeatAndCheckForPendingJobs
public boolean assignHeartbeatAndCheckForPendingJobs(boolean isLargeJob) assign heartbeat and see if other jobs are pending or running- Parameters:
provisionerName
-isLargeJob
- is if this is a big job and has precendence- Returns:
- false if should stop and true if should run
-
assignHeartbeatAndEndJob
public void assignHeartbeatAndEndJob()assign heartbeat and end job -
waitForRelatedJobsToFinishThenRun
public void waitForRelatedJobsToFinishThenRun(boolean goToPendingFirstAkaLargeJob) wait for related jobs to finish running, then run. note you should get the job again afterwards so its up to date- Parameters:
provisionerName
-goToPendingFirstAkaLargeJob
- is if this is a big job and needs to register as pending first so it knows it should run now. false if quick job and doesnt matter
-