code
docs
tests
EntityStore service backed by a MongoDB collection in which Entity state is stored as native MongoDB BSON.
Table 58. Artifact
| Group ID | Artifact ID | Version |
|---|---|---|
org.apache.polygene.extensions | org.apache.polygene.extension.entitystore-mongodb | 0 |
Assembly is done using the provided Assembler:
public void assemble( ModuleAssembly module )
throws AssemblyException
{
[...snip...]
new MongoDBEntityStoreAssembler().withConfig( config, Visibility.layer ).assemble( module );
[...snip...]
}
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;
}
}