Package ca.carleton.gcrc.couch.client

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


        CouchFactory couchFactory = new CouchFactory();
        couchClient = couchFactory.getClient(couchClientProps);
      }
     
      // Get _user database from Couch Client
      CouchDb couchDb = null;
      {
        String dbName = "_users";
        if( false == couchClient.databaseExists(dbName) ) {
          throw new Exception("Unable to access _users database");
        }
View Full Code Here


  static public DocumentUpdateProcess createDocumentUpdateProcess(
    GlobalSettings gs
    ,AtlasProperties atlasProperties
    ) throws Exception {
   
    CouchDb couchDb = CommandSupport.createCouchDb(gs, atlasProperties);
   
    DocumentUpdateProcess updateProcess = new DocumentUpdateProcess(couchDb);
    DocumentUpdateListener l = new UpdateProgress(gs);
    updateProcess.setListener(l);
   
View Full Code Here

    gs.getOutStream().println("Restoring from "+dumpDir.getAbsolutePath());

    // Load properties for atlas
    AtlasProperties atlasProperties = AtlasProperties.fromAtlasDir(atlasDir);
   
    CouchDb couchDb = CommandSupport.createCouchDb(gs, atlasProperties);
   
    DbRestoreListener listener = new RestoreListener(gs.getOutStream());
   
    DbRestoreProcess restoreProcess = new DbRestoreProcess(couchDb, dumpDir);
    restoreProcess.setListener(listener);
View Full Code Here

        throw new ServletException("Unable to find design document source for user auth");
      }
    }
   
    try {
      CouchDb userDb = couchClient.getDatabase("_users");
      DesignDocumentPush ddPush = new DesignDocumentPush(userDb, USER_DESIGN_AUTH, ddDir);
      ddPush.push();
    } catch(Exception e) {
      throw new ServletException("Problem pushing design document: "+USER_DESIGN_AUTH, e);
    }
View Full Code Here

  }

  private void initUserDesignDocument(ServletContext servletContext) throws ServletException {
    // Update document
    try {
      CouchDb userDb = couchClient.getDatabase("_users");
      UserDesignDocumentImpl.updateDesignDocument(userDb);
    } catch(Exception e) {
      throw new ServletException("Error while updating user design document",e);
    }
  }
View Full Code Here

  }

  private void initUser(ServletContext servletContext) throws ServletException {
   
    try {
      CouchDb userDb = couchClient.getDatabase("_users");
      servletContext.setAttribute(UserServlet.ConfigAttributeName_UserDb, userDb);
      servletContext.setAttribute(UserServlet.ConfigAttributeName_AtlasName, atlasName);
    } catch(Exception e) {
      logger.error("Error configuring user service",e);
      throw new ServletException("Error configuring user service",e);
View Full Code Here

  static public DocumentUpdateProcess createDocumentUpdateProcess(
    GlobalSettings gs
    ,AtlasProperties atlasProperties
    ) throws Exception {
   
    CouchDb couchDb = CommandSupport.createCouchDb(gs, atlasProperties);
   
    DocumentUpdateProcess updateProcess = new DocumentUpdateProcess(couchDb);
    DocumentUpdateListener l = new UpdateProgress(gs);
    updateProcess.setListener(l);
   
View Full Code Here

  }

  private void initUserDesignDocument(ServletContext servletContext) throws ServletException {
    // Update document
    try {
      CouchDb userDb = couchClient.getDatabase("_users");
      UserDesignDocumentImpl.updateDesignDocument(userDb);
    } catch(Exception e) {
      throw new ServletException("Error while updating user design document",e);
    }
  }
View Full Code Here

  private void initExport(ServletContext servletContext) throws ServletException {

    try {
      ExportConfiguration config = new ExportConfiguration();
      CouchDb couchDb = couchDd.getDatabase();
      config.setCouchDb(couchDb);
      CouchDesignDocument atlasDesign = couchDb.getDesignDocument("atlas");
      config.setAtlasDesignDocument(atlasDesign);
      servletContext.setAttribute(ExportConfiguration.CONFIGURATION_KEY, config);

    } catch(Exception e) {
      logger.error("Error configuring export service",e);
View Full Code Here

  }

  private void initUser(ServletContext servletContext) throws ServletException {
   
    try {
      CouchDb userDb = couchClient.getDatabase("_users");
      servletContext.setAttribute(UserServlet.ConfigAttributeName_UserDb, userDb);
      servletContext.setAttribute(
        UserServlet.ConfigAttributeName_AtlasName
        ,atlasProperties.getAtlasName()
        );
View Full Code Here

TOP

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

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.