List of usage examples for com.mongodb ReadPreference secondaryPreferred
public static ReadPreference secondaryPreferred(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 . java 2s.c o m return (pref instanceof TaggableReadPreference) ? pref : null; } }