Package com.fourspaces.couchdb

Examples of com.fourspaces.couchdb.Session


        this.port = port;
    }

    private synchronized Database getDatabase(RequestContext request) {
        String name = request.getTarget().getParameter("feed");
        Session session = new Session(host, port);
        Database db = null;
        try {
            db = session.getDatabase(name);
        } catch (Exception e) {
            // error if the db is not found, ignore the error,
            // we're going to create it
            db = session.createDatabase(name);
        }
        return db;
    }
View Full Code Here


    public ResponseContext deleteEntry(RequestContext request) {
        Target target = request.getTarget();
        String feed = target.getParameter("feed");
        String entry = target.getParameter("entry");
        Session session = new Session(host, port);
        Database db = session.getDatabase(feed);
        Document doc = null;
        try {
            doc = db.getDocument(entry);
        } catch (Exception e) {
            // error if the doc isn't found, we deal with the null result below
View Full Code Here

    }

    public ResponseContext postEntry(RequestContext request) {
        Target target = request.getTarget();
        String feed = target.getParameter("feed");
        Session session = new Session(host, port);
        Database db = session.getDatabase(feed);
        try {
            CharArrayWriter cwriter = new CharArrayWriter();
            setEditDetail(request);
            request.getDocument().getRoot().writeTo("json", cwriter);
            String json = new String(cwriter.toCharArray());
View Full Code Here

    public ResponseContext getEntry(RequestContext request) {
        Target target = request.getTarget();
        String feed = target.getParameter("feed");
        String entry = target.getParameter("entry");
        Session session = new Session(host, port);
        Database db = session.getDatabase(feed);
        Document doc = null;
        try {
            doc = db.getDocument(entry);
        } catch (Exception e) {
            // error if the doc isn't found, we deal with the null result below
View Full Code Here

    }

    public ResponseContext putEntry(RequestContext request) {
        Target target = request.getTarget();
        String feed = target.getParameter("feed");
        Session session = new Session(host, port);
        Database db = session.getDatabase(feed);
        try {
            CharArrayWriter cwriter = new CharArrayWriter();
            setEditDetail(request);
            request.getDocument().getRoot().writeTo("json", cwriter);
            String json = new String(cwriter.toCharArray());
View Full Code Here

  }
 
  private synchronized Database getDatabase(
    RequestContext request) {
      String name = request.getTarget().getParameter("feed");
      Session session = new Session(host,port);
      Database db = null;
      try {
        db = session.getDatabase(name);
      } catch (Exception e) {
        // error if the db is not found, ignore the error,
        // we're going to create it
        db = session.createDatabase(name);
      }
      return db;
  }
View Full Code Here

  public ResponseContext deleteEntry(
    RequestContext request) {
      Target target = request.getTarget();
      String feed = target.getParameter("feed");
      String entry = target.getParameter("entry");
      Session session = new Session(host,port);
      Database db = session.getDatabase(feed);
      Document doc = null;
      try {
        doc = db.getDocument(entry);
      } catch (Exception e) {
        // error if the doc isn't found, we deal with the null result below
View Full Code Here

 
  public ResponseContext postEntry(
    RequestContext request) {
      Target target = request.getTarget();
      String feed = target.getParameter("feed");
      Session session = new Session(host,port);
      Database db = session.getDatabase(feed);
      try {
        CharArrayWriter cwriter = new CharArrayWriter();
        setEditDetail(request);
        request.getDocument().getRoot().writeTo("json", cwriter);
        String json = new String(cwriter.toCharArray());
View Full Code Here

  public ResponseContext getEntry(
    RequestContext request) {
      Target target = request.getTarget();
      String feed = target.getParameter("feed");
      String entry = target.getParameter("entry");
      Session session = new Session(host,port);
      Database db = session.getDatabase(feed);
      Document doc = null;
      try {
        doc = db.getDocument(entry);
      } catch (Exception e) {
        // error if the doc isn't found, we deal with the null result below
View Full Code Here

 
  public ResponseContext putEntry(
    RequestContext request) {
      Target target = request.getTarget();
      String feed = target.getParameter("feed");
      Session session = new Session(host,port);
      Database db = session.getDatabase(feed);
      try {
        CharArrayWriter cwriter = new CharArrayWriter();
        setEditDetail(request);
        request.getDocument().getRoot().writeTo("json", cwriter);
        String json = new String(cwriter.toCharArray());
View Full Code Here

TOP

Related Classes of com.fourspaces.couchdb.Session

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.