Search in sources :

Example 21 with IndexMetadata

use of org.apache.stanbol.commons.solr.managed.IndexMetadata in project stanbol by apache.

the class ConfiguredSolrCoreTracker method unbindManagedSolrServer.

protected void unbindManagedSolrServer(ManagedSolrServer managedSolrServer) {
    if (this.managedSolrServer == managedSolrServer || solrCoreId != null) {
        IndexReference indexReference = IndexReference.parse(solrCoreId);
        if (!indexReference.checkServer(managedSolrServer.getServerName())) {
            return;
        }
        String indexName = indexReference.getIndex();
        IndexMetadata indexMetadata = managedSolrServer.getIndexMetadata(indexName);
        if (indexMetadata != null && indexMetadata.isActive()) {
            managedSolrServer.deactivateIndex(indexName);
        }
        this.managedSolrServer = null;
    }
}
Also used : IndexMetadata(org.apache.stanbol.commons.solr.managed.IndexMetadata) IndexReference(org.apache.stanbol.commons.solr.IndexReference)

Aggregations

IndexMetadata (org.apache.stanbol.commons.solr.managed.IndexMetadata)21 IOException (java.io.IOException)7 File (java.io.File)3 HashMap (java.util.HashMap)3 ManagedIndexState (org.apache.stanbol.commons.solr.managed.ManagedIndexState)3 SAXException (org.xml.sax.SAXException)3 InputStream (java.io.InputStream)2 HashSet (java.util.HashSet)2 SolrCore (org.apache.solr.core.SolrCore)2 IndexReference (org.apache.stanbol.commons.solr.IndexReference)2 FileInputStream (java.io.FileInputStream)1 EnumMap (java.util.EnumMap)1 Map (java.util.Map)1 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)1 ArchiveException (org.apache.commons.compress.archivers.ArchiveException)1 ArchiveInputStream (org.apache.commons.compress.archivers.ArchiveInputStream)1 SuffixFileFilter (org.apache.commons.io.filefilter.SuffixFileFilter)1 Activate (org.apache.felix.scr.annotations.Activate)1 SolrServer (org.apache.solr.client.solrj.SolrServer)1 HttpSolrServer (org.apache.solr.client.solrj.impl.HttpSolrServer)1