Package org.ektorp.impl

Examples of org.ektorp.impl.StdCouchDbInstance


    public CouchDbDataContext(HttpClient httpClient, SimpleTableDef... tableDefs) {
        this(new StdCouchDbInstance(httpClient), tableDefs);
    }

    public CouchDbDataContext(HttpClient httpClient) {
        this(new StdCouchDbInstance(httpClient));
    }
View Full Code Here


    protected void setUp() throws Exception {
        super.setUp();
        httpClient = new StdHttpClient.Builder().host("localhost").build();

        // set up a simple database
        couchDbInstance = new StdCouchDbInstance(httpClient);

        try {
            if (couchDbInstance.getAllDatabases().contains(TEST_DATABASE_NAME)) {
                throw new IllegalStateException("Couch DB instance already has a database called " + TEST_DATABASE_NAME);
            }
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

        try {
            httpClient = new StdHttpClient.Builder().url(url).build();
        } catch (final MalformedURLException e) {
            throw new IllegalStateException(e);
        }
        stdCouchDbInstance = new StdCouchDbInstance(httpClient);
        db = new StdCouchDbConnector(dbName, stdCouchDbInstance);
        db.createDatabaseIfNotExists();
        designDocument = new DesignDocument("_design/channels");
        addView(designDocument, Views.CHANNEL);
        addView(designDocument, Views.UAID);
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

    private CouchDbInstance couchDbInstance = null;
    private CouchDbConnector couchDbConnector = null;

    private CouchInstance(String databaseName, boolean createIfNotExist, HttpClient httpClient) {
        couchDbInstance = new StdCouchDbInstance(httpClient);
        couchDbConnector = couchDbInstance.createConnector(databaseName, createIfNotExist);
    }
View Full Code Here

TOP

Related Classes of org.ektorp.impl.StdCouchDbInstance

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.