Package org.apache.stanbol.commons.solr

Examples of org.apache.stanbol.commons.solr.SolrServerAdapter


            serverProperties.setPublishREST((Boolean)value);
        } else {
            serverProperties.setPublishREST(Boolean.parseBoolean(value.toString()));
        }
        try {
            server = new SolrServerAdapter(context.getBundleContext(), serverProperties);
        } catch (ParserConfigurationException e) {
            throw new IllegalStateException("Unable to initialise the XML parser " +
                    "for parsing the SolrServer Configuration for Server '"+
                    serverProperties.getServerName()+"' (dir="+
                    serverProperties.getServerDir()+")!",e);
View Full Code Here


    @Override
    public File getSolrIndexDirectory(String indexName) {
        if(indexName == null || indexName.isEmpty()){
            throw new IllegalArgumentException("The parsed index name MUST NOT be NULL nor empty!");
        }
        SolrServerAdapter server = this.server;
        ServiceReference ref = server.getCore(indexName);
        String dirName = ref != null ?
                (String)ref.getProperty(SolrConstants.PROPERTY_CORE_DIR) :
                    null;
        return dirName == null ? null : new File(dirName);
    }
View Full Code Here

     * method completes!
     * @param deleteFiles if the files on the local fileSystem should be deleted
     * @return the parsed and modified instance of the {@link IndexMetadata}
     */
    protected final void uninitialiseCore(IndexMetadata metadata,boolean deleteFiles) {
        SolrServerAdapter server = this.server;
        File coreDir = null;
        if(metadata.isActive()){
            coreDir = deactivateCore(metadata.getIndexName(), server);
        }
        if(coreDir == null){
View Full Code Here

        String coreName = metadata.getIndexName();
        if(coreName == null || coreName.isEmpty()){
            throw new IllegalArgumentException("The parse metadata do not contain a valid value for the '"+
                INDEX_NAME+"'!");
        }
        SolrServerAdapter server = this.server;
        if(server == null){
            log.info("Unable to update core '{}' because this ManagedSolrServer is already deactivated.");
            return;
        }
        ServiceReference coreRef = server.getCore(coreName);
        File currentCoreDir; //dir of the previous version
        if(coreRef != null){
            currentCoreDir = getCoreDir(coreRef,true);
        } else { //no old version
            currentCoreDir = null;
View Full Code Here

        } else {
            properties.setPublishREST(Boolean.parseBoolean(value.toString()));
        }
        log.info(" > publisRest = {}",properties.isPublishREST());
        try {
            server = new SolrServerAdapter(context.getBundleContext(), properties);
        } catch (ParserConfigurationException e) {
            throw new IllegalStateException("Unable to initialise the XML parser " +
                "for parsing the SolrServer Configuration for Server '"+
                properties.getServerName()+"' (dir="+
                properties.getServerDir()+")!",e);
View Full Code Here

            serverProperties.setPublishREST((Boolean)value);
        } else {
            serverProperties.setPublishREST(Boolean.parseBoolean(value.toString()));
        }
        try {
            server = new SolrServerAdapter(context.getBundleContext(), serverProperties);
        } catch (ParserConfigurationException e) {
            throw new IllegalStateException("Unable to initialise the XML parser " +
                    "for parsing the SolrServer Configuration for Server '"+
                    serverProperties.getServerName()+"' (dir="+
                    serverProperties.getServerDir()+")!",e);
View Full Code Here

    @Override
    public File getSolrIndexDirectory(String indexName) {
        if(indexName == null || indexName.isEmpty()){
            throw new IllegalArgumentException("The parsed index name MUST NOT be NULL nor empty!");
        }
        SolrServerAdapter server = this.server;
        ServiceReference ref = server.getCore(indexName);
        String dirName = ref != null ?
                (String)ref.getProperty(SolrConstants.PROPERTY_CORE_DIR) :
                    null;
        return dirName == null ? null : new File(dirName);
    }
View Full Code Here

     * method completes!
     * @param deleteFiles if the files on the local fileSystem should be deleted
     * @return the parsed and modified instance of the {@link IndexMetadata}
     */
    protected final void uninitialiseCore(IndexMetadata metadata,boolean deleteFiles) {
        SolrServerAdapter server = this.server;
        File coreDir = null;
        if(metadata.isActive()){
            coreDir = deactivateCore(metadata.getIndexName(), server);
        }
        if(coreDir == null){
View Full Code Here

        String coreName = metadata.getIndexName();
        if(coreName == null || coreName.isEmpty()){
            throw new IllegalArgumentException("The parse metadata do not contain a valid value for the '"+
                INDEX_NAME+"'!");
        }
        SolrServerAdapter server = this.server;
        if(server == null){
            log.info("Unable to update core '{}' because this ManagedSolrServer is already deactivated.");
            return;
        }
        ServiceReference coreRef = server.getCore(coreName);
        File currentCoreDir; //dir of the previous version
        if(coreRef != null){
            currentCoreDir = getCoreDir(coreRef,true);
        } else { //no old version
            currentCoreDir = null;
View Full Code Here

            serverProperties.setPublishREST((Boolean)value);
        } else {
            serverProperties.setPublishREST(Boolean.parseBoolean(value.toString()));
        }
        try {
            server = new SolrServerAdapter(context.getBundleContext(), serverProperties);
        } catch (ParserConfigurationException e) {
            throw new IllegalStateException("Unable to initialise the XML parser " +
                    "for parsing the SolrServer Configuration for Server '"+
                    serverProperties.getServerName()+"' (dir="+
                    serverProperties.getServerDir()+")!",e);
View Full Code Here

TOP

Related Classes of org.apache.stanbol.commons.solr.SolrServerAdapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.