Class PathFilter

java.lang.Object
org.alfresco.event.sdk.handling.filter.AbstractEventFilter
org.saidone.filter.PathFilter
All Implemented Interfaces:
org.alfresco.event.sdk.handling.filter.EventFilter

@Component public class PathFilter extends org.alfresco.event.sdk.handling.filter.AbstractEventFilter
Event filter for Alfresco repository events that determines if a node is located at a specific path or matches a given path pattern.

This filter provides two configurable modes: - Testing if a node's path exactly matches a provided string. - Testing if a node's path matches a regular expression pattern.

The filter relies on the NodesApi to fetch node details, specifically to retrieve the node's path attribute at event evaluation time. Log messages provide traceability of the filter's decisions for debugging purposes.

Typical usage involves obtaining a configured instance via the factory methods exposed by a Spring-managed PathFilter bean: - pathFilter.of(String path) to filter by exact path name - pathFilter.of(Pattern pathPattern) to filter by regular expression

Integration with Spring ensures that the required NodesApi dependency is supplied at runtime. This filter is intended to be used as part of event processing chains, allowing only events whose nodes match the specified path criteria to pass through.

See Also:
  • AbstractEventFilter
  • Constructor Summary

    Constructors
    Constructor
    Description
    PathFilter(org.alfresco.core.handler.NodesApi nodesApi)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    of(String path)
     
    of(Pattern pathPattern)
     
    boolean
    test(org.alfresco.repo.event.v1.model.RepoEvent<org.alfresco.repo.event.v1.model.DataAttributes<org.alfresco.repo.event.v1.model.Resource>> repoEvent)
     

    Methods inherited from class org.alfresco.event.sdk.handling.filter.AbstractEventFilter

    hasAspectAfter, hasAspectBefore, hasPropertyAfter, hasPropertyBefore, hasResourceBefore, isAssocEvent, isContentEvent, isEventWellFormed, isNodeEvent

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.alfresco.event.sdk.handling.filter.EventFilter

    and, negate, or
  • Constructor Details

    • PathFilter

      @Autowired public PathFilter(org.alfresco.core.handler.NodesApi nodesApi)
  • Method Details

    • of

      public PathFilter of(String path)
    • of

      public PathFilter of(Pattern pathPattern)
    • test

      public boolean test(org.alfresco.repo.event.v1.model.RepoEvent<org.alfresco.repo.event.v1.model.DataAttributes<org.alfresco.repo.event.v1.model.Resource>> repoEvent)