MarkLogic Connect
MarkLogic Connect Client API Collection
Public Member Functions | List of all members
mlclient::internals::AuthenticatingProxy Class Reference

AuthenticatingProxy to handle authenticated calls to MarkLogic. More...

#include <AuthenticatingProxy.hpp>

Public Member Functions

 AuthenticatingProxy ()
 
void addCredentials (const Credentials &c)
 
const CredentialsgetCredentials (void) const
 
ResponsegetSync (const std::string &host, const std::string &path, const mlclient::HttpHeaders &headers=blankHeaders)
 
ResponsepostSync (const std::string &host, const std::string &path, const IDocumentContent &body, const mlclient::HttpHeaders &headers=blankHeaders)
 A Synchronous HTTP POST to a remote MarkLogic REST API URL. More...
 
ResponsemultiPostSync (const std::string &host, const std::string &path, const DocumentSet &allContent, const long startPosInclusive, const long endPosInclusive, const mlclient::HttpHeaders &commonHeaders=blankHeaders)
 A Synchronous HTTP POST with multi part MIME content. More...
 
ResponseputSync (const std::string &host, const std::string &path, const IDocumentContent &body, const mlclient::HttpHeaders &headers=blankHeaders)
 A Synchronous HTTP PUT to a remote MarkLogic REST API URL. More...
 
ResponsedeleteSync (const std::string &host, const std::string &path, const mlclient::HttpHeaders &headers=blankHeaders)
 A Synchronous HTTP DELETE to a remote MarkLogic REST API URL. More...
 

Detailed Description

AuthenticatingProxy to handle authenticated calls to MarkLogic.

This class proxies the calls to MarkLogic, handling authentication as necessary. It includes both synchronous and asynchronous methods to allow users to select the method of invocation most suited to their application.

Note
Some concepts contained run against "REST" principles. This is not only a REST library and is meant to be used as a general MarkLogic C++ library. It should be backward compatible with non RESTful end points as well as REST.

Constructor & Destructor Documentation

mlclient::internals::AuthenticatingProxy::AuthenticatingProxy ( )

Constructor

Member Function Documentation

void mlclient::internals::AuthenticatingProxy::addCredentials ( const Credentials c)

Add credentials to the authenticating proxy

Parameters
cThe Credentials.
Response* mlclient::internals::AuthenticatingProxy::deleteSync ( const std::string &  host,
const std::string &  path,
const mlclient::HttpHeaders headers = blankHeaders 
)

A Synchronous HTTP DELETE to a remote MarkLogic REST API URL.

Parameters
[in]hostThe hostname or IP Address to communicate with
[in]pathThe URL path (E.g. /v1/documents) to invoke
const Credentials& mlclient::internals::AuthenticatingProxy::getCredentials ( void  ) const

Returns a read-only copy of the credentials used by the proxy.

Returns
The credentials
Response* mlclient::internals::AuthenticatingProxy::getSync ( const std::string &  host,
const std::string &  path,
const mlclient::HttpHeaders headers = blankHeaders 
)

Invokes a synchronous GET operation on the MarkLogic server.

Parameters
hostThe hostname or IP address ("127.0.0.1")
pathThe path to invoke ("/v1/documents?uri=/foo/bar.xml")
headersThe HTTP headers to include in the invocation
Returns
The Response object
Response* mlclient::internals::AuthenticatingProxy::multiPostSync ( const std::string &  host,
const std::string &  path,
const DocumentSet allContent,
const long  startPosInclusive,
const long  endPosInclusive,
const mlclient::HttpHeaders commonHeaders = blankHeaders 
)

A Synchronous HTTP POST with multi part MIME content.

Parameters
[in]hostThe hostname or IP Address to communicate with
[in]pathThe URL path (E.g. /v1/documents) to invoke
[in]bodyThe set of content to send as the POST body
Response* mlclient::internals::AuthenticatingProxy::postSync ( const std::string &  host,
const std::string &  path,
const IDocumentContent body,
const mlclient::HttpHeaders headers = blankHeaders 
)

A Synchronous HTTP POST to a remote MarkLogic REST API URL.

Parameters
[in]hostThe hostname or IP Address to communicate with
[in]pathThe URL path (E.g. /v1/documents) to invoke
[in]bodyThe content to send as the POST body
Response* mlclient::internals::AuthenticatingProxy::putSync ( const std::string &  host,
const std::string &  path,
const IDocumentContent body,
const mlclient::HttpHeaders headers = blankHeaders 
)

A Synchronous HTTP PUT to a remote MarkLogic REST API URL.

Parameters
[in]hostThe hostname or IP Address to communicate with
[in]pathThe URL path (E.g. /v1/documents) to invoke
[in]bodyThe content to send as the PUT body

The documentation for this class was generated from the following file: