Package org.ektorp

Examples of org.ektorp.CouchDbInstance


      .build();
    } catch (MalformedURLException e) {
      e.printStackTrace();
    }
   
    CouchDbInstance dbInstance = new StdCouchDbInstance(couchClient);
   
    CouchDbConnector db = null;
   
    db = dbInstance.createConnector("orders", false);
    OrderRepository or = new OrderRepository(db)
    ViewResult result = null;
   
   
    System.out.println("getAvgTimePerYear");
View Full Code Here


                .username("admin")
                .password("admin")
                .url("http://localhost:5984")
                .build();
   
    CouchDbInstance dbInstance = new StdCouchDbInstance(couchClient);
    CouchDbConnector db = dbInstance.createConnector("testdb", true);
   
    DbInfo info = db.getDbInfo();
    DecimalFormat df = new DecimalFormat("#.##");

    logger.info("DB info : dbName=" + info.getDbName() + ", docCount="
View Full Code Here

        HttpClient httpClient = new StdHttpClient.Builder()
                            .host("localhost")
                            .port(5984)
                            .build();
        CouchDbInstance couch = new StdCouchDbInstance(httpClient);
        CouchDbConnector connector = couch.createConnector("test-choose", true);
        app2.setupReplication(couch, connector);



View Full Code Here

         HttpClient httpClient1 = new StdHttpClient.Builder()
                            .host("localhost")
                            .port(5984)
                            .build();
        CouchDbInstance couch1 = new StdCouchDbInstance(httpClient1);
        CouchDbConnector connector1 = couch1.createConnector("ecko-it", false);



        HttpClient httpClient2 = new StdHttpClient.Builder()
                            .host("localhost")
                            .port(5984)
                            .build();
        CouchDbInstance couch2 = new StdCouchDbInstance(httpClient2);
        try {
            couch2.deleteDatabase("eckoit-clone");
        } catch(Exception ignore) {}
       
        CouchDbConnector connector2 = couch2.createConnector("eckoit-clone", true);
        app2.copyDesignDocs(connector1, connector2);

        app2.setupReplication(couch2, connector2);

    }
View Full Code Here

            builder.password(src_password);
        }

        HttpClient httpClient = builder.build();

        CouchDbInstance dbInstance = new StdCouchDbInstance(httpClient);
        CouchDbConnector db = new StdCouchDbConnector(src_db, dbInstance);

        return db;
    }
View Full Code Here

        }
        return null;
    }

    public boolean isLocalCouchRunning() {
        CouchDbInstance instance = getLocalCouchInstance();
        return isCouchInstanceUp(instance);

    }
View Full Code Here

        return isCouchInstanceUp(instance);

    }

    private boolean isEmbeddedCouchRunning() throws IOException {
        CouchDbInstance instance = getEmbeddedCouchInstance();
        return isCouchInstanceUp(instance);
    }
View Full Code Here



            // my machine
            HttpClient client = new StdHttpClient.Builder().url(url).build();
            CouchDbInstance db = new StdCouchDbInstance(client);
            CouchDbConnector connector = new StdCouchDbConnector(dbName, db);

            File dir = getWorkingDir();
            SimpleTrayRecorder str = new SimpleTrayRecorder(connector, dir, "_design/couchaudiorecorder", user);
View Full Code Here

      if (password != null && !password.isEmpty()) {
        builder.password(password);
      }
     
      final HttpClient httpClient = builder.build();
      final CouchDbInstance dbInstance = new StdCouchDbInstance(
          httpClient);
      // if the second parameter is true, the database will be created if
      // it doesn't exists
      db = dbInstance.createConnector(sdb, true);
     
    } catch (final Exception e) {
      LOG.log(Level.SEVERE, "Failed to connect to couch db", e);
    }
  }
View Full Code Here

        if (password != null && !password.isEmpty()) {
          builder.password(password);
        }
       
        final HttpClient httpClient = builder.build();
        final CouchDbInstance dbInstance = new StdCouchDbInstance(
            httpClient);
        // if the second parameter is true, the database will be created
        // if
        // it doesn't exists
        db = dbInstance.createConnector(database, true);
       
      } catch (final Exception e) {
        LOG.log(Level.SEVERE, "Failed to connect to couch db", e);
      }
    }
View Full Code Here

TOP

Related Classes of org.ektorp.CouchDbInstance

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.