Package org.jcouchdb.db

Examples of org.jcouchdb.db.Server


  }

  public void before() throws IOException, URISyntaxException, CouchDbException {
    URI currentUri = getServerUri();
    serverURI = currentUri;
    Server currentServer = new ServerImpl( serverURI.getHost(), currentUri.getPort() );

    final String username = getUsername();
    final String password = getPassword();

    if ( username != null && password != null ) {
      currentServer.setCredentials( AuthScope.ANY, new Credentials() {
        @Override
        public Principal getUserPrincipal() {
          return new UserPrincipal( username );
        }
View Full Code Here


      System.out.println( "Skipping deletion of " + db.getDbName() );
      System.out.println( "----------------------------" );
      return;
    }

    Server currentServer = server;
    if ( currentServer != null ) {
      for ( Iterator<CouchDatabase> iterator = dbs.iterator(); iterator.hasNext(); ) {
        CouchDatabase couchDatabase = iterator.next();
        currentServer.deleteDatabase( couchDatabase.getDbName() );
        iterator.remove();
      }
    }
    db = null;
  }
View Full Code Here

    this.dbs.add( couchDatabase );
    return couchDatabase;
  }

  public void deleteDb( @Nonnull String dbName ) {
    Server currentServer = server;
    if ( currentServer == null ) {
      throw new IllegalArgumentException( "Invalid state - server is null" );
    }
    currentServer.deleteDatabase( dbName );
  }
View Full Code Here

  }

  public void before() throws IOException, URISyntaxException, CouchDbException {
    URI currentUri = getServerUri();
    serverURI = currentUri;
    Server currentServer = new ServerImpl( serverURI.getHost(), currentUri.getPort() );

    final String username = getUsername();
    final String password = getPassword();

    if ( username != null && password != null ) {
      currentServer.setCredentials( AuthScope.ANY, new Credentials() {
        @Override
        public Principal getUserPrincipal() {
          return new UserPrincipal( username );
        }
View Full Code Here

      System.out.println( "Skipping deletion of " + db.getDbName() );
      System.out.println( "----------------------------" );
      return;
    }

    Server currentServer = server;
    if ( currentServer != null ) {
      for ( Iterator<CouchDatabase> iterator = dbs.iterator(); iterator.hasNext(); ) {
        CouchDatabase couchDatabase = iterator.next();
        currentServer.deleteDatabase( couchDatabase.getDbName() );
        iterator.remove();
      }
    }
    db = null;
  }
View Full Code Here

TOP

Related Classes of org.jcouchdb.db.Server

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.