You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2013/10/16 14:57:33 UTC
svn commit: r1532751 - in
/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event:
impl/jobs/JobManagerImpl.java impl/jobs/Utility.java
jobs/NotificationConstants.java
Author: cziegeler
Date: Wed Oct 16 12:57:33 2013
New Revision: 1532751
URL: http://svn.apache.org/r1532751
Log:
SLING-3170 : Complex Job Result Structures
Modified:
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/Utility.java
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/jobs/NotificationConstants.java
Modified: sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java?rev=1532751&r1=1532750&r2=1532751&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java (original)
+++ sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java Wed Oct 16 12:57:33 2013
@@ -788,6 +788,7 @@ public class JobManagerImpl
} else {
logger.debug("Unable to remove job with id - resource already removed: {}", jobId);
}
+ Utility.sendNotification(this.eventAdmin, NotificationConstants.TOPIC_JOB_REMOVED, job, null);
} catch ( final LoginException le ) {
this.ignoreException(le);
result = false;
Modified: sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/Utility.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/Utility.java?rev=1532751&r1=1532750&r2=1532751&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/Utility.java (original)
+++ sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/Utility.java Wed Oct 16 12:57:33 2013
@@ -143,7 +143,7 @@ public abstract class Utility {
eventProps.put(NotificationConstants.NOTIFICATION_PROPERTY_JOB_ID, job.getId());
eventProps.put(NotificationConstants.NOTIFICATION_PROPERTY_JOB_TOPIC, job.getTopic());
if ( job.getName() != null ) {
- eventProps.put(NotificationConstants.NOTIFICATION_PROPERTY_JOB_NAME, job.getName());
+ eventProps.put(JobUtil.NOTIFICATION_PROPERTY_JOB_NAME, job.getName());
}
// copy payload
for(final String name : job.getPropertyNames()) {
Modified: sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/jobs/NotificationConstants.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/jobs/NotificationConstants.java?rev=1532751&r1=1532750&r2=1532751&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/jobs/NotificationConstants.java (original)
+++ sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/jobs/NotificationConstants.java Wed Oct 16 12:57:33 2013
@@ -28,8 +28,7 @@ public abstract class NotificationConsta
/**
* Asynchronous notification event when a job is started.
* The property {@link #NOTIFICATION_PROPERTY_JOB_TOPIC} contains the job topic,
- * the property {@link #NOTIFICATION_PROPERTY_JOB_NAME} might contain the job name,
- * and the property {@link #NOTIFICATION_PROPERTY_JOB_ID} contains the unique job id.
+ * the property {@link #NOTIFICATION_PROPERTY_JOB_ID} contains the unique job id.
* The time stamp of the event (as a Long) is available from the property
* {@link org.osgi.service.event.EventConstants#TIMESTAMP}.
* The payload of the job is available as additional job specific properties.
@@ -39,8 +38,7 @@ public abstract class NotificationConsta
/**
* Asynchronous notification event when a job is finished.
* The property {@link #NOTIFICATION_PROPERTY_JOB_TOPIC} contains the job topic,
- * the property {@link #NOTIFICATION_PROPERTY_JOB_NAME} might contain the job name,
- * and the property {@link #NOTIFICATION_PROPERTY_JOB_ID} contains the unique job id.
+ * the property {@link #NOTIFICATION_PROPERTY_JOB_ID} contains the unique job id.
* The time stamp of the event (as a Long) is available from the property
* {@link org.osgi.service.event.EventConstants#TIMESTAMP}.
* The payload of the job is available as additional job specific properties.
@@ -51,20 +49,18 @@ public abstract class NotificationConsta
* Asynchronous notification event when a job failed.
* If a job execution fails, it is rescheduled for another try.
* The property {@link #NOTIFICATION_PROPERTY_JOB_TOPIC} contains the job topic,
- * the property {@link #NOTIFICATION_PROPERTY_JOB_NAME} might contain the job name,
- * and the property {@link #NOTIFICATION_PROPERTY_JOB_ID} contains the unique job id.
+ * the property {@link #NOTIFICATION_PROPERTY_JOB_ID} contains the unique job id.
* The time stamp of the event (as a Long) is available from the property
* {@link org.osgi.service.event.EventConstants#TIMESTAMP}.
* The payload of the job is available as additional job specific properties.
*/
public static final String TOPIC_JOB_FAILED = "org/apache/sling/event/notification/job/FAILED";
- /** A
- * synchronous notification event when a job is cancelled.
+ /**
+ * Asynchronous notification event when a job is cancelled.
* If a job execution is cancelled it is not rescheduled.
* The property {@link #NOTIFICATION_PROPERTY_JOB_TOPIC} contains the job topic,
- * the property {@link #NOTIFICATION_PROPERTY_JOB_NAME} might contain the job name,
- * and the property {@link #NOTIFICATION_PROPERTY_JOB_ID} contains the unique job id.
+ * the property {@link #NOTIFICATION_PROPERTY_JOB_ID} contains the unique job id.
* The time stamp of the event (as a Long) is available from the property
* {@link org.osgi.service.event.EventConstants#TIMESTAMP}.
* The payload of the job is available as additional job specific properties.
@@ -72,16 +68,18 @@ public abstract class NotificationConsta
public static final String TOPIC_JOB_CANCELLED = "org/apache/sling/event/notification/job/CANCELLED";
/**
- * Property containing the job topic. Value is of type String.
- * @see Job#getTopic()
+ * Asynchronous notification event when a job is permanently removed.
+ * The property {@link #NOTIFICATION_PROPERTY_JOB_TOPIC} contains the job topic,
+ * the property {@link #NOTIFICATION_PROPERTY_JOB_ID} contains the unique job id.
+ * The payload of the job is available as additional job specific properties.
*/
- public static final String NOTIFICATION_PROPERTY_JOB_TOPIC = "event.job.topic";
+ public static final String TOPIC_JOB_REMOVED = "org/apache/sling/event/notification/job/REMOVED";
/**
- * Property containing the optional job name. Value is of type String.
- * @see Job#getName()
+ * Property containing the job topic. Value is of type String.
+ * @see Job#getTopic()
*/
- public static final String NOTIFICATION_PROPERTY_JOB_NAME = "event.job.id";
+ public static final String NOTIFICATION_PROPERTY_JOB_TOPIC = "event.job.topic";
/**
* Property containing the unique job ID. Value is of type String.