public abstract class Utility extends Object
Modifier and Type | Field and Description |
---|---|
static boolean |
LOG_DEPRECATION_WARNINGS |
static String |
PROPERTY_LOCK_CREATED |
static String |
PROPERTY_LOCK_CREATED_APP |
static String |
RESOURCE_TYPE_LOCK |
Constructor and Description |
---|
Utility() |
Modifier and Type | Method and Description |
---|---|
static String |
checkJob(Object jobTopic,
Map<String,Object> properties)
Check the job.
|
static String |
checkJobTopic(Object jobTopic)
Check the job topic.
|
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
|
static void |
logDeprecated(org.slf4j.Logger logger,
String message)
Log a deprecation warning on level info into the log
|
static JobImpl |
readJob(org.slf4j.Logger logger,
org.apache.sling.api.resource.Resource resource)
Read a job
|
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.
|
public static final String PROPERTY_LOCK_CREATED
public static final String PROPERTY_LOCK_CREATED_APP
public static final String RESOURCE_TYPE_LOCK
public static volatile boolean LOG_DEPRECATION_WARNINGS
public static String checkJobTopic(Object jobTopic)
null
if the topic is correct, otherwise an error description is returnedpublic static String checkJob(Object jobTopic, Map<String,Object> properties)
null
if the topic topic is correct and all properties are serializable,
otherwise an error description is returnedpublic static org.osgi.service.event.Event toEvent(Job job)
job
- The jobpublic static String toString(String jobTopic, String name, Map<String,Object> properties)
public static String toString(Job job)
public static JobImpl readJob(org.slf4j.Logger logger, org.apache.sling.api.resource.Resource resource)
public static List<org.apache.sling.api.resource.Resource> getSortedChildren(org.slf4j.Logger logger, String type, org.apache.sling.api.resource.Resource rsrc)
type
- The type of resources (for debugging)rsrc
- The parent resourcepublic static void logDeprecated(org.slf4j.Logger logger, String message)
logger
- The logger to usemessage
- The message.Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.