11package com .alibaba .dcm ;
22
3- import com .alibaba .dcm .internal .*;
3+ import com .alibaba .dcm .internal .InetAddressCacheUtilCommons ;
4+ import com .alibaba .dcm .internal .InetAddressCacheUtilForJava8Minus ;
5+ import com .alibaba .dcm .internal .InetAddressCacheUtilForJava9Plus ;
6+ import sun .net .InetAddressCachePolicy ;
47
8+ import javax .annotation .Nonnull ;
9+ import javax .annotation .Nullable ;
510import java .io .InputStream ;
611import java .util .Arrays ;
712import java .util .List ;
813import java .util .Map ;
914import java .util .Properties ;
1015import java .util .regex .Pattern ;
1116
12- import javax .annotation .Nonnull ;
13- import javax .annotation .Nullable ;
14-
1517import static com .alibaba .dcm .internal .InetAddressCacheUtilCommons .NEVER_EXPIRATION ;
1618import static com .alibaba .dcm .internal .JavaVersionUtil .isJdkAtMost8 ;
1719
@@ -265,12 +267,15 @@ public static void clearDnsCache() {
265267 * Get JVM DNS cache policy.
266268 *
267269 * @return cache seconds.
268- * <p>
269270 * <ul>
270- * <li> {@code -1} means never expired.(In effect, all negative value)</li>
271- * <li> {@code 0} never cached.</li>
271+ * <li> {@link InetAddressCachePolicy#FOREVER}({@ code -1}) means never expired.(In effect, all negative value)</li>
272+ * <li> {@link InetAddressCachePolicy#NEVER}(@ code 0) never cached.</li>
272273 * </ul>
273274 * @throws DnsCacheManipulatorException Operation fail
275+ * @see InetAddressCachePolicy#get()
276+ * @see InetAddressCachePolicy#FOREVER
277+ * @see InetAddressCachePolicy#NEVER
278+ * @see InetAddressCachePolicy#DEFAULT_POSITIVE
274279 * @since 1.3.0
275280 */
276281 public static int getDnsCachePolicy () {
@@ -288,10 +293,16 @@ public static int getDnsCachePolicy() {
288293 *
289294 * @param cacheSeconds set default dns cache time. Special input case:
290295 * <ul>
291- * <li> {@code -1} means never expired.(In effect, all negative value)</li>
292- * <li> {@code 0} never cached.</li>
296+ * <li> {@link InetAddressCachePolicy#FOREVER}({@ code -1}) means never expired.(In effect, all negative value)</li>
297+ * <li> {@link InetAddressCachePolicy#NEVER}(@ code 0) never cached.</li>
293298 * </ul>
294299 * @throws DnsCacheManipulatorException Operation fail
300+ * @see InetAddressCachePolicy
301+ * @see InetAddressCachePolicy#cachePolicy
302+ * @see InetAddressCachePolicy#get()
303+ * @see InetAddressCachePolicy#FOREVER
304+ * @see InetAddressCachePolicy#NEVER
305+ * @see InetAddressCachePolicy#DEFAULT_POSITIVE
295306 * @since 1.3.0
296307 */
297308 public static void setDnsCachePolicy (int cacheSeconds ) {
@@ -308,10 +319,13 @@ public static void setDnsCachePolicy(int cacheSeconds) {
308319 * @return negative cache seconds.
309320 * <p>
310321 * <ul>
311- * <li> {@code -1} means never expired.(In effect, all negative value)</li>
312- * <li> {@code 0} never cached.</li>
322+ * <li> {@link InetAddressCachePolicy#FOREVER}({@ code -1}) means never expired.(In effect, all negative value)</li>
323+ * <li> {@link InetAddressCachePolicy#NEVER}(@ code 0) never cached.</li>
313324 * </ul>
314325 * @throws DnsCacheManipulatorException Operation fail
326+ * @see InetAddressCachePolicy#getNegative()
327+ * @see InetAddressCachePolicy#FOREVER
328+ * @see InetAddressCachePolicy#NEVER
315329 * @since 1.3.0
316330 */
317331 public static int getDnsNegativeCachePolicy () {
@@ -327,10 +341,13 @@ public static int getDnsNegativeCachePolicy() {
327341 *
328342 * @param negativeCacheSeconds set default dns cache time. Special input case:
329343 * <ul>
330- * <li> {@code -1} means never expired.(In effect, all negative value)</li>
331- * <li> {@code 0} never cached.</li>
344+ * <li> {@link InetAddressCachePolicy#FOREVER}({@ code -1}) means never expired.(In effect, all negative value)</li>
345+ * <li> {@link InetAddressCachePolicy#NEVER}(@ code 0) never cached.</li>
332346 * </ul>
333347 * @throws DnsCacheManipulatorException Operation fail
348+ * @see InetAddressCachePolicy
349+ * @see InetAddressCachePolicy#FOREVER
350+ * @see InetAddressCachePolicy#NEVER
334351 * @since 1.3.0
335352 */
336353 public static void setDnsNegativeCachePolicy (int negativeCacheSeconds ) {
0 commit comments