org.apache.sling.event.impl.jobs
Class Utility

java.lang.Object
  extended by org.apache.sling.event.impl.jobs.Utility

public abstract class Utility
extends Object


Field Summary
static String PROPERTY_LOCK_CREATED
           
static String PROPERTY_LOCK_CREATED_APP
           
static String PROPERTY_TIME
          Event property containing the time for job start and job finished events.
static String RESOURCE_TYPE_LOCK
           
 
Constructor Summary
Utility()
           
 
Method Summary
static String checkJobTopic(Object jobTopic)
          Check the job topic.
static void sendNotification(org.osgi.service.event.EventAdmin eventAdmin, String eventTopic, Job job, Long time)
          Helper method for sending the notification events.
static void sendNotification(org.osgi.service.event.EventAdmin eventAdmin, String eventTopic, String jobTopic, String jobName, Map<String,Object> jobProperties, Long time)
          Helper method for sending the notification events.
static org.osgi.service.event.Event toEvent(Job job)
          Create an event from a job
static String toString(Job job)
          Improved toString method for a job.
static String toString(String jobTopic, String name, Map<String,Object> properties)
          Improved toString method for a job.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_LOCK_CREATED

public static final String PROPERTY_LOCK_CREATED
See Also:
Constant Field Values

PROPERTY_LOCK_CREATED_APP

public static final String PROPERTY_LOCK_CREATED_APP
See Also:
Constant Field Values

RESOURCE_TYPE_LOCK

public static final String RESOURCE_TYPE_LOCK
See Also:
Constant Field Values

PROPERTY_TIME

public static final String PROPERTY_TIME
Event property containing the time for job start and job finished events.

See Also:
Constant Field Values
Constructor Detail

Utility

public Utility()
Method Detail

checkJobTopic

public static String checkJobTopic(Object jobTopic)
Check the job topic.

Returns:
null if the topic is correct, otherwise an error description is returned

sendNotification

public static void sendNotification(org.osgi.service.event.EventAdmin eventAdmin,
                                    String eventTopic,
                                    String jobTopic,
                                    String jobName,
                                    Map<String,Object> jobProperties,
                                    Long time)
Helper method for sending the notification events.


sendNotification

public static void sendNotification(org.osgi.service.event.EventAdmin eventAdmin,
                                    String eventTopic,
                                    Job job,
                                    Long time)
Helper method for sending the notification events.


toEvent

public static org.osgi.service.event.Event toEvent(Job job)
Create an event from a job

Parameters:
job - The job
Returns:
New event object.

toString

public static String toString(String jobTopic,
                              String name,
                              Map<String,Object> properties)
Improved toString method for a job. This method prints out the job topic and all of the properties.


toString

public static String toString(Job job)
Improved toString method for a job. This method prints out the job topic and all of the properties.



Copyright © 2007-2013 The Apache Software Foundation. All Rights Reserved.