This project has retired. For details please refer to its Attic page.
MongoDB EntityStore Starter Template for Bootstrap
Overview
javax.json serialization
javax.xml serialization
MessagePack serialization
Memory EntityStore
File EntityStore
Geode EntityStore
Hazelcast EntityStore
JClouds EntityStore
JDBM EntityStore
LevelDB EntityStore
MongoDB EntityStore
Preferences EntityStore
Redis EntityStore
Riak EntityStore
SQL EntityStore
Ehcache Cache
Memcache Cache
ElasticSearch Index/Query
OpenRDF Index/Query
Apache Solr Index/Query
SQL Index/Query
Codahale Metrics
Migration
Reindexer

MongoDB EntityStore

code

docs

tests

EntityStore service backed by a MongoDB collection in which Entity state is stored as native MongoDB BSON.

Table 58. Artifact

Group IDArtifact IDVersion

org.apache.polygene.extensions

org.apache.polygene.extension.entitystore-mongodb

0


Assembly

Assembly is done using the provided Assembler:

public void assemble( ModuleAssembly module )
    throws AssemblyException
{
  [...snip...]

    new MongoDBEntityStoreAssembler().withConfig( config, Visibility.layer ).assemble( module );
      [...snip...]

}

Configuration

Here are the configuration properties for the MongoDB EntityStore:

public interface MongoEntityStoreConfiguration
    extends ConfigurationComposite
{

    @Optional
    Property<String> hostname();

    @Optional
    Property<Integer> port();

    @UseDefaults
    Property<List<ServerAddress>> nodes();

    @UseDefaults
    Property<String> username();

    @UseDefaults
    Property<String> password();

    @Optional
    Property<String> database();

    @Optional
    Property<String> collection();

    @UseDefaults
    Property<WriteConcern> writeConcern();

    enum WriteConcern
    {
        /**
         *  Write operations that use this write concern will wait for acknowledgement,
         *  using the default write concern configured on the server.
         *  This is the default value.
         */
        ACKNOWLEDGED,
        /**
         * Write operations that use this write concern will wait for acknowledgement from a single member.
         */
        W1,
        /**
         * Write operations that use this write concern will wait for acknowledgement from two members.
         */
        W2,
        /**
         * Write operations that use this write concern will wait for acknowledgement from three members.
         */
        W3,
        /**
         * Write operations that use this write concern will return as soon as the message is written to the socket.
         * Exceptions are raised for network issues, but not server errors.
         */
        UNACKNOWLEDGED,
        /**
         * Write operations wait for the server to group commit to the journal file on disk.
         */
        JOURNALED,
        /**
         * Exceptions are raised for network issues, and server errors;
         * waits on a majority of servers for the write operation.
         */
        MAJORITY;

    }
}