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

Provides a high level logical object representing all access to a single MarkLogic database. More...

#include <Connection.hpp>

Inheritance diagram for mlclient::Connection:
mlclient::IConnection

Public Member Functions

MLCLIENT_API Connection ()
 Creates a Connection instance. More...
 
MLCLIENT_API ~Connection ()
 
connection_configuration Connection configuration functions
MLCLIENT_API void configure (const std::string &hostname, const std::string &port, const std::string &username, const std::string &password, const bool usessl=false) override
 
MLCLIENT_API bool connect () override
 Connects or tests the authentication in the connection. May not actually connect. More...
 
MLCLIENT_API void disconnect () override
 Frees up resources held by the connection, until the next call to connect. More...
 
MLCLIENT_API void setDatabaseName (const std::string &db) override
 Sets the name of the database to query/update. Defaults to Documents. More...
 
MLCLIENT_API std::string getDatabaseName () override
 Returns the database name we're querying/updating. Defaults to Documents. More...
 
http_raw RAW HTTP commands
MLCLIENT_API ResponsedoGet (const std::string &pathAndQuerystring) override
 Performs a HTTP GET Request against MarkLogic Server. More...
 
MLCLIENT_API ResponsedoPut (const std::string &pathAndQuerystring, const IDocumentContent &payload) override
 Performs a HTTP PUT Request against MarkLogic Server. More...
 
MLCLIENT_API ResponsedoPost (const std::string &pathAndQuerystring, const IDocumentContent &payload) override
 Performs a HTTP POST Request against MarkLogic Server. More...
 
MLCLIENT_API ResponsedoDelete (const std::string &pathAndQueryString) override
 Performs a HTTP DELETE Request against MarkLogic Server. More...
 
wrap_rest Convenience wrapper function calls for common MarkLogic REST API calls.
MLCLIENT_API ResponsegetDocument (const std::string &uri) override
 Retrieves a document from the server, at the given document URI (MarkLogic unique document ID) More...
 
virtual MLCLIENT_API ResponsegetDocument (Document &inout_document) override
 Retrieves a document from the server, at the given document URI (MarkLogic unique document ID, within the Document object) More...
 
virtual MLCLIENT_API ResponsegetDocumentContent (Document &inout_document) override
 Populates the content of the specified document (MUST have a uri). More...
 
virtual MLCLIENT_API ResponsegetDocumentProperties (Document &inout_document) override
 Populates the properties of the specified document (MUST have a uri). More...
 
virtual MLCLIENT_API ResponsegetDocumentPermissions (Document &inout_document) override
 Populates the permissions of the specified document (MUST have a uri). More...
 
MLCLIENT_API ResponsesaveDocumentContent (const std::string &uri, const IDocumentContent &payload) override
 Saves a document to MarkLogic (either as new or an update), at the given document URI (MarkLogic unique document ID) More...
 
MLCLIENT_API ResponsesaveDocuments (const DocumentSet &documents, const long startPosInclusive, const long endPosInclusive) override
 Saves a set of documents as a single batch to MarkLogic Server. More...
 
MLCLIENT_API ResponsesaveDocument (const Document &doc) override
 Saves the specified document to MarkLogic Server. More...
 
MLCLIENT_API ResponsedeleteDocument (const std::string &uri) override
 Deletes the specified document by URI. More...
 
MLCLIENT_API Responsesearch (const SearchDescription &desc) override
 Performs a search against the MarkLogic database given the provided search query, text and options. More...
 
MLCLIENT_API ResponsesearchExtension (const std::string &extensionName, const SearchDescription &desc) override
 Performs a search against a REST extension that is compatible with POST /v1/search (i.e. Connection::search) More...
 
MLCLIENT_API ResponsesaveSearchOptions (const std::string &name, const IDocumentContent *optionsDoc) override
 Saves search options to the server. More...
 
MLCLIENT_API Responsevalues (const std::string &valuesName, const std::string &optionsName) override
 Performs a values lookup in MarkLogic Server, returning the top values from the lexicon as per the search options configuration used. More...
 
MLCLIENT_API ResponsevaluesExtension (const std::string &extensionName, const std::string &valuesName, const std::string &optionsName, const SearchDescription &desc) override
 Performs a values against a REST extension that is compatible with POST /v1/search (i.e. Connection::search) More...
 
MLCLIENT_API ResponselistRootCollections () override
 Lists the top level collections. I.e. ones starting without a / or ones starting with a / but not containing a / character See IConnection for details. More...
 
MLCLIENT_API ResponselistCollections (const std::string &parentCollection) override
 Lists the immediate child collections of the specified parent Collections. See IConnection for details. More...
 
- Public Member Functions inherited from mlclient::IConnection
MLCLIENT_API IConnection ()=default
 Creates a Connection instance. More...
 
virtual ~IConnection ()=default
 

Detailed Description

Provides a high level logical object representing all access to a single MarkLogic database.

Author
Adam Fowler adam..nosp@m.fowl.nosp@m.er@ma.nosp@m.rklo.nosp@m.gic.c.nosp@m.om
Since
8.0.0
Date
2015-11-29

Wraps all underlying TCP, HTTP and authentication provided by the internal API. Provides convenience methods that map 1:1 with MarkLogic Server's REST API.

Constructor & Destructor Documentation

MLCLIENT_API mlclient::Connection::Connection ( )

Creates a Connection instance.

Defaults connection to admin/admin, localhost, nossl, port 8002, and the Documents database.

Since
8.0.0
MLCLIENT_API mlclient::Connection::~Connection ( )

Destroys a Connection instance.

Member Function Documentation

MLCLIENT_API void mlclient::Connection::configure ( const std::string &  hostname,
const std::string &  port,
const std::string &  username,
const std::string &  password,
const bool  usessl = false 
)
overridevirtual

Configures this connection, providing connection override information - host, port, username, password and SSL usage

Since
8.0.0

See IConnection for details.

Implements mlclient::IConnection.

MLCLIENT_API bool mlclient::Connection::connect ( )
overridevirtual

Connects or tests the authentication in the connection. May not actually connect.

Note
Should be called prior to any use of functions. Is not called for the developer

See IConnection for details.

Implements mlclient::IConnection.

MLCLIENT_API Response* mlclient::Connection::deleteDocument ( const std::string &  uri)
overridevirtual

Deletes the specified document by URI.

See IConnection for details.

Since
8.0.0

Implements mlclient::IConnection.

MLCLIENT_API void mlclient::Connection::disconnect ( )
overridevirtual

Frees up resources held by the connection, until the next call to connect.

Note
Should be called by a class' destructor

See IConnection for details.

Implements mlclient::IConnection.

MLCLIENT_API Response* mlclient::Connection::doDelete ( const std::string &  pathAndQueryString)
overridevirtual

Performs a HTTP DELETE Request against MarkLogic Server.

See IConnection for details.

Since
8.0.0

Implements mlclient::IConnection.

MLCLIENT_API Response* mlclient::Connection::doGet ( const std::string &  pathAndQuerystring)
overridevirtual

Performs a HTTP GET Request against MarkLogic Server.

See IConnection for details.

Since
8.0.0

Implements mlclient::IConnection.

MLCLIENT_API Response* mlclient::Connection::doPost ( const std::string &  pathAndQuerystring,
const IDocumentContent payload 
)
overridevirtual

Performs a HTTP POST Request against MarkLogic Server.

See IConnection for details.

Since
8.0.0

Implements mlclient::IConnection.

MLCLIENT_API Response* mlclient::Connection::doPut ( const std::string &  pathAndQuerystring,
const IDocumentContent payload 
)
overridevirtual

Performs a HTTP PUT Request against MarkLogic Server.

See IConnection for details.

Since
8.0.0

Implements mlclient::IConnection.

MLCLIENT_API std::string mlclient::Connection::getDatabaseName ( )
overridevirtual

Returns the database name we're querying/updating. Defaults to Documents.

See IConnection for details.

Since
8.0.0

Implements mlclient::IConnection.

MLCLIENT_API Response* mlclient::Connection::getDocument ( const std::string &  uri)
overridevirtual

Retrieves a document from the server, at the given document URI (MarkLogic unique document ID)

See IConnection for details.

Since
8.0.0

Implements mlclient::IConnection.

virtual MLCLIENT_API Response* mlclient::Connection::getDocument ( Document inout_document)
overridevirtual

Retrieves a document from the server, at the given document URI (MarkLogic unique document ID, within the Document object)

See IConnection for details.

Since
8.0.2

Implements mlclient::IConnection.

virtual MLCLIENT_API Response* mlclient::Connection::getDocumentContent ( Document inout_document)
overridevirtual

Populates the content of the specified document (MUST have a uri).

See IConnection for details.

Since
8.0.2

Implements mlclient::IConnection.

virtual MLCLIENT_API Response* mlclient::Connection::getDocumentPermissions ( Document inout_document)
overridevirtual

Populates the permissions of the specified document (MUST have a uri).

See IConnection for details.

Since
8.0.2

Implements mlclient::IConnection.

virtual MLCLIENT_API Response* mlclient::Connection::getDocumentProperties ( Document inout_document)
overridevirtual

Populates the properties of the specified document (MUST have a uri).

See IConnection for details.

Since
8.0.2

Implements mlclient::IConnection.

MLCLIENT_API Response* mlclient::Connection::listCollections ( const std::string &  parentCollection)
overridevirtual

Lists the immediate child collections of the specified parent Collections. See IConnection for details.

Since
8.0.2

Implements mlclient::IConnection.

MLCLIENT_API Response* mlclient::Connection::listRootCollections ( )
overridevirtual

Lists the top level collections. I.e. ones starting without a / or ones starting with a / but not containing a / character See IConnection for details.

Since
8.0.2

Implements mlclient::IConnection.

MLCLIENT_API Response* mlclient::Connection::saveDocument ( const Document doc)
overridevirtual

Saves the specified document to MarkLogic Server.

See IConnection for details.

Since
8.0.2

Implements mlclient::IConnection.

MLCLIENT_API Response* mlclient::Connection::saveDocumentContent ( const std::string &  uri,
const IDocumentContent payload 
)
overridevirtual

Saves a document to MarkLogic (either as new or an update), at the given document URI (MarkLogic unique document ID)

See IConnection for details.

Since
8.0.0

Implements mlclient::IConnection.

MLCLIENT_API Response* mlclient::Connection::saveDocuments ( const DocumentSet documents,
const long  startPosInclusive,
const long  endPosInclusive 
)
overridevirtual

Saves a set of documents as a single batch to MarkLogic Server.

See IConnection for details.

Since
8.0.2

Implements mlclient::IConnection.

MLCLIENT_API Response* mlclient::Connection::saveSearchOptions ( const std::string &  name,
const IDocumentContent optionsDoc 
)
overridevirtual

Saves search options to the server.

See IConnection for details.

Since
8.0.2

Implements mlclient::IConnection.

MLCLIENT_API Response* mlclient::Connection::search ( const SearchDescription desc)
overridevirtual

Performs a search against the MarkLogic database given the provided search query, text and options.

See IConnection for details.

Since
8.0.0

Implements mlclient::IConnection.

MLCLIENT_API Response* mlclient::Connection::searchExtension ( const std::string &  extensionName,
const SearchDescription desc 
)
overridevirtual

Performs a search against a REST extension that is compatible with POST /v1/search (i.e. Connection::search)

See IConnection for details.

Since
8.0.2

Implements mlclient::IConnection.

MLCLIENT_API void mlclient::Connection::setDatabaseName ( const std::string &  db)
overridevirtual

Sets the name of the database to query/update. Defaults to Documents.

See IConnection for details.

Since
8.0.0

Implements mlclient::IConnection.

MLCLIENT_API Response* mlclient::Connection::values ( const std::string &  valuesName,
const std::string &  optionsName 
)
overridevirtual

Performs a values lookup in MarkLogic Server, returning the top values from the lexicon as per the search options configuration used.

See IConnection for details.

Since
8.0.2

Implements mlclient::IConnection.

MLCLIENT_API Response* mlclient::Connection::valuesExtension ( const std::string &  extensionName,
const std::string &  valuesName,
const std::string &  optionsName,
const SearchDescription desc 
)
overridevirtual

Performs a values against a REST extension that is compatible with POST /v1/search (i.e. Connection::search)

See IConnection for details.

Since
8.0.2

Implements mlclient::IConnection.


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