Package org.alfresco.solr.tracker
Class DocRouterWithFallback
java.lang.Object
org.alfresco.solr.tracker.DocRouterWithFallback
- All Implemented Interfaces:
DocRouter
A composable
DocRouter which consists of
- A primary routing strategy
- A fallback strategy used in case of failure of the strategy above
- Author:
- agazzarini
-
Constructor Summary
ConstructorsConstructorDescriptionDocRouterWithFallback(DocRouter primaryStrategy, DocRouter fallbackStrategy) -
Method Summary
Modifier and TypeMethodDescriptiongetProperties(Optional<org.alfresco.service.namespace.QName> shardProperty) Get additional properties to "shardProperty" depending on the Shard Method.routeAcl(int shardCount, int shardInstance, org.alfresco.solr.client.Acl acl) Checks if the incoming ACL document must be indexed on this shard.routeNode(int shardCount, int shardInstance, org.alfresco.solr.client.Node node) Checks if the incoming Node must be indexed on this shard.
-
Constructor Details
-
DocRouterWithFallback
-
-
Method Details
-
routeAcl
Description copied from interface:DocRouterChecks if the incoming ACL document must be indexed on this shard. -
routeNode
Description copied from interface:DocRouterChecks if the incoming Node must be indexed on this shard.- Specified by:
routeNodein interfaceDocRouter- Parameters:
shardCount- the total shard count.shardInstance- the owning shard instance (i.e. instance number).node- theNodeinstance.- Returns:
- true if the
Nodeinstance must be indexed in the shard which owns thisDocRouterinstance, false otherwise.
-
getProperties
public Map<String,String> getProperties(Optional<org.alfresco.service.namespace.QName> shardProperty) Description copied from interface:DocRouterGet additional properties to "shardProperty" depending on the Shard Method.- Specified by:
getPropertiesin interfaceDocRouter- Parameters:
shardProperty- custom property used to configure the Router. Note not all routers need that.- Returns:
- pair of key, value
-