Package ca.carleton.gcrc.couch.client

Examples of ca.carleton.gcrc.couch.client.CouchFactory


    if( props.containsKey("couchdb.replication.password") ) {
      couchReplicationPassword = props.getProperty("couchdb.replication.password");
    }
   
    // Create Couch Server from properties
    CouchFactory factory = new CouchFactory();
    try {
      couchClient = factory.getClient(props);
     
    } catch(Exception e) {
      logger.error("Unable to get Couch Server",e);
      throw new ServletException("Unable to get Couch Server",e);
    }
   
    // Create database
    try {
      if( props.containsKey("couchdb.dbUrl") ) {
        couchDb = factory.getDb(couchClient, props.getProperty("couchdb.dbUrl"));
      } else if( props.containsKey("couchdb.dbName") ) {
        couchDb = couchClient.getDatabase(props.getProperty("couchdb.dbName"));
      } else {
        throw new Exception("dbUrl or dbName must be provided");
      }
View Full Code Here

TOP

Related Classes of ca.carleton.gcrc.couch.client.CouchFactory

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.