Skip to content
This repository has been archived by the owner on Oct 13, 2020. It is now read-only.

OBSOLETE, NO LONGER MAINTAINED. An abstract Java HTTP server for pretending to be a Couchbase Server node.

Notifications You must be signed in to change notification settings

couchbaselabs/couchbase-capi-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Couchbase CAPI Server

This project implements an HTTP server capable of responding to Couchbase and CAPI requests.

Couchbase Requests supported:

  • /pools (GET)
  • /pools/default (GET)
  • /pools/default/buckets (GET)
  • /pools/default/buckets/{bucket} (GET)

CAPI Requests supported:

  • /{database} (HEAD, GET)
  • /{database}/{docid} (GET)
  • /{database}/_ensure_full_commit (POST)
  • /{database}/_revs_diff (POST)
  • /{database}/_bulk_docs (POST)

This project does not come with an actual implementation of the behaviors behind these actions. Instead two interfaces are exposed:

  • CouchbaseBehavior
  • CAPIBehavior

Users of this library will provide their own implemenations of these interfaces to deliver the desired behavior.

Building

This project is built using Maven.

mvn install 

Using

  • Implement your own CouchbaseBehavior
    public class MyCustomCouchbaseBehavior implements CouchbaseBehavior { ... }
  • Implement your own CAPIBehavior
    public class MyCustomCAPIBehavior implements CAPIBehavior { ... }
  • Create instances of #1 and #2
    CouchbaseBehavior couchbaseBehavior = new MyCustomCouchbaseBehavior();
    CAPIBehavior capiBehavior = new MyCustomCAPIBehavior();
  • Start a CAPIServer
    CAPIServer capiServer = new CAPIServer(capiBehavior, couchbaseBehavior);
    capiServer.start();

By default this will start a server bound to 0.0.0.0 on an ephemeral port. If you'd like to bind to a different interface or a particular port, there are alternate constructors available.

About

OBSOLETE, NO LONGER MAINTAINED. An abstract Java HTTP server for pretending to be a Couchbase Server node.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages