List of usage examples for com.mongodb ReadPreference primaryPreferred
public static ReadPreference primaryPreferred(final long maxStaleness, final TimeUnit timeUnit)
From source file:com.github.maasdi.mongo.NamedReadPreference.java
License:Apache License
public ReadPreference getTaggableReadPreference(DBObject firstTagSet, DBObject... remainingTagSets) { switch (this) { case PRIMARY_PREFERRED: return ReadPreference.primaryPreferred(firstTagSet, remainingTagSets); case SECONDARY: return ReadPreference.secondary(firstTagSet, remainingTagSets); case SECONDARY_PREFERRED: return ReadPreference.secondaryPreferred(firstTagSet, remainingTagSets); case NEAREST: return ReadPreference.nearest(firstTagSet, remainingTagSets); default:/*from w w w .j a va 2 s . co m*/ return (pref instanceof TaggableReadPreference) ? pref : null; } }