driver-core/src/main/com/mongodb/ReadPreference.java
public static ReadPreference secondaryPreferred(final long maxStaleness, final TimeUnit timeUnit) {
        return new SecondaryPreferredReadPreference(Collections.<TagSet>emptyList(), maxStaleness, timeUnit);
    }
public static ReadPreference secondaryPreferred(final long maxStaleness, final TimeUnit timeUnit) {
        return new SecondaryPreferredReadPreference(Collections.<TagSet>emptyList(), maxStaleness, timeUnit);
    }
public static ReadPreference secondaryPreferred ( final long maxStaleness , final TimeUnit timeUnit ) { return new SecondaryPreferredReadPreference ( Collections . < TagSet > emptyList ( ) , maxStaleness , timeUnit ) ; }
Gets a read preference that forces reads to a secondary that is less stale than the given maximumm if one is available,
otherwise to the primary.

<p>
The driver estimates the staleness of each secondary, based on lastWriteDate values provided in server isMaster responses,
and selects only those secondaries whose staleness is less than or equal to maxStaleness.
</p>     *
@param maxStaleness the max allowable staleness of secondaries. The minimum value is either 90 seconds, or the heartbeat frequency
plus 10 seconds, whichever is greatest.
@param timeUnit the time unit of maxStaleness
@return ReadPreference which reads secondary if available, otherwise from primary.
@since 3.4
@see TaggableReadPreference#getMaxStaleness(TimeUnit)
Gets a read preference that forces reads to a secondary that is less stale than the given maximumm if one is available otherwise to the primary .