Package ca.carleton.gcrc.couch.client

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


    CouchContextCookie contextCookie = new CouchContextCookie();
    for(Cookie cookie : cookies){
      contextCookie.setCookie(cookie.getName(), cookie.getValue());
    }
   
    CouchFactory factory = new CouchFactory();
    return factory.getDb(contextCookie, dd.getDatabase());
  }
View Full Code Here


    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

    CouchContextCookie contextCookie = new CouchContextCookie();
    for(Cookie cookie : cookies){
      contextCookie.setCookie(cookie.getName(), cookie.getValue());
    }
   
    CouchFactory factory = new CouchFactory();
    return factory.getDb(contextCookie, dd.getDatabase());
  }
View Full Code Here

      Properties couchClientProps = new Properties();
      couchClientProps.put("couchdb.server", atlasProperties.getCouchDbUrl().toExternalForm());
      couchClientProps.put("couchdb.user", atlasProperties.getCouchDbAdminUser());
      couchClientProps.put("couchdb.password", atlasProperties.getCouchDbAdminPassword());
 
      CouchFactory couchFactory = new CouchFactory();
      couchClient = couchFactory.getClient(couchClientProps);
     
      // Verify that we can connect to the server
      try {
        couchClient.validateContext();
      } catch(Exception e) {
View Full Code Here

    props.setProperty("couchdb.server", atlasProperties.getCouchDbUrl().toExternalForm());
    props.setProperty("couchdb.user", atlasProperties.getCouchDbAdminUser());
    props.setProperty("couchdb.password", atlasProperties.getCouchDbAdminPassword());
   
    // 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);
    }
View Full Code Here

    CouchContextCookie contextCookie = new CouchContextCookie();
    for(Cookie cookie : cookies){
      contextCookie.setCookie(cookie.getName(), cookie.getValue());
    }
   
    CouchFactory factory = new CouchFactory();
    CouchDb couchDb = factory.getDb(contextCookie, userDb);

    CouchSession session = couchDb.getClient().getSession();
    CouchAuthenticationContext userContext = session.getAuthenticationContext();
   
    return userContext;
View Full Code Here

    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

    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

    CouchContextCookie contextCookie = new CouchContextCookie();
    for(Cookie cookie : cookies){
      contextCookie.setCookie(cookie.getName(), cookie.getValue());
    }
   
    CouchFactory factory = new CouchFactory();
    return factory.getDb(contextCookie, dd.getDatabase());
  }
View Full Code Here

    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.