Package org.alfresco.solr.content
Class SolrContentStore
- java.lang.Object
-
- org.alfresco.solr.content.SolrContentStore
-
- All Implemented Interfaces:
org.alfresco.repo.content.ContentStore
public class SolrContentStore extends Object implements org.alfresco.repo.content.ContentStore
A content store specific to SOLR's requirements: The URL is generated from a set of properties such as:- ACL ID
- DB ID
- Other metadata
SolrContentUrlBuilder.- Since:
- 5.0
- Author:
- Derek Hulley, Michael Suzuki
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Loggerlog
-
Constructor Summary
Constructors Constructor Description SolrContentStore(String solrHome)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandelete(String contentUrl)booleanexists(String contentUrl)org.alfresco.service.cmr.repository.ContentReadergetReader(String contentUrl)StringgetRootLocation()longgetSpaceFree()longgetSpaceTotal()org.alfresco.service.cmr.repository.ContentWritergetWriter(org.alfresco.repo.content.ContentContext context)booleanisContentUrlSupported(String contentUrl)booleanisWriteSupported()voidremoveDocFromContentStore(org.alfresco.solr.client.NodeMetaData nodeMetaData)RemovesSolrInputDocumentfrom Alfresco solr content store.org.apache.solr.common.SolrInputDocumentretrieveDocFromSolrContentStore(String tenant, long dbId)Retrieve document from SolrContentStore.voidstoreDocOnSolrContentStore(String tenant, long dbId, org.apache.solr.common.SolrInputDocument doc)Stores aSolrInputDocumentinto Alfresco solr content store.voidstoreDocOnSolrContentStore(org.alfresco.solr.client.NodeMetaData nodeMetaData, org.apache.solr.common.SolrInputDocument doc)StoreSolrInputDocumentin to Alfresco solr content store.
-
-
-
Constructor Detail
-
SolrContentStore
public SolrContentStore(String solrHome)
Constructor.- Parameters:
solrHome-
-
-
Method Detail
-
retrieveDocFromSolrContentStore
public org.apache.solr.common.SolrInputDocument retrieveDocFromSolrContentStore(String tenant, long dbId) throws IOException
Retrieve document from SolrContentStore.- Parameters:
tenant- identifierdbId- identifier- Returns:
SolrInputDocumentsearched document- Throws:
IOException- if error
-
isContentUrlSupported
public boolean isContentUrlSupported(String contentUrl)
- Specified by:
isContentUrlSupportedin interfaceorg.alfresco.repo.content.ContentStore
-
isWriteSupported
public boolean isWriteSupported()
- Specified by:
isWriteSupportedin interfaceorg.alfresco.repo.content.ContentStore- Returns:
- true always
-
getSpaceFree
public long getSpaceFree()
- Specified by:
getSpaceFreein interfaceorg.alfresco.repo.content.ContentStore- Returns:
- -1 always
-
getSpaceTotal
public long getSpaceTotal()
- Specified by:
getSpaceTotalin interfaceorg.alfresco.repo.content.ContentStore- Returns:
- -1 always
-
getRootLocation
public String getRootLocation()
- Specified by:
getRootLocationin interfaceorg.alfresco.repo.content.ContentStore
-
exists
public boolean exists(String contentUrl)
- Specified by:
existsin interfaceorg.alfresco.repo.content.ContentStore
-
getReader
public org.alfresco.service.cmr.repository.ContentReader getReader(String contentUrl)
- Specified by:
getReaderin interfaceorg.alfresco.repo.content.ContentStore
-
getWriter
public org.alfresco.service.cmr.repository.ContentWriter getWriter(org.alfresco.repo.content.ContentContext context)
- Specified by:
getWriterin interfaceorg.alfresco.repo.content.ContentStore
-
delete
public boolean delete(String contentUrl)
- Specified by:
deletein interfaceorg.alfresco.repo.content.ContentStore
-
storeDocOnSolrContentStore
public void storeDocOnSolrContentStore(String tenant, long dbId, org.apache.solr.common.SolrInputDocument doc) throws IOException
Stores aSolrInputDocumentinto Alfresco solr content store.- Parameters:
tenant-dbId-doc-- Throws:
IOException
-
storeDocOnSolrContentStore
public void storeDocOnSolrContentStore(org.alfresco.solr.client.NodeMetaData nodeMetaData, org.apache.solr.common.SolrInputDocument doc) throws IOExceptionStoreSolrInputDocumentin to Alfresco solr content store.- Parameters:
nodeMetaData- identifierdoc- to store- Throws:
IOException- if error
-
removeDocFromContentStore
public void removeDocFromContentStore(org.alfresco.solr.client.NodeMetaData nodeMetaData)
RemovesSolrInputDocumentfrom Alfresco solr content store.- Parameters:
nodeMetaData-
-
-