sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1043351 - /sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/jobs/JobUtil.java
Date Wed, 08 Dec 2010 10:56:57 GMT
Author: cziegeler
Date: Wed Dec  8 10:56:57 2010
New Revision: 1043351

URL: http://svn.apache.org/viewvc?rev=1043351&view=rev
Log:
SLING-1889 : Make job creation date available

Modified:
    sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/jobs/JobUtil.java

Modified: sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/jobs/JobUtil.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/jobs/JobUtil.java?rev=1043351&r1=1043350&r2=1043351&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/jobs/JobUtil.java
(original)
+++ sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/jobs/JobUtil.java
Wed Dec  8 10:56:57 2010
@@ -18,6 +18,8 @@
  */
 package org.apache.sling.event.jobs;
 
+import java.util.Calendar;
+
 import org.apache.sling.commons.threads.ThreadPool;
 import org.apache.sling.event.impl.jobs.JobStatusNotifier;
 import org.apache.sling.event.impl.support.Environment;
@@ -90,6 +92,12 @@ public abstract class JobUtil {
     public static final String PROPERTY_JOB_PRIORITY = "event.job.priority";
 
     /**
+     * This property is set by the eventing and contains a calendar object
+     * specifying the date and time when this job has been created.
+     */
+    public static final String PROPERTY_JOB_CREATED = "slingevent:created";
+
+    /**
      * The priority for jobs.
      */
     public enum JobPriority {
@@ -292,6 +300,15 @@ public abstract class JobUtil {
         }
     }
 
+    /**
+     * Get the created calendar object.
+     * @param job The job event
+     * @return The created info or <code>null</code> if this is not a job event.
+     */
+    public static Calendar getJobCreated(final Event job) {
+        return (Calendar) job.getProperty(PROPERTY_JOB_CREATED);
+    }
+
     private JobUtil() {
         // avoid instantiation
     }



Mime
View raw message