Class TreeWalkUriResolveStrategy
java.lang.Object
ch.tocco.nice2.dms.impl.tree.uri.TreeWalkUriResolveStrategy
- All Implemented Interfaces:
ContentUriResolveStrategy
@Component
@Order(300)
@ConditionalOnProperty(value="nice2.dms.TreeWalkUriResolveStrategy.enabled",
havingValue="true",
matchIfMissing=true)
public class TreeWalkUriResolveStrategy
extends Object
implements ContentUriResolveStrategy
Fallback for URIs which are not (yet) in the Node_url table: resolves a URI by walking the content tree from its
domain along the path parts.
Below a renamed or moved node, the Node_url entries are only updated by the periodic
UpdateUrlIndexBatchJob (or not at all as long as it fails for a node, e.g. because of conflicting URLs).
In the meantime, these nodes can only be resolved under their new URI by this strategy.
Walking the tree needs several queries per URI, while PublicUriResolveStrategy needs a single lookup in
the Node_url table. Therefore, this strategy only runs if that one found no exact match, which also applies to all
URIs which do not exist (e.g. made-up or outdated URIs requested by crawlers below a known domain).
Successful resolutions are logged to see how often and for which URIs it is needed. Resolved URIs are cached per
instance, so a URI is logged again only after it was removed from that cache. It can be disabled by setting
`nice2.dms.TreeWalkUriResolveStrategy.enabled=false`.-
Field Summary
FieldsFields inherited from interface ContentUriResolveStrategy
BINARY_RESOLVE_STRATEGY_ORDER -
Constructor Summary
ConstructorsConstructorDescriptionTreeWalkUriResolveStrategy(QueryBuilderFactory queryBuilderFactory, ContentTreeService contentTreeService, MainUriResolveStrategy mainUriResolveStrategy, Context context, org.slf4j.Logger log) -
Method Summary
-
Field Details
-
ORDER
public static final int ORDER- See Also:
-
-
Constructor Details
-
TreeWalkUriResolveStrategy
public TreeWalkUriResolveStrategy(QueryBuilderFactory queryBuilderFactory, ContentTreeService contentTreeService, MainUriResolveStrategy mainUriResolveStrategy, Context context, org.slf4j.Logger log)
-
-
Method Details
-
resolve
- Specified by:
resolvein interfaceContentUriResolveStrategy
-