Package org.apache.sling.event.impl.jobs
Class Utility
- java.lang.Object
-
- org.apache.sling.event.impl.jobs.Utility
-
public abstract class Utility extends Object
-
-
Constructor Summary
Constructors Constructor Description Utility()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
checkJob(Object jobTopic, Map<String,Object> properties)
Check the job.static String
checkJobTopic(Object jobTopic)
Check if the job topic is a valid OSGI event name (see 113.3.1 of the OSGI spec)static List<org.apache.sling.api.resource.Resource>
getSortedChildren(org.slf4j.Logger logger, String type, org.apache.sling.api.resource.Resource rsrc)
Helper method to read all children of a resource and sort them by namestatic JobImpl
readJob(org.slf4j.Logger logger, org.apache.sling.api.resource.Resource resource)
Read a jobstatic org.osgi.service.event.Event
toEvent(org.apache.sling.event.jobs.Job job)
Create an event from a jobstatic String
toString(String jobTopic, Map<String,Object> properties)
Improved toString method for a job.static String
toString(org.apache.sling.event.jobs.Job job)
Improved toString method for a job.
-
-
-
Method Detail
-
checkJobTopic
public static String checkJobTopic(Object jobTopic)
Check if the job topic is a valid OSGI event name (see 113.3.1 of the OSGI spec)- Returns:
null
if the topic is syntactically correct otherwise an error description is returned
-
checkJob
public static String checkJob(Object jobTopic, Map<String,Object> properties)
Check the job.- Returns:
null
if the topic topic is correct and all properties are serializable, otherwise an error description is returned
-
toEvent
public static org.osgi.service.event.Event toEvent(org.apache.sling.event.jobs.Job job)
Create an event from a job- Parameters:
job
- The job- Returns:
- New event object.
-
toString
public static String toString(String jobTopic, 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(org.apache.sling.event.jobs.Job job)
Improved toString method for a job. This method prints out the job topic and all of the properties.
-
readJob
public static JobImpl readJob(org.slf4j.Logger logger, org.apache.sling.api.resource.Resource resource)
Read a job
-
getSortedChildren
public static List<org.apache.sling.api.resource.Resource> getSortedChildren(org.slf4j.Logger logger, String type, org.apache.sling.api.resource.Resource rsrc)
Helper method to read all children of a resource and sort them by name- Parameters:
type
- The type of resources (for debugging)rsrc
- The parent resource- Returns:
- Sorted list of children.
-
-