Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.jcouchdb.db;
  
  import java.util.List;
  import java.util.Map;
  
Represents a couchdb server

Author(s):
fforw at gmx dot de
 
 public interface Server
 {
     public final static int DEFAULT_PORT = 5984;

    
Returns a list with all database names.

Returns:
 
     List<StringlistDatabases();

    
Creates the database with the given name

Parameters:
name
Returns:
true if the database could be created, false if they already existed
 
     boolean createDatabase(String namethrows CouchDBException;

    
Deletes the database with the given name

Parameters:
name
 
     void deleteDatabase(String namethrows CouchDBException;

    
Send a GET request to the given URI

Parameters:
uri
Returns:
 
     Response get(String urithrows CouchDBException;

    
Send a PUT request to the given URI

Parameters:
uri
Returns:
 
     Response put(String urithrows CouchDBException;

    
Send a PUT request to the given URI with the given body

Parameters:
uri
Returns:
 
     Response put(String uriString bodythrows CouchDBException;

    
Send a PUT request to the given URI with the given byte array body

Parameters:
uri
contentType content type
Returns:
 
     Response put(String uribyte[] bodyString contentTypethrows CouchDBException;

    
Send a PUT request to the given URI with the given body from the given InputStream

Parameters:
uri
contentType content type
Returns:
 
     Response put(String uriInputStream inputStreamString contentTypelong lengththrows CouchDBException;

    
Send a POST request to the given URI with the given body

Parameters:
uri
Returns:
 
     Response post(String uriString bodythrows CouchDBException;


    
Send a DELETE request to the given URI

Parameters:
uri
Returns:
 
     Response delete(String urithrows CouchDBException;

    
Sets the credentials for the given authentication scope. This method changes the state of the encapsulated commons http client which means if you use this method, you must ensure that you use a different server instance per autenticated user.

Parameters:
authScope authentication scope
credentials credentials
    void setCredentials(AuthScope authScopeCredentials credentials);
    
    
Safely shuts down this server instance by closing all resources including HTTP connections.
    void shutDown();

    
Returns true if shutDown() has been called on this server.

Returns:
    boolean isShutdown();
    
    
Get couchdb runtime statistics.

Parameters:
filter filter for the stats (e.g. "/couchdb/request_time") or null in which case the output will be unfiltered.
Returns:
stats map
    Map<String,Map<String,Object>> getStats(String filter);
    
    
Trigger replication from a database to another database. Both database can be either local names (e.g. "exampleDB") or full URLs (e.g. "http://admin:password@example.org/exampleDB" ). Replication is always a directed from source to target. if you want to replicate in both directions you have to make two calls to replicate(java.lang.String,java.lang.String,boolean).

Parameters:
source source database name or URL
target target database name or URL
continuous if true, start continuous replication.
replication info
    ReplicationInfo replicate(String source,String targetboolean continuous);


    
Requests a list of uuids from the CouchDB server

Parameters:
count number of uuids to request
Returns:
    List<StringgetUUIDs(int count);
New to GrepCode? Check out our FAQ X