Home | History | Annotate | Download | only in DNS

Lines Matching refs:TTL

6  * Routines for parsing BIND-style TTL values.  These values consist of
13 public final class TTL {
18 TTL() {}
27 * Parses a TTL-like value, which can either be expressed as a number or a
34 * @throws NumberFormatException The string was not in a valid TTL format.
41 long ttl = 0;
58 ttl += value;
60 if (ttl > 0xFFFFFFFFL)
64 if (ttl == 0)
65 ttl = value;
67 if (ttl > 0xFFFFFFFFL)
69 else if (ttl > MAX_VALUE && clamp)
70 ttl = MAX_VALUE;
71 return ttl;
75 * Parses a TTL, which can either be expressed as a number or a BIND-style
77 * @param s The string representing the TTL
78 * @return The TTL as a number of seconds
79 * @throws NumberFormatException The string was not in a valid TTL format.
87 format(long ttl) {
88 TTL.check(ttl);
91 secs = ttl % 60;
92 ttl /= 60;
93 mins = ttl % 60;
94 ttl /= 60;
95 hours = ttl % 24;
96 ttl /= 24;
97 days = ttl % 7;
98 ttl /= 7;
99 weeks = ttl;