org.mule.modules

mule-module-mongohq

config

Namespacehttp://www.mulesoft.org/schema/mule/mongohq
Schema Locationhttp://www.mulesoft.org/schema/mule/mongohq/current/mule-mongohq.xsd  (View Schema)
Schema Version1.0
Minimum Mule Version3.2

Module Overview

This connector provides functionality to connect with MongoHQ a mongoDB hosting provider.

Summary

Configuration
<mongohq:config>
Configure an instance of this module
Transformers
<mongohq:transform-database-request-to-json>
Transform DatabaseRequest to JSON

<mongohq:transform-json-to-database>
Transform JSON to database

<mongohq:transform-json-to-databases>
Transform JSON to a list of databases

Message Processors
<mongohq:create-database>
Create Database

<mongohq:delete-database>
Delete a database

<mongohq:list-databases>
List Databases

<mongohq:retrieve-database-info>
Retrieve information about a particular database

Configuration

To use the this module within a flow the namespace to the module must be included. The resulting flow will look similar to the following:

<mule xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:mongohq="http://www.mulesoft.org/schema/mule/mongohq"
      xsi:schemaLocation="
               http://www.mulesoft.org/schema/mule/core
               http://www.mulesoft.org/schema/mule/core/current/mule.xsd
               http://www.mulesoft.org/schema/mule/mongohq
               http://www.mulesoft.org/schema/mule/mongohq/current/mule-mongohq.xsd">

      <!-- here goes your flows and configuration elements -->

</mule>

This module is configured using the config element. This element must be placed outside of your flows and at the root of your Mule application. You can create as many configurations as you deem necessary as long as each carries its own name.

Each message processor, message source or transformer carries a config-ref attribute that allows the invoker to specify which configuration to use.

Attributes
TypeNameDefault ValueDescriptionJava TypeMIME TypeEncoding
xs:string name Optional. Give a name to this configuration so it can be later referenced.
xs:string apiKey API Key

Example

INCLUDE_ERROR

Message Processors

<mongohq:create-database>

Create Database

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
databaseRequest Data required to create a database (name and slug of the plan) DatabaseRequest */*
Returns
Return Type Description
void The status of the operation
Exception Payloads
Payload ClassDescription
IOException if the connection fails

<mongohq:delete-database>

Delete a database

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
dbName Name of the database to remove String */* UTF-8
Returns
Return Type Description
void The status of the operation
Exception Payloads
Payload ClassDescription
IOException if the connection fails

<mongohq:list-databases>

List Databases

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
Returns
Return Type Description
List<Database> The list of the user databases
Exception Payloads
Payload ClassDescription
IOException if the connection fails

<mongohq:retrieve-database-info>

Retrieve information about a particular database

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
dbName Name of the database to retrieve String */* UTF-8
Returns
Return Type Description
Database The database data
Exception Payloads
Payload ClassDescription
IOException if the connection fails

Message Sources

Transformers

<mongohq:transform-database-request-to-json>

Transform DatabaseRequest to JSON

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
databaseRequest Request to create a JSON database (name and slug) DatabaseRequest */*
Returns
Return Type Description
String string JSON representation of the request
Exception Payloads
Payload ClassDescription
IOException if the connection fails

<mongohq:transform-json-to-database>

Transform JSON to database

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
json JSON string to transform String */* UTF-8
Returns
Return Type Description
Database A Database object
Exception Payloads
Payload ClassDescription
IOException if the connection fails

<mongohq:transform-json-to-databases>

Transform JSON to a list of databases

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
json JSON string to transform String */* UTF-8
Returns
Return Type Description
List<Database> A list of Database object
Exception Payloads
Payload ClassDescription
IOException if the connection fails