com.plumtree.server
Interface IPTScheduler

All Superinterfaces:
IPTUnknown

public interface IPTScheduler
extends IPTUnknown

Version:
$Revision$
Author:
Mike Sample

Method Summary
 void AssignJobFolder(java.lang.String bstrJobServer, int lJobFolderID)
          Assigns an admin folder to an existing Job Server
 java.lang.Object[] CreateJobHistoryEntry(int nJobID, com.plumtree.openfoundation.util.XPDateTime dtRunTime, java.lang.String bstrJobServer, int lInstanceID)
          These methods add an entry into the job history table as well as operations that occur during job processing.
 void DeleteJobHistory(com.plumtree.openfoundation.util.XPDateTime OlderThan)
          Deletes entries from the history table and any associated log files as well.
 java.lang.Object[][] GetPage(int lPageNumber)
          Returns entries comprising the page for the requested page number.
 IPTObjectManager GetScheduledJobs()
          Returns an IPTJobManager interface
 void KillRunningJob(int nJobID, int SoftKillTimeoutInSeconds)
          Sends a kill request signal to a running job
 void LogOperationToJobHistory(java.lang.Object[] pvJHToken, int nOperationClassID, int nOperationObjectID, java.lang.String bstrOperationObjectName, int nResult, java.lang.String bstrMessage)
          Logs an operation run during a job.
 int OpenLogForRead(int lInstanceID, int lLinesPerPage)
          Opens a job log for purposes of reading lines through subsequent calls to GetPage.
 int OpenLogForSearch(int lInstanceID, int lLinesPerPage, java.lang.String bstrText)
          Conducts a search against an existing job log.
 IPTQueryResult QueryJobAssignmentsByFolder(int lJobFolderID)
          Queries for job servers that are assigned to a job folder.
 IPTQueryResult QueryJobAssignmentsByServer(java.lang.String bstrJobServer)
          Queries for job folders that are assigned to a job server.
 IPTQueryResult QueryJobHistory(com.plumtree.openfoundation.util.XPDateTime FromDate, com.plumtree.openfoundation.util.XPDateTime ToDate, int JobID)
          This returns a query result with a list of jobid/runtime pairs (as well as other information)
 IPTQueryResult QueryJobsByOperation(int nOpClassID, int nOpObjectID)
          Query for the jobs a particular operation object is in.
 IPTQueryResult QueryJobServerStatus(java.lang.String bstrServerName)
          Queries the status for a given Job Server
 IPTQueryResult QueryOperationHistoryByJob(int nJobID, com.plumtree.openfoundation.util.XPDateTime dtRunTime)
          Query for operation history ran within the specified job at the time requested.
 IPTQueryResult QueryOperationHistoryByObject(com.plumtree.openfoundation.util.XPDateTime FromDate, com.plumtree.openfoundation.util.XPDateTime ToDate, int Class, int ObjectID)
          Query for operation history ran by a specific object or class of objects (ie, crawlers).
 IPTQueryResult QueryServerSchedule(java.lang.String bstrServerName)
          Retrieves the list of jobs a server should run and their next runtimes
 void RegisterJobServer(java.lang.String bstrJobServer, java.lang.String bstrNetAddress)
          Registers a job processing server machine.
 void UnassignJobFolder(java.lang.String bstrJobServer, int lJobFolderID)
          Removes an administrative folder from a Job Server's purview
 void UnregisterJobServer(java.lang.String bstrJobServer)
          Removes a Job Server machine from the known list of servers.
 void UpdateJobHistoryEntry(java.lang.Object[] pvJHToken, com.plumtree.openfoundation.util.XPDateTime dtEndTime, int nStatus, java.lang.String bstrMessage, int lInstanceID)
          Updates an existing Job History Entry to reflect current status.
 void UpdateJobServerStatus(java.lang.String bstrJobServer, int nStatus)
          Updates the status of the given Job Server machine
 
Methods inherited from interface com.plumtree.server.IPTUnknown
GetInterfaces
 

Method Detail

GetScheduledJobs

IPTObjectManager GetScheduledJobs()
Returns an IPTJobManager interface

Returns:
an IPTJobManager

QueryServerSchedule

IPTQueryResult QueryServerSchedule(java.lang.String bstrServerName)
Retrieves the list of jobs a server should run and their next runtimes

Parameters:
bstrServerName - The name of the server whose schedule is being queried.
Returns:
an IPTQueryResult containing the object ID, name, and next runtime for relevant jobs

QueryJobHistory

IPTQueryResult QueryJobHistory(com.plumtree.openfoundation.util.XPDateTime FromDate,
                               com.plumtree.openfoundation.util.XPDateTime ToDate,
                               int JobID)
This returns a query result with a list of jobid/runtime pairs (as well as other information)

Parameters:
FromDate - The XPDateTime from which the query will begin
ToDate - The XPDateTime to which the query will end
JobID - The relevant Job object ID
Returns:
an IPTQueryResult with requested job history entries

QueryOperationHistoryByObject

IPTQueryResult QueryOperationHistoryByObject(com.plumtree.openfoundation.util.XPDateTime FromDate,
                                             com.plumtree.openfoundation.util.XPDateTime ToDate,
                                             int Class,
                                             int ObjectID)
Query for operation history ran by a specific object or class of objects (ie, crawlers).

Parameters:
FromDate - The XPDateTime from which the query will begin
ToDate - The XPDateTime to which the query will end
Class - The Class ID of the operation
ObjectID - The Object ID of the operation
Returns:
an IPTQueryResult with requested operation history entries

QueryOperationHistoryByJob

IPTQueryResult QueryOperationHistoryByJob(int nJobID,
                                          com.plumtree.openfoundation.util.XPDateTime dtRunTime)
Query for operation history ran within the specified job at the time requested.

Parameters:
nJobID - The Job ID containing the operation being queried.
dtRunTime - The XPDateTime for the time this job ran.
Returns:
an IPTQueryResult with requested operation history entries

DeleteJobHistory

void DeleteJobHistory(com.plumtree.openfoundation.util.XPDateTime OlderThan)
Deletes entries from the history table and any associated log files as well.

Parameters:
OlderThan - The XPDateTime before which, all job histories will be removed.

CreateJobHistoryEntry

java.lang.Object[] CreateJobHistoryEntry(int nJobID,
                                         com.plumtree.openfoundation.util.XPDateTime dtRunTime,
                                         java.lang.String bstrJobServer,
                                         int lInstanceID)
These methods add an entry into the job history table as well as operations that occur during job processing. The schedule service should generally be the only client to use this. There should be start and stop entries for the job itself and entries for each entry in the job list.

Parameters:
nJobID - The affected Job ID
dtRunTime - The XPDateTime marking the launch time
bstrJobServer - The name of the Job Server launching this job
lInstanceID - The instance ID of this particular launch
Returns:
An array of two Objects, the Job ID, and its launch time

UpdateJobHistoryEntry

void UpdateJobHistoryEntry(java.lang.Object[] pvJHToken,
                           com.plumtree.openfoundation.util.XPDateTime dtEndTime,
                           int nStatus,
                           java.lang.String bstrMessage,
                           int lInstanceID)
Updates an existing Job History Entry to reflect current status.

Parameters:
pvJHToken - An array of two Objects identifying this entry, Job ID, and launch time
dtEndTime - An XPDateTime marking Job termination
nStatus - PT_JOBSTATUS
bstrMessage - Readable summary of Job execution
lInstanceID - Instance ID corresponding to execution

LogOperationToJobHistory

void LogOperationToJobHistory(java.lang.Object[] pvJHToken,
                              int nOperationClassID,
                              int nOperationObjectID,
                              java.lang.String bstrOperationObjectName,
                              int nResult,
                              java.lang.String bstrMessage)
Logs an operation run during a job.

Parameters:
pvJHToken - An array of two Objects identifying this entry, Job ID, and launch time
nOperationClassID - The Class ID of the operation
nOperationObjectID - The Object ID of the operation
bstrOperationObjectName - Name of the operation
nResult - a PT_RESULTCODES entry
bstrMessage - Readable summary for operation status

RegisterJobServer

void RegisterJobServer(java.lang.String bstrJobServer,
                       java.lang.String bstrNetAddress)
Registers a job processing server machine.

Parameters:
bstrJobServer - Name of new Job Server machine
bstrNetAddress - Network address of machine

UnregisterJobServer

void UnregisterJobServer(java.lang.String bstrJobServer)
Removes a Job Server machine from the known list of servers.

Parameters:
bstrJobServer - The name of the Job Server to be removed

UpdateJobServerStatus

void UpdateJobServerStatus(java.lang.String bstrJobServer,
                           int nStatus)
Updates the status of the given Job Server machine

Parameters:
bstrJobServer - The name of the Job Server machine whose status will be updated
nStatus - a PT_JOBSERVERSTATUS member

QueryJobServerStatus

IPTQueryResult QueryJobServerStatus(java.lang.String bstrServerName)
Queries the status for a given Job Server

Parameters:
bstrServerName - The name of the requested Job Server or to get all registered job servers.
Returns:
an IPTQueryResult containing the PT_JOBSERVERSTATUS for this server

QueryJobAssignmentsByServer

IPTQueryResult QueryJobAssignmentsByServer(java.lang.String bstrJobServer)
Queries for job folders that are assigned to a job server.

Parameters:
bstrJobServer - Name of the relevant Job Server
Returns:
Query result contains PT_PROPID_NAME and PT_PROPID_FOLDERID.

QueryJobAssignmentsByFolder

IPTQueryResult QueryJobAssignmentsByFolder(int lJobFolderID)
Queries for job servers that are assigned to a job folder.

Parameters:
lJobFolderID - The ID of the admin folder being queried
Returns:
Query result contains PT_PROPID_JOBSERVER_SERVERNAME, PT_PROPID_FOLDERID and PT_PROPID_NAME.

AssignJobFolder

void AssignJobFolder(java.lang.String bstrJobServer,
                     int lJobFolderID)
Assigns an admin folder to an existing Job Server

Parameters:
bstrJobServer - Name of the Job Server to monitor this folder
lJobFolderID - The ID of the administrative folder to be monitored.

UnassignJobFolder

void UnassignJobFolder(java.lang.String bstrJobServer,
                       int lJobFolderID)
Removes an administrative folder from a Job Server's purview

Parameters:
bstrJobServer - The name of the Job Server
lJobFolderID - The ID of the administrative folder to be removed

KillRunningJob

void KillRunningJob(int nJobID,
                    int SoftKillTimeoutInSeconds)
Sends a kill request signal to a running job

Parameters:
nJobID - The ID of the Job targeted for termination
SoftKillTimeoutInSeconds - The number of seconds after which a hard kill will commence.

QueryJobsByOperation

IPTQueryResult QueryJobsByOperation(int nOpClassID,
                                    int nOpObjectID)
Query for the jobs a particular operation object is in. Filters on job object security. Returns the job id, name, folder, last runtime, and next runtime PROPIDs in the query result

Parameters:
nOpClassID - Class ID of the operation
nOpObjectID - Object ID of the operation
Returns:
an IPTQueryResult containing relevant Job information

OpenLogForRead

int OpenLogForRead(int lInstanceID,
                   int lLinesPerPage)
Opens a job log for purposes of reading lines through subsequent calls to GetPage.

Parameters:
lInstanceID - The instance ID of the desired job log
lLinesPerPage - The number of log lines returned from each call to GetPage
Returns:
The number of pages computed to be in this log.

GetPage

java.lang.Object[][] GetPage(int lPageNumber)
Returns entries comprising the page for the requested page number. The first dimension is returned as columns, page number, line number, and line content. The second dimension contains an element per line of the requested page.

Parameters:
lPageNumber - The page number from the open log.
Returns:
The content within the requested page

OpenLogForSearch

int OpenLogForSearch(int lInstanceID,
                     int lLinesPerPage,
                     java.lang.String bstrText)
Conducts a search against an existing job log. Results are retrieved through an iteration of GetPage calls.

Parameters:
lInstanceID - The instance ID for the target log.
lLinesPerPage - The desired page size of search results.
bstrText - The text used in the search
Returns:
The number of search result pages.