Package org.apache.solr.handler.dataimport

Examples of org.apache.solr.handler.dataimport.DataImportHandlerException


      this.query = cmd;
    } catch (DataImportHandlerException e) {
      throw e;
    } catch (Exception e) {
      logger.error("query failed: [" + query + "]", e);
      throw new DataImportHandlerException(SEVERE, e);
    }
  }
View Full Code Here


    String username = initProps.getProperty(F_MONGO_USERNAME);
    String password = initProps.getProperty(F_MONGO_PASSWORD);
    String dbName = initProps.getProperty(F_DATABASE);

    if (dbName == null) {
      throw new DataImportHandlerException(SEVERE,
          "database can not be null");
    }

    try {
      Mongo mongo = new Mongo(host, port);
      this.mongo = mongo.getDB(dbName);

      if (username != null) {
        boolean auth = this.mongo.authenticate(username,
            password.toCharArray());
        if (!auth) {
          throw new DataImportHandlerException(SEVERE,
              "auth failed with username: " + username
                  + ", password: " + password);
        }
      }
      logger.info(String.format("mongodb [%s:%d]@%s inited", host, port, dbName));
    } catch (Exception e) {
      throw new DataImportHandlerException(SEVERE, "init mongodb failed");
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.solr.handler.dataimport.DataImportHandlerException

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.