public class

MongoObjectStore

extends Object
implements MuleContextAware PartitionableExpirableObjectStore<T extends Serializable>
java.lang.Object
   ↳ org.mule.module.mongo.MongoObjectStore

Class Overview

A PartitionableExpirableObjectStore backed by MongoDB.

Summary

Constants
String ID_FIELD
String KEY_FIELD
String OBJECTSTORE_COLLECTION_PREFIX
String OBJECTSTORE_DEFAULT_PARTITION_NAME
String TIMESTAMP_FIELD
String VALUE_FIELD
Fields
private static final List<String> NO_FIELD_LIST
private MuleContext context
private String database The database name of the Mongo server
private String host The host of the Mongo server
private MongoClient mongoClient
private String password The password used to connect to the Mongo server
private int port The port of the Mongo server
private String username The username used to connect to the Mongo server
private WriteConcern writeConcern The default concern to use to when writing to Mongo
Public Constructors
MongoObjectStore()
Public Methods
List<Serializable> allKeys()
List<Serializable> allKeys(String partitionName)
List<String> allPartitions()
void clear(String s)
void clear()
void close()
void close(String partitionName)
boolean contains(Serializable key, String partitionName)
boolean contains(Serializable key)
void disposePartition(String partitionName)
void expire(int entryTtl, int maxEntries)
void expire(int entryTtl, int ignoredMaxEntries, String partitionName)
String getDatabase()
String getHost()
String getPassword()
int getPort()
String getUsername()
WriteConcern getWriteConcern()
void initialize()
boolean isPersistent()
void open(String partitionName)
void open()
Serializable remove(Serializable key, String partitionName)
Serializable remove(Serializable key)
Serializable retrieve(Serializable key)
Serializable retrieve(Serializable key, String partitionName)
void setDatabase(String database)
void setHost(String host)
void setMuleContext(MuleContext context)
void setPassword(String password)
void setPort(int port)
void setUsername(String username)
void setWriteConcern(WriteConcern writeConcern)
void store(Serializable key, Serializable value)
void store(Serializable key, Serializable value, String partitionName)
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.mule.api.context.MuleContextAware
From interface org.mule.api.store.ExpirableObjectStore
From interface org.mule.api.store.ListableObjectStore
From interface org.mule.api.store.ObjectStore
From interface org.mule.api.store.PartitionableExpirableObjectStore
From interface org.mule.api.store.PartitionableObjectStore

Constants

private static final String ID_FIELD

Constant Value: "_id"

private static final String KEY_FIELD

Constant Value: "key"

private static final String OBJECTSTORE_COLLECTION_PREFIX

Constant Value: "mule.objectstore."

private static final String OBJECTSTORE_DEFAULT_PARTITION_NAME

Constant Value: "_default"

private static final String TIMESTAMP_FIELD

Constant Value: "timestamp"

private static final String VALUE_FIELD

Constant Value: "value"

Fields

private static final List<String> NO_FIELD_LIST

private MuleContext context

private String database

The database name of the Mongo server

private String host

The host of the Mongo server

private MongoClient mongoClient

private String password

The password used to connect to the Mongo server

private int port

The port of the Mongo server

private String username

The username used to connect to the Mongo server

private WriteConcern writeConcern

The default concern to use to when writing to Mongo

Public Constructors

public MongoObjectStore ()

Public Methods

public List<Serializable> allKeys ()

Throws
ObjectStoreException

public List<Serializable> allKeys (String partitionName)

Parameters
partitionName
Throws
ObjectStoreException

public List<String> allPartitions ()

Throws
ObjectStoreException

public void clear (String s)

Parameters
s
Throws
ObjectStoreException

public void clear ()

Throws
ObjectStoreException

public void close ()

Throws
ObjectStoreException

public void close (String partitionName)

Parameters
partitionName
Throws
ObjectStoreException

public boolean contains (Serializable key, String partitionName)

Parameters
key
partitionName
Throws
ObjectStoreException

public boolean contains (Serializable key)

Parameters
key
Throws
ObjectStoreException

public void disposePartition (String partitionName)

Parameters
partitionName
Throws
ObjectStoreException

public void expire (int entryTtl, int maxEntries)

Parameters
entryTtl
maxEntries
Throws
ObjectStoreException

public void expire (int entryTtl, int ignoredMaxEntries, String partitionName)

Parameters
entryTtl
ignoredMaxEntries
partitionName
Throws
ObjectStoreException

public String getDatabase ()

public String getHost ()

public String getPassword ()

public int getPort ()

public String getUsername ()

public WriteConcern getWriteConcern ()

public void initialize ()

Throws
UnknownHostException

public boolean isPersistent ()

public void open (String partitionName)

Parameters
partitionName
Throws
ObjectStoreException

public void open ()

Throws
ObjectStoreException

public Serializable remove (Serializable key, String partitionName)

Parameters
key
partitionName
Throws
ObjectStoreException

public Serializable remove (Serializable key)

Parameters
key
Throws
ObjectStoreException

public Serializable retrieve (Serializable key)

Parameters
key
Throws
ObjectStoreException

public Serializable retrieve (Serializable key, String partitionName)

Parameters
key
partitionName
Throws
ObjectStoreException

public void setDatabase (String database)

Parameters
database

public void setHost (String host)

Parameters
host

public void setMuleContext (MuleContext context)

Parameters
context

public void setPassword (String password)

Parameters
password

public void setPort (int port)

Parameters
port

public void setUsername (String username)

Parameters
username

public void setWriteConcern (WriteConcern writeConcern)

Parameters
writeConcern

public void store (Serializable key, Serializable value)

Parameters
key
value
Throws
ObjectStoreException

public void store (Serializable key, Serializable value, String partitionName)

Parameters
key
value
partitionName
Throws
ObjectStoreException