Package com.ads.api.util

# Class SchedulerUtil

java.lang.Object
com.ads.api.util.BaseUtil
com.ads.api.util.SchedulerUtil

public class SchedulerUtil extends com.ads.api.util.BaseUtil
Contains the methods related to perform the operations such as creation, update, deletion and retrieval of Scheduler Jobs.

RequestStatus as return type methods will result in being returned as either true or false as its status.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class com.ads.api.util.BaseUtil

  `com.ads.api.util.BaseUtil.TokenType`

- ## Field Summary

  ### Fields inherited from class com.ads.api.util.BaseUtil

  `AUTH_TOKEN, AUTH_TOKEN_TYPE`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `RequestStatus`
  `clearJobs(String objectType, long objectId)`
  Clears the Jobs for the specified objectType and objectId.Specifying the objectType and objectId are mandatory to clear the Jobs
  If the Jobs are deleted all its associated Data will also be deleted.
  `RequestStatus`
  `clearJobs(String objectType, long objectId, APIConstants.JOBType jobType)`
  Clears the Jobs for the specified objectType,objectId and jobType Specifying the objectType,objectId and jobType are mandatory to clear the Jobs
  If the Jobs are deleted all its associated Data will also be deleted.
  `String`
  `clearJobsAs(String objectType, long objectId, String outputFormat)`
  Deletes the Jobs for the specified objectType and objectId.Specifying the objectType and objectId are mandatory to delete Jobs
  If the Jobs are deleted all its associated data will also be deleted.
  `String`
  `clearJobsByJobTypeAs(String objectType, long objectId, String jobType, String outputFormat)`
  Deletes the Jobs for the specified objectType, objectId and jobType Specifying the objectType,objectId and jobType are mandatory to delete Jobs
  If the Jobs are deleted all its associated data will also be deleted.
  `RequestStatus`
  `createJob(SchedulerJob schedulerJob)`
  Creates the Job for the given schedulerJob Object.
  `String`
  `createJobAs(String jobDetails, String outputFormat)`
  Creates the Job for the given jobDetails Object i.e in the form of JSON.
  `RequestStatus`
  `createJobs(List<SchedulerJob> schedulerJobs)`
  Creates the list of Jobs for the given List Objects.
  `String`
  `createJobsAs(String jobsDetails, String outputFormat)`
  Creates the list of Jobs for the given List Objects i.e in the form of JSONArray.
  `RequestStatus`
  `deleteJob(String objectType, String jobName)`
  Deletes the Job with the specified objectType and jobName.Specifying the objectType and jobName are mandatory to delete a particular Job
  If the Job is deleted all its associated Data will also be deleted.
  `String`
  `deleteJobAs(String objectType, String jobName, String outputFormat)`
  Deletes the Job with the specified objectType and jobName.Specifying the objectType and jobName are mandatory to delete a particular Job
  If the Job is deleted all its associated data will also be deleted.
  `SchedulerJob`
  `getJob(String objectType, String jobName)`
  Returns the schedulerJob object for the specified objectType and jobName.Specifying the objectType and jobName are mandatory
  It returns all the details like JobName, JobGroup, Description, JobClassName and JobData.
  `String`
  `getJobAs(String objectType, String jobName, String outputFormat)`
  Returns the schedulerJob object for the specified objectType and jobName.Specifying the objectType and jobName are mandatory.
  `List<SchedulerJob>`
  `getJobs(String objectType, long objectId)`
  Returns the List objects for the specified objectType and objectId.
  `List<SchedulerJob>`
  `getJobs(String objectType, long objectId, APIConstants.JOBType jobType)`
  Returns the List objects for the specified objectType , objectId, and jobType.
  `String`
  `getJobsAs(String objectType, long objectId, String outputFormat)`
  Returns the List objects for the specified objectType and objectId.
  `String`
  `getJobsAs(String objectType, long objectId, String jobType, String outputFormat)`
  Returns the List objects for the specified objectType, objectId, and jobType.
  `RequestStatus`
  `updateJob(SchedulerJob schedulerJob)`
  Updates the Job with the specified schedulerJob Object.All the information pertaining to the Job can be updated.
  `String`
  `updateJobAs(String jobDetails, String outputFormat)`
  Updates the Job with the specified jobDetails Object i.e in the form of JSON.All the information pertaining to the Job can be updated.
  `RequestStatus`
  `updateJobs(List<SchedulerJob> schedulerJobs)`
  Updates the list of Jobs for the given List Objects.
  `String`
  `updateJobsAs(String jobsDetails, String outputFormat)`
  Updates the list of Jobs for the given List Objects i.e in the form of JSONArray.

  ### Methods inherited from class com.ads.api.util.BaseUtil

  `getAccessToken, getAccessTokenType, getTokenType, getUserDetails, permissionDeniedMessage, permissionDeniedStatus, setAccessToken, setAccessTokenType`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### createJob

    public RequestStatus createJob(SchedulerJob schedulerJob) throws Exception
    Creates the Job for the given schedulerJob Object. Specifying the JobName is mandatory, while creating the SchedulerJob.
    If schedulerJob is created successfully, RequestStatus.isRequestSuccess() will return true otherwise false.
    Parameters:
      `schedulerJob` - SchedulerJob
    Returns:
      RequestStatus object
    Throws:
      `Exception`
    Since:
      10.1

  - ### createJobs

    public RequestStatus createJobs(List<SchedulerJob> schedulerJobs) throws com.ads.api.exceptions.DAOException
    Creates the list of Jobs for the given List Objects. Specifying the JobName is mandatory and there should no duplicate jobNames in the given list while creating the SchedulerJobs.
    If the jobs are created successfully, RequestStatus.isRequestSuccess() will return true otherwise false.
    Parameters:
      `schedulerJobs` - list
    Returns:
      RequestStatus object
    Throws:
      `com.ads.api.exceptions.DAOException`
    Since:
      10.1

  - ### updateJob

    public RequestStatus updateJob(SchedulerJob schedulerJob) throws com.ads.api.exceptions.DAOException
    Updates the Job with the specified schedulerJob Object.All the information pertaining to the Job can be updated. Specifying the JobName and ObjectType, are mandatory to update the Job.
    If Job details are updated successfully, RequestStatus.isRequestSuccess() will return true otherwise false.
    Parameters:
      `schedulerJob` - SchedulerJob Object
    Returns:
      RequestStatus object
    Throws:
      `com.ads.api.exceptions.DAOException`
    Since:
      10.1

  - ### updateJobs

    public RequestStatus updateJobs(List<SchedulerJob> schedulerJobs) throws com.ads.api.exceptions.DAOException
    Updates the list of Jobs for the given List Objects. All the information pertaining to the Job can be updated. Specifying the JobName and ObjectType, are mandatory to update the Jobs.
    If Job details are updated successfully, RequestStatus.isRequestSuccess() will return true otherwise false.
    Parameters:
      `schedulerJobs` - list
    Returns:
      RequestStatus object
    Throws:
      `com.ads.api.exceptions.DAOException`
    Since:
      10.1

  - ### getJob

    public SchedulerJob getJob(String objectType, String jobName) throws com.ads.api.exceptions.DAOException
    Returns the schedulerJob object for the specified objectType and jobName.Specifying the objectType and jobName are mandatory
    It returns all the details like JobName, JobGroup, Description, JobClassName and JobData.
    Parameters:
      `objectType` - String
      `jobName` - String
    Returns:
      SchedulerJob Object
    Throws:
      `com.ads.api.exceptions.DAOException`
    Since:
      10.1

  - ### getJobs

    public List<SchedulerJob> getJobs(String objectType, long objectId) throws com.ads.api.exceptions.DAOException
    Returns the List objects for the specified objectType and objectId. Specifying the objectType and objectId are mandatory.
    It returns List of SchedulerJob Objects containing the details like JobName, JobGroup, Description, JobClassName and JobData.
    Parameters:
      `objectType` - String
      `objectId` - long
    Returns:
      List Objects
    Throws:
      `com.ads.api.exceptions.DAOException`
    Since:
      10.1

  - ### getJobs

    public List<SchedulerJob> getJobs(String objectType, long objectId, APIConstants.JOBType jobType) throws com.ads.api.exceptions.DAOException
    Returns the List objects for the specified objectType , objectId, and jobType. Specifying the objectType, objectId and jobType are mandatory.
    It returns List of SchedulerJob Objects containing the details like JobName, JobGroup, Description, JobClassName and JobData.
    Parameters:
      `objectType` - String
      `objectId` - long
      `jobType` - JOBType
    Returns:
      List Objects
    Throws:
      `com.ads.api.exceptions.DAOException`
    Since:
      10.1

  - ### deleteJob

    public RequestStatus deleteJob(String objectType, String jobName) throws com.ads.api.exceptions.DAOException
    Deletes the Job with the specified objectType and jobName.Specifying the objectType and jobName are mandatory to delete a particular Job
    If the Job is deleted all its associated Data will also be deleted.
    If Job is deleted successfully, RequestStatus.isRequestSuccess() will return true otherwise false.
    Parameters:
      `objectType` - String
      `jobName` - String
    Returns:
      RequestStatus object
    Throws:
      `com.ads.api.exceptions.DAOException`
    Since:
      10.1

  - ### clearJobs

    public RequestStatus clearJobs(String objectType, long objectId) throws com.ads.api.exceptions.DAOException
    Clears the Jobs for the specified objectType and objectId.Specifying the objectType and objectId are mandatory to clear the Jobs
    If the Jobs are deleted all its associated Data will also be deleted.
    If Jobs are deleted successfully, RequestStatus.isRequestSuccess() will return true otherwise false.
    Parameters:
      `objectType` - String
      `objectId` - long
    Returns:
      RequestStatus object
    Throws:
      `com.ads.api.exceptions.DAOException`
    Since:
      10.1

  - ### clearJobs

    public RequestStatus clearJobs(String objectType, long objectId, APIConstants.JOBType jobType) throws com.ads.api.exceptions.DAOException
    Clears the Jobs for the specified objectType,objectId and jobType Specifying the objectType,objectId and jobType are mandatory to clear the Jobs
    If the Jobs are deleted all its associated Data will also be deleted.
    If Jobs are deleted successfully, RequestStatus.isRequestSuccess() will return true otherwise false.
    Parameters:
      `objectType` - String
      `objectId` - long
      `jobType` - JOBType
    Returns:
      RequestStatus object
    Throws:
      `com.ads.api.exceptions.DAOException`
    Since:
      10.1

  - ### createJobAs

    public String createJobAs(String jobDetails, String outputFormat)
    Creates the Job for the given jobDetails Object i.e in the form of JSON. Specifying the jobName, objectId, objectType and jobType are mandatory, while creating the Job.
    Specification of the outputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.
    Parameters:
      `jobDetails` - String
      `outputFormat` - String
    Returns:
      String - If Job is created successfully, it will return RequestStatus Object consisting of request success flag, status message and userObject etc... in the form of JSON or XML String.

      Sample 'jobDetailsObjJson' JSON : *
      {
      "objectId": "",
      "objectType": "",
      "jobName": "",
      "jobType": "",
      "scheduledDateTime": "",
      "lastScheduledRunDateTime": "",
      "nextScheduledRunDateTime": "",
      "jobOptions": { "catalogSelection": {"": [] }, "splitter": "_" }, "interval": "ONCE",
      "notify": "",
      "userId": "",
      "emailId": "",
      "ccList": "",
      "auditHistory": {}
      }

    Since:
      10.1

  - ### createJobsAs

    public String createJobsAs(String jobsDetails, String outputFormat)
    Creates the list of Jobs for the given List Objects i.e in the form of JSONArray. Specifying the jobName,objectId, objectType and jobType are mandatory. There should no duplicate jobNames in the given list against the same objectId while creatingSchedulerJobs.
    Specification of the outputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.
    Parameters:
      `jobsDetails` - String
      `outputFormat` - String
    Returns:
      String - If Jobs are created successfully, it will return RequestStatus Object consisting of request success flag, status message and userObject etc... in the form of JSON or XML String.

      Sample 'jobsDetailsObjsJsonArray' JSON : *
      [{
      "objectId": "",
      "objectType": "",
      "jobName": "",
      "jobType": "",
      "scheduledDateTime": "",
      "lastScheduledRunDateTime": "",
      "nextScheduledRunDateTime": "",
      "jobOptions": { "catalogSelection": {"": [] }, "splitter": "_" }, "interval": "ONCE",
      "notify": "",
      "userId": "",
      "emailId": "",
      "ccList": "",
      "auditHistory": {}
      },
      {
      "objectId": "",
      "objectType": "",
      "jobName": "",
      "jobType": "",
      "scheduledDateTime": "",
      "lastScheduledRunDateTime": "",
      "nextScheduledRunDateTime": "",
      "jobOptions": { "catalogSelection": {"": [] }, "splitter": "_" }, "interval": "ONCE",
      "notify": "",
      "userId": "",
      "emailId": "",
      "ccList": "",
      "auditHistory": {}
      }]

    Since:
      10.1

  - ### updateJobAs

    public String updateJobAs(String jobDetails, String outputFormat)
    Updates the Job with the specified jobDetails Object i.e in the form of JSON.All the information pertaining to the Job can be updated. Specifying the jobName, objectId, objectType and jobType are mandatory to update the Job.
    Specification of the outputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.
    Parameters:
      `jobDetails` - String
      `outputFormat` - String
    Returns:
      String - If Job is updated successfully, it will return RequestStatus Object consisting of request success flag, status message and userObject etc... in the form of JSON or XML String.

      Sample 'jobDetailsObjJson' JSON : *
      {
      "objectId": "",
      "objectType": "",
      "jobName": "",
      "jobType": "",
      "scheduledDateTime": "",
      "lastScheduledRunDateTime": "",
      "nextScheduledRunDateTime": "",
      "jobOptions": { "catalogSelection": {"": [] }, "splitter": "_" }, "interval": "ONCE",
      "notify": "",
      "userId": "",
      "emailId": "",
      "ccList": "",
      "auditHistory": {}
      }

    Since:
      10.1

  - ### updateJobsAs

    public String updateJobsAs(String jobsDetails, String outputFormat)
    Updates the list of Jobs for the given List Objects i.e in the form of JSONArray. All the information pertaining to the Job can be updated. Specifying the jobName, objectId, objectType and jobType are mandatory to update the Jobs. There should no duplicate jobNames in the given list against the same objectId.
    Specification of the outputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.
    Parameters:
      `jobsDetails` - String
      `outputFormat` - String
    Returns:
      String - If Jobs are updated successfully, it will return RequestStatus Object consisting of request success flag, status message and userObject etc... in the form of JSON or XML String.

      Sample 'jobsDetailsObjsJsonArray' JSON : *
      [{
      "objectId": "",
      "objectType": "",
      "jobName": "",
      "jobType": "",
      "scheduledDateTime": "",
      "lastScheduledRunDateTime": "",
      "nextScheduledRunDateTime": "",
      "jobOptions": { "catalogSelection": {"": [] }, "splitter": "_" }, "interval": "ONCE",
      "notify": "",
      "userId": "",
      "emailId": "",
      "ccList": "",
      "auditHistory": {}
      },
      {
      "objectId": "",
      "objectType": "",
      "jobName": "",
      "jobType": "",
      "scheduledDateTime": "",
      "lastScheduledRunDateTime": "",
      "nextScheduledRunDateTime": "",
      "jobOptions": { "catalogSelection": {"": [] }, "splitter": "_" }, "interval": "ONCE",
      "notify": "",
      "userId": "",
      "emailId": "",
      "ccList": "",
      "auditHistory": {}
      }]

    Since:
      10.1

  - ### getJobAs

    public String getJobAs(String objectType, String jobName, String outputFormat)
    Returns the schedulerJob object for the specified objectType and jobName.Specifying the objectType and jobName are mandatory.
    It returns all the details like JobName, JobGroup, Description, JobClassName and JobData etc..
    Specification of the outputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.
    Parameters:
      `objectType` - String
      `jobName` - String
      `outputFormat` - String
    Returns:
      String
    Since:
      10.1

  - ### getJobsAs

    public String getJobsAs(String objectType, long objectId, String outputFormat)
    Returns the List objects for the specified objectType and objectId. Specifying the objectType and objectId are mandatory.
    It returns List of SchedulerJob objects containing the details like JobName, JobGroup, Description, JobClassName and JobData.
    Specification of the outputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.
    Parameters:
      `objectType` - String
      `objectId` - long
      `outputFormat` - String
    Returns:
      String
    Since:
      10.1

  - ### getJobsAs

    public String getJobsAs(String objectType, long objectId, String jobType, String outputFormat)
    Returns the List objects for the specified objectType, objectId, and jobType. Specifying the objectType, objectId and jobType are mandatory.
    It returns List of SchedulerJob objects containing the details like JobName, JobGroup, Description, JobClassName and JobData.
    Specification of the outputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.
    Parameters:
      `objectType` - String
      `objectId` - long
      `jobType` - String
      `outputFormat` - String
    Returns:
      String
    Since:
      10.1

  - ### deleteJobAs

    public String deleteJobAs(String objectType, String jobName, String outputFormat)
    Deletes the Job with the specified objectType and jobName.Specifying the objectType and jobName are mandatory to delete a particular Job
    If the Job is deleted all its associated data will also be deleted.
    Specification of the outputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.
    Parameters:
      `objectType` - String
      `jobName` - String
      `outputFormat` - String
    Returns:
      String
    Since:
      10.1

  - ### clearJobsAs

    public String clearJobsAs(String objectType, long objectId, String outputFormat)
    Deletes the Jobs for the specified objectType and objectId.Specifying the objectType and objectId are mandatory to delete Jobs
    If the Jobs are deleted all its associated data will also be deleted.
    Specification of the outputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.
    Parameters:
      `objectType` - String
      `objectId` - String
      `outputFormat` - String
    Returns:
      String
    Since:
      10.1

  - ### clearJobsByJobTypeAs

    public String clearJobsByJobTypeAs(String objectType, long objectId, String jobType, String outputFormat)
    Deletes the Jobs for the specified objectType, objectId and jobType Specifying the objectType,objectId and jobType are mandatory to delete Jobs
    If the Jobs are deleted all its associated data will also be deleted.
    Specification of the outputFormat can be either JSON or XML. If outputFormat is not specified, by default the method will return the JSON String.
    Parameters:
      `objectType` - String
      `objectId` - String
      `jobType` - String
      `outputFormat` - String
    Returns:
      String
    Since:
      10.1