org.axonframework.mongo3.eventstore
Class MongoOptionsFactory

java.lang.Object
  extended by org.axonframework.mongo3.eventstore.MongoOptionsFactory

public class MongoOptionsFactory
extends Object

Factory class used to create a MongoOptions instance. The instance makes use of the defaults as provided by the MongoOptions class. The moment you set a valid value, that value is used to create the options object.

Since:
2.0 (in incubator since 0.7)
Author:
Jettro Coenradie

Constructor Summary
MongoOptionsFactory()
          Default constructor for the factory that initializes the defaults.
 
Method Summary
 com.mongodb.MongoClientOptions createMongoOptions()
          Uses the configured parameters to create a MongoOptions instance.
 int getConnectionsPerHost()
          Getter for connectionsPerHost.
 int getConnectionTimeout()
          Connection time out in milli seconds for doing something in mongo.
 int getMaxWaitTime()
          get the maximum time a blocked thread that waits for a connection should wait.
 int getSocketTimeOut()
          Getter for the socket timeout.
 int getThreadsAllowedToBlockForConnectionMultiplier()
          Getter for the amount of threads that block in relation to the amount of possible connections.
 void setConnectionsPerHost(int connectionsPerHost)
          Setter for the connections per host that are allowed.
 void setConnectionTimeout(int connectionTimeout)
          Setter for the connection time out.
 void setMaxWaitTime(int maxWaitTime)
          Set the max wait time for a blocked thread in milli seconds.
 void setSocketTimeOut(int socketTimeOut)
          Setter for the socket time out.
 void setThreadsAllowedToBlockForConnectionMultiplier(int threadsAllowedToBlockForConnectionMultiplier)
          Set the multiplier for the amount of threads to block in relation to the maximum amount of connections.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MongoOptionsFactory

public MongoOptionsFactory()
Default constructor for the factory that initializes the defaults.

Method Detail

createMongoOptions

public com.mongodb.MongoClientOptions createMongoOptions()
Uses the configured parameters to create a MongoOptions instance.

Returns:
MongoClientOptions instance based on the configured properties

getConnectionsPerHost

public int getConnectionsPerHost()
Getter for connectionsPerHost.

Returns:
number representing the connections per host

setConnectionsPerHost

public void setConnectionsPerHost(int connectionsPerHost)
Setter for the connections per host that are allowed.

Parameters:
connectionsPerHost - number representing the number of connections per host

getConnectionTimeout

public int getConnectionTimeout()
Connection time out in milli seconds for doing something in mongo. Zero is indefinite

Returns:
number representing milli seconds of timeout

setConnectionTimeout

public void setConnectionTimeout(int connectionTimeout)
Setter for the connection time out.

Parameters:
connectionTimeout - number representing the connection timeout in millis

getMaxWaitTime

public int getMaxWaitTime()
get the maximum time a blocked thread that waits for a connection should wait.

Returns:
number of milli seconds the thread waits for a connection

setMaxWaitTime

public void setMaxWaitTime(int maxWaitTime)
Set the max wait time for a blocked thread in milli seconds.

Parameters:
maxWaitTime - number representing the number of milli seconds to wait for a thread

getSocketTimeOut

public int getSocketTimeOut()
Getter for the socket timeout.

Returns:
Number representing the amount of milli seconds to wait for a socket connection

setSocketTimeOut

public void setSocketTimeOut(int socketTimeOut)
Setter for the socket time out.

Parameters:
socketTimeOut - number representing the amount of milli seconds to wait for a socket connection

getThreadsAllowedToBlockForConnectionMultiplier

public int getThreadsAllowedToBlockForConnectionMultiplier()
Getter for the amount of threads that block in relation to the amount of possible connections.

Returns:
Number representing the multiplier of maximum allowed blocked connections in relation to the maximum allowed connections

setThreadsAllowedToBlockForConnectionMultiplier

public void setThreadsAllowedToBlockForConnectionMultiplier(int threadsAllowedToBlockForConnectionMultiplier)
Set the multiplier for the amount of threads to block in relation to the maximum amount of connections.

Parameters:
threadsAllowedToBlockForConnectionMultiplier - Number representing the multiplier of the amount of threads to block in relation to the connections that are allowed.


Copyright © 2010-2016. All Rights Reserved.