Search in sources :

Example 6 with Trace

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;
    });
}
Also used : Trace(com.enonic.xp.trace.Trace) Content(com.enonic.xp.content.Content)

Example 7 with Trace

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;
    });
}
Also used : Trace(com.enonic.xp.trace.Trace) Content(com.enonic.xp.content.Content)

Example 8 with Trace

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;
    });
}
Also used : Trace(com.enonic.xp.trace.Trace) Site(com.enonic.xp.site.Site)

Example 9 with Trace

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;
    });
}
Also used : Trace(com.enonic.xp.trace.Trace) FindContentByParentResult(com.enonic.xp.content.FindContentByParentResult)

Example 10 with Trace

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;
    });
}
Also used : Trace(com.enonic.xp.trace.Trace) Node(com.enonic.xp.node.Node)

Aggregations

Trace (com.enonic.xp.trace.Trace)39 Content (com.enonic.xp.content.Content)6 PortalResponse (com.enonic.xp.portal.PortalResponse)6 Node (com.enonic.xp.node.Node)4 PortalRequest (com.enonic.xp.portal.PortalRequest)4 Site (com.enonic.xp.site.Site)4 DescriptorKey (com.enonic.xp.page.DescriptorKey)3 ContentResolver (com.enonic.xp.portal.impl.ContentResolver)3 ApplicationKey (com.enonic.xp.app.ApplicationKey)2 ContentResolverResult (com.enonic.xp.portal.impl.ContentResolverResult)2 WebResponse (com.enonic.xp.web.WebResponse)2 Matcher (java.util.regex.Matcher)2 Attachment (com.enonic.xp.attachment.Attachment)1 FindContentByParentResult (com.enonic.xp.content.FindContentByParentResult)1 FindContentIdsByQueryResult (com.enonic.xp.content.FindContentIdsByQueryResult)1 Media (com.enonic.xp.content.Media)1 ThrottlingException (com.enonic.xp.exception.ThrottlingException)1 ReadImageParams (com.enonic.xp.image.ReadImageParams)1 ImageOrientation (com.enonic.xp.media.ImageOrientation)1 FindNodesByParentResult (com.enonic.xp.node.FindNodesByParentResult)1