servicenow.community.sql
Class JobCollection

java.lang.Object
  extended by servicenow.community.sql.JobCollection

public class JobCollection
extends java.lang.Object

Contains a collection of jobs as loaded from a script file or from a u_datapump_jobset in the ServiceNow instance.

Author:
LewisGF

Field Summary
protected  java.util.LinkedList<JobController> jobs
           
protected  GlideDateTime runstart
           
 
Constructor Summary
JobCollection(Pumper pumper)
           
 
Method Summary
 void addJob(GlideRecord rec)
           
 void addJob(java.lang.String command)
           
 void cancel()
           
 int defaultFrequency()
           
 GlideDateTime getRunStart()
           
 void loadJobSet(java.lang.String jobsetname)
           
 void loadScriptFile(java.lang.String filename)
           
 int numJobs()
           
 int numReady()
           
 boolean persistent()
           
 boolean polling()
           
 void resetAll()
           
 void resumeAll()
           
 void run()
           
 void runAll()
           
 void runJobs()
          Run each job once, if it is ready.
 void setStatus(JobStatus status)
           
 GlideDateTime startRunning()
           
 void verifyTimeZone()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jobs

protected java.util.LinkedList<JobController> jobs

runstart

protected GlideDateTime runstart
Constructor Detail

JobCollection

public JobCollection(Pumper pumper)
Method Detail

addJob

public void addJob(GlideRecord rec)
            throws PumperException,
                   java.io.IOException,
                   java.sql.SQLException,
                   org.jdom2.JDOMException,
                   java.text.ParseException
Throws:
PumperException
java.io.IOException
java.sql.SQLException
org.jdom2.JDOMException
java.text.ParseException

addJob

public void addJob(java.lang.String command)
            throws PumperException,
                   java.io.IOException,
                   java.sql.SQLException,
                   org.jdom2.JDOMException
Throws:
PumperException
java.io.IOException
java.sql.SQLException
org.jdom2.JDOMException

loadJobSet

public void loadJobSet(java.lang.String jobsetname)
                throws java.lang.Exception
Throws:
java.lang.Exception

loadScriptFile

public void loadScriptFile(java.lang.String filename)
                    throws PumperException,
                           java.io.IOException,
                           org.jdom2.JDOMException,
                           java.sql.SQLException
Throws:
PumperException
java.io.IOException
org.jdom2.JDOMException
java.sql.SQLException

persistent

public boolean persistent()

polling

public boolean polling()

numJobs

public int numJobs()

defaultFrequency

public int defaultFrequency()

getRunStart

public GlideDateTime getRunStart()

verifyTimeZone

public void verifyTimeZone()
                    throws java.io.IOException,
                           java.text.ParseException,
                           PumperException
Throws:
java.io.IOException
java.text.ParseException
PumperException

startRunning

public GlideDateTime startRunning()
                           throws java.io.IOException,
                                  java.text.ParseException
Throws:
java.io.IOException
java.text.ParseException

setStatus

public void setStatus(JobStatus status)
               throws java.io.IOException
Throws:
java.io.IOException

numReady

public int numReady()

resetAll

public void resetAll()
              throws java.io.IOException
Throws:
java.io.IOException

resumeAll

public void resumeAll()
               throws java.io.IOException
Throws:
java.io.IOException

cancel

public void cancel()
            throws java.io.IOException
Throws:
java.io.IOException

run

public void run()

runAll

public void runAll()
            throws java.lang.Exception
Throws:
java.lang.Exception

runJobs

public void runJobs()
             throws java.lang.Exception
Run each job once, if it is ready.

Throws:
java.lang.Exception