Package org.ametys.web.indexing.solr
Class SolrSiteIndexer
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.web.indexing.solr.SolrSiteIndexer
-
- All Implemented Interfaces:
LogEnabled
,SiteIndexer
,Contextualizable
,Serviceable
public class SolrSiteIndexer extends AbstractLogEnabled implements SiteIndexer, Serviceable, Contextualizable
Solr implementation ofSiteIndexer
.
-
-
Field Summary
Fields Modifier and Type Field Description private Context
_context
protected SiteDocumentProviderExtensionPoint
_siteDocProviderEP
The site document provider handler.protected SiteManager
_siteManager
The site manager.protected SolrClientProvider
_solrClientProvider
The Solr client providerprotected SolrIndexer
_solrIndexer
The solr indexer.protected SolrPageIndexer
_solrPageIndexer
The solr page indexer.-
Fields inherited from interface org.ametys.web.indexing.SiteIndexer
ROLE
-
-
Constructor Summary
Constructors Constructor Description SolrSiteIndexer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_indexContents(Site site, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient)
Index the contents of a site.protected void
_indexResources(Site site, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient)
Index the resources of a site.private void
_indexSite(String siteName, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient, boolean commit)
private void
_indexSitemap(String siteName, String sitemapName, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient)
private void
_indexSitemaps(Site site, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient)
private void
_unindexSiteDocuments(String siteName, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient)
private void
_unindexSitemapDocuments(String siteName, String sitemapName, String workspace, org.apache.solr.client.solrj.SolrClient solrClient)
void
contextualize(Context context)
void
indexSite(String siteName)
Index a site in all workspacesvoid
indexSite(String siteName, String workspaceName)
Index a site in a specific workspace.void
indexSite(String siteName, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient)
Index a site in a specific workspace.void
indexSite(Site site)
Index a site in all workspacesvoid
indexSitemap(String siteName, String sitemapName)
Index a sitemap in all workpacesvoid
indexSitemap(String siteName, String sitemapName, String workspaceName)
Index a sitemap in a specific workspace.void
indexSitemap(Sitemap sitemap)
Index a sitemap in all workpacesvoid
service(ServiceManager manager)
void
unindexSite(String siteName)
Unindex a site in all workspacesvoid
unindexSite(String siteName, String workspaceName)
Unindex a site in a specific workspace.void
unindexSitemap(String siteName, String sitemapName)
Unindex a sitemap in all workpacesvoid
unindexSitemap(String siteName, String sitemapName, String workspaceName)
Unindex a sitemap in a specific workspace.-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_siteManager
protected SiteManager _siteManager
The site manager.
-
_solrIndexer
protected SolrIndexer _solrIndexer
The solr indexer.
-
_solrPageIndexer
protected SolrPageIndexer _solrPageIndexer
The solr page indexer.
-
_siteDocProviderEP
protected SiteDocumentProviderExtensionPoint _siteDocProviderEP
The site document provider handler.
-
_solrClientProvider
protected SolrClientProvider _solrClientProvider
The Solr client provider
-
-
Constructor Detail
-
SolrSiteIndexer
public SolrSiteIndexer()
-
-
Method Detail
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
indexSite
public void indexSite(Site site) throws IndexingException
Description copied from interface:SiteIndexer
Index a site in all workspaces- Specified by:
indexSite
in interfaceSiteIndexer
- Parameters:
site
- the site to index.- Throws:
IndexingException
- If an error occurs while indexing the site.
-
indexSite
public void indexSite(String siteName) throws IndexingException
Description copied from interface:SiteIndexer
Index a site in all workspaces- Specified by:
indexSite
in interfaceSiteIndexer
- Parameters:
siteName
- the name of the site to index.- Throws:
IndexingException
- If an error occurs while indexing the site.
-
indexSite
public void indexSite(String siteName, String workspaceName) throws IndexingException
Description copied from interface:SiteIndexer
Index a site in a specific workspace.- Specified by:
indexSite
in interfaceSiteIndexer
- Parameters:
siteName
- the name of the site to index.workspaceName
- The workspace name.- Throws:
IndexingException
- If an error occurs while indexing the site.
-
indexSite
public void indexSite(String siteName, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) throws IndexingException
Description copied from interface:SiteIndexer
Index a site in a specific workspace.- Specified by:
indexSite
in interfaceSiteIndexer
- Parameters:
siteName
- the name of the site to index.workspaceName
- The workspace name.solrClient
- The solr client to use- Throws:
IndexingException
- If an error occurs while indexing the site.
-
_indexSite
private void _indexSite(String siteName, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient, boolean commit) throws IndexingException
- Throws:
IndexingException
-
indexSitemap
public void indexSitemap(Sitemap sitemap) throws IndexingException
Description copied from interface:SiteIndexer
Index a sitemap in all workpaces- Specified by:
indexSitemap
in interfaceSiteIndexer
- Parameters:
sitemap
- the sitemap to index.- Throws:
IndexingException
- If an error occurs while indexing the sitemap.
-
indexSitemap
public void indexSitemap(String siteName, String sitemapName) throws IndexingException
Description copied from interface:SiteIndexer
Index a sitemap in all workpaces- Specified by:
indexSitemap
in interfaceSiteIndexer
- Parameters:
siteName
- the site name.sitemapName
- the name of the sitemap to index.- Throws:
IndexingException
- If an error occurs while indexing the sitemap.
-
indexSitemap
public void indexSitemap(String siteName, String sitemapName, String workspaceName) throws IndexingException
Description copied from interface:SiteIndexer
Index a sitemap in a specific workspace.- Specified by:
indexSitemap
in interfaceSiteIndexer
- Parameters:
siteName
- the site name.sitemapName
- the name of the sitemap to index.workspaceName
- The workspace name.- Throws:
IndexingException
- If an error occurs while indexing the sitemap.
-
unindexSite
public void unindexSite(String siteName) throws IndexingException
Description copied from interface:SiteIndexer
Unindex a site in all workspaces- Specified by:
unindexSite
in interfaceSiteIndexer
- Parameters:
siteName
- the name of site to unindex.- Throws:
IndexingException
- If an error occurs while unindexing the site.
-
unindexSite
public void unindexSite(String siteName, String workspaceName) throws IndexingException
Description copied from interface:SiteIndexer
Unindex a site in a specific workspace.- Specified by:
unindexSite
in interfaceSiteIndexer
- Parameters:
siteName
- the name of site to unindex.workspaceName
- The workspace name.- Throws:
IndexingException
- If an error occurs while unindexing the site.
-
unindexSitemap
public void unindexSitemap(String siteName, String sitemapName) throws IndexingException
Description copied from interface:SiteIndexer
Unindex a sitemap in all workpaces- Specified by:
unindexSitemap
in interfaceSiteIndexer
- Parameters:
siteName
- the site name.sitemapName
- the name of the sitemap to index.- Throws:
IndexingException
- If an error occurs while unindexing the sitemap.
-
unindexSitemap
public void unindexSitemap(String siteName, String sitemapName, String workspaceName) throws IndexingException
Description copied from interface:SiteIndexer
Unindex a sitemap in a specific workspace.- Specified by:
unindexSitemap
in interfaceSiteIndexer
- Parameters:
siteName
- the site name.sitemapName
- the name of the sitemap to index.workspaceName
- The workspace name.- Throws:
IndexingException
- If an error occurs while unindexing the sitemap.
-
_indexSitemaps
private void _indexSitemaps(Site site, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) throws Exception
- Throws:
Exception
-
_indexSitemap
private void _indexSitemap(String siteName, String sitemapName, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) throws Exception
- Throws:
Exception
-
_unindexSiteDocuments
private void _unindexSiteDocuments(String siteName, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
_unindexSitemapDocuments
private void _unindexSitemapDocuments(String siteName, String sitemapName, String workspace, org.apache.solr.client.solrj.SolrClient solrClient) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
-
_indexContents
protected void _indexContents(Site site, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) throws Exception
Index the contents of a site.- Parameters:
site
- The site to index.workspaceName
- The workspace namesolrClient
- The solr client to use- Throws:
Exception
- If an error occurs indexing the contents.
-
_indexResources
protected void _indexResources(Site site, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) throws Exception
Index the resources of a site.- Parameters:
site
- The site to index.workspaceName
- The workspace namesolrClient
- The solr client to use- Throws:
Exception
- If an error occurs indexing the resources.
-
-