java.lang.Object
edu.internet2.middleware.grouperClient.jdbc.tableSync.GcGrouperSyncJob
All Implemented Interfaces:
GcDbVersionable, GcSqlAssignPrimaryKey

public class GcGrouperSyncJob extends Object implements GcSqlAssignPrimaryKey, GcDbVersionable
Status of all jobs for the sync. one record for full, one for incremental, etc
  • 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 interface GcDbVersionable
    • dbVersionDifferent

      public boolean dbVersionDifferent()
      if we need to update this object
      Specified by:
      dbVersionDifferent in interface GcDbVersionable
      Returns:
      if needs to update this object
    • dbVersionDelete

      public void dbVersionDelete()
      db version
      Specified by:
      dbVersionDelete in interface GcDbVersionable
    • clone

      public GcGrouperSyncJob clone()
      deep clone the fields in this object
      Overrides:
      clone in class Object
    • equalsDeep

      public boolean equalsDeep(Object obj)
    • isHeartBeatAlive

      public boolean isHeartBeatAlive()
      if heartbeat is alive and well
      Returns:
      true if heartbeat is valid (heartbeat in last 1.5 minutes)
    • getPercentComplete

      public Integer getPercentComplete()
      0-100 percent complete of the job
      Returns:
      percent complete
    • setPercentComplete

      public void setPercentComplete(Integer percentComplete1)
      0-100 percent complete of the job
      Parameters:
      percentComplete1 -
    • getQuartzJobName

      public String getQuartzJobName()
      quartz job name if applicable
      Returns:
      quartz job name
    • setQuartzJobName

      public void setQuartzJobName(String quartzJobName1)
      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

      public String getErrorMessage()
      if the last sync had an error, this is the error message
      Returns:
      error message
    • setErrorMessage

      public void setErrorMessage(String errorMessage1)
      if the last sync had an error, this is the error message
      Parameters:
      errorMessage1 -
    • getErrorTimestamp

      public Timestamp getErrorTimestamp()
      this the last sync had an error, this was the error timestamp
      Returns:
      error timestamp
    • setErrorTimestamp

      public void setErrorTimestamp(Timestamp errorTimestamp1)
      this the last sync had an error, this was the error timestamp
      Parameters:
      errorTimestamp1 -
    • getGrouperSync

      public GcGrouperSync getGrouperSync()
      Returns:
      gc grouper sync
    • setGrouperSync

      public void setGrouperSync(GcGrouperSync gcGrouperSync)
      Parameters:
      gcGrouperSync -
    • getConnectionName

      public String getConnectionName()
      connection name or null for default
      Returns:
      connection name
    • setConnectionName

      public void setConnectionName(String connectionName1)
      connection name or null for default
      Parameters:
      connectionName1 -
    • main

      public static void main(String[] args)
      Parameters:
      args -
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getHeartbeat

      public Timestamp getHeartbeat()
      heartbeat updated every minute
      Returns:
      heartbeat
    • setHeartbeat

      public void setHeartbeat(Timestamp heartbeat1)
      heatbeat updated every minute
      Parameters:
      heartbeat1 -
    • getId

      public String getId()
      uuid of this record in this table
      Returns:
      the id
    • setId

      public void setId(String id1)
      uuid of this record in this table
      Parameters:
      id1 - the id to set
    • getSyncType

      public String getSyncType()
      type of sync, e.g. for sql sync this is the job subtype
      Returns:
      sync type
    • setSyncType

      public void setSyncType(String syncType)
      type of sync, e.g. for sql sync this is the job subtype
      Parameters:
      syncType -
    • getGrouperSyncId

      public String getGrouperSyncId()
      uuid of the job in grouper_sync
      Returns:
      uuid of the job in grouper_sync
    • setGrouperSyncId

      public void setGrouperSyncId(String grouperSyncId1)
      uuid of the job in grouper_sync
      Parameters:
      grouperSyncId1 -
    • getJobStateDb

      public String getJobStateDb()
      running, waitingForAnotherJobToFinish (if waiting for another job to finish), notRunning
      Returns:
      the jobState
    • getJobState

      public GcGrouperSyncJobState getJobState()
      Returns:
      the state or null if not there
    • setJobState

      public void setJobState(GcGrouperSyncJobState gcGrouperSyncJobState)
      Parameters:
      gcGrouperSyncJobState -
    • setJobStateDb

      public void setJobStateDb(String jobState1)
      running, waitingForAnotherJobToFinish (if waiting for another job to finish), notRunning
      Parameters:
      jobState1 - the jobState to set
    • getLastSyncStart

      public Timestamp getLastSyncStart()
      when last sync started
      Returns:
    • setLastSyncStart

      public void setLastSyncStart(Timestamp lastSyncStart)
      when last sync started
      Parameters:
      lastSyncStart -
    • getLastSyncTimestamp

      public Timestamp getLastSyncTimestamp()
      when last record processed if timestamp and not integer
      Returns:
      when processed
    • setLastSyncTimestamp

      public void setLastSyncTimestamp(Timestamp lastSyncTimestamp1)
      when last record processed if timestamp and not integer
      Parameters:
      lastSyncTimestamp1 -
    • getLastSyncIndex

      public Long getLastSyncIndex()
      int of last record checked
      Returns:
      the lastSyncIndexOrMillis
    • setLastSyncIndex

      public void setLastSyncIndex(Long lastSyncIndexOrMillis1)
      int of last record checked
      Parameters:
      lastSyncIndexOrMillis1 - the lastSyncIndexOrMillis to set
    • getLastTimeWorkWasDone

      public Timestamp getLastTimeWorkWasDone()
      last time a record was processed
      Returns:
      the lastTimeWorkWasDone
    • setLastTimeWorkWasDone

      public void setLastTimeWorkWasDone(Timestamp lastTimeWorkWasDone1)
      last time a record was processed
      Parameters:
      lastTimeWorkWasDone1 - the lastTimeWorkWasDone to set
    • getLastUpdated

      public Timestamp getLastUpdated()
      when this record was last updated
      Returns:
      the lastUpdated
    • setLastUpdated

      public void setLastUpdated(Timestamp lastUpdated1)
      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 interface GcSqlAssignPrimaryKey
    • 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