Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.platform.audit.api.job
Class JobHistoryHelper

java.lang.Object
  extended by org.nuxeo.ecm.platform.audit.api.job.JobHistoryHelper

public class JobHistoryHelper
extends java.lang.Object

Simple helper class to trace job execution using the Audit Service.

Author:
Thierry Delprat

Field Summary
static java.lang.String JOB_ENDED_SUFFIX
           
static java.lang.String JOB_FAILED_SUFFIX
           
static java.lang.String JOB_STARTED_SUFFIX
           
 
Constructor Summary
JobHistoryHelper(java.lang.String jobName)
           
 
Method Summary
 java.util.Date getLastFailedRun()
          Gets the last date the Job was failed.
 java.util.Date getLastStarted()
          Gets the last date the Job was started.
 java.util.Date getLastSuccessfulRun()
          Gets the last date the Job was successfully run.
 void logJobEnded()
          Logs an event for a successful Job completion.
 void logJobFailed(java.lang.String errMessage)
          Logs an event for a failed Job execution.
 void logJobStarted()
          Logs an event for Job startup.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JOB_STARTED_SUFFIX

public static final java.lang.String JOB_STARTED_SUFFIX
See Also:
Constant Field Values

JOB_ENDED_SUFFIX

public static final java.lang.String JOB_ENDED_SUFFIX
See Also:
Constant Field Values

JOB_FAILED_SUFFIX

public static final java.lang.String JOB_FAILED_SUFFIX
See Also:
Constant Field Values
Constructor Detail

JobHistoryHelper

public JobHistoryHelper(java.lang.String jobName)
Method Detail

logJobStarted

public void logJobStarted()
                   throws java.lang.Exception
Logs an event for Job startup.

Throws:
java.lang.Exception

logJobEnded

public void logJobEnded()
                 throws java.lang.Exception
Logs an event for a successful Job completion.

Throws:
java.lang.Exception

logJobFailed

public void logJobFailed(java.lang.String errMessage)
                  throws java.lang.Exception
Logs an event for a failed Job execution.

Throws:
java.lang.Exception

getLastSuccessfulRun

public java.util.Date getLastSuccessfulRun()
                                    throws java.lang.Exception
Gets the last date the Job was successfully run.

Throws:
java.lang.Exception

getLastFailedRun

public java.util.Date getLastFailedRun()
                                throws java.lang.Exception
Gets the last date the Job was failed.

Throws:
java.lang.Exception

getLastStarted

public java.util.Date getLastStarted()
                              throws java.lang.Exception
Gets the last date the Job was started.

Throws:
java.lang.Exception

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.