use of com.enonic.xp.trace.Trace in project xp by enonic.
the class ContentServiceImpl method getByPathAndVersionId.
@Override
public Content getByPathAndVersionId(final ContentPath contentPath, final ContentVersionId versionId) {
final Trace trace = Tracer.newTrace("content.getByPathAndVersionId");
if (trace == null) {
return doGetByPathAndVersionId(contentPath, versionId);
}
return Tracer.trace(trace, () -> {
trace.put("path", contentPath);
trace.put("versionId", versionId);
final Content content = doGetByPathAndVersionId(contentPath, versionId);
if (content != null) {
trace.put("contentId", content.getId());
}
return content;
});
}
use of com.enonic.xp.trace.Trace in project xp by enonic.
the class ContentServiceImpl method getById.
@Override
public Content getById(final ContentId contentId) {
final Trace trace = Tracer.newTrace("content.getById");
if (trace == null) {
return doGetById(contentId);
}
return Tracer.trace(trace, () -> {
trace.put("id", contentId);
final Content content = doGetById(contentId);
trace.put("path", content.getPath());
return content;
});
}
use of com.enonic.xp.trace.Trace in project xp by enonic.
the class ContentServiceImpl method findNearestSiteByPath.
@Override
public Site findNearestSiteByPath(final ContentPath contentPath) {
final Trace trace = Tracer.newTrace("content.findNearestSiteByPath");
if (trace == null) {
return (Site) doFindNearestByPath(contentPath, Content::isSite);
}
return Tracer.trace(trace, () -> {
trace.put("contentPath", contentPath);
final Site site = (Site) doFindNearestByPath(contentPath, Content::isSite);
if (site != null) {
trace.put("path", site.getPath());
}
return site;
});
}
use of com.enonic.xp.trace.Trace in project xp by enonic.
the class ContentServiceImpl method findByParent.
@Override
public FindContentByParentResult findByParent(final FindContentByParentParams params) {
final Trace trace = Tracer.newTrace("content.findByParent");
if (trace == null) {
return doFindByParent(params);
}
return Tracer.trace(trace, () -> {
trace.put("query", params.getParentPath() != null ? params.getParentPath() : params.getParentId());
trace.put("from", params.getFrom());
trace.put("size", params.getSize());
final FindContentByParentResult result = doFindByParent(params);
trace.put("hits", result.getTotalHits());
return result;
});
}
use of com.enonic.xp.trace.Trace in project xp by enonic.
the class NodeServiceImpl method getById.
@Override
public Node getById(final NodeId id) {
final Trace trace = Tracer.newTrace("node.getById");
if (trace == null) {
return executeGetById(id);
}
return Tracer.trace(trace, () -> {
trace.put("id", id);
final Node node = executeGetById(id);
trace.put("path", node.path());
return node;
});
}
Aggregations