Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
JDK 17 jdk.naming.dns.jmod - Naming DNS Module
JDK 17 jdk.naming.dns.jmod is the JMOD file for JDK 17 Naming DNS module.
JDK 17 Naming DNS module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\jdk.naming.dns.jmod.
JDK 17 Naming DNS module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 Naming DNS module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\jdk.naming.dns.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ com/sun/jndi/dns/ZoneNode.java
/* * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package com.sun.jndi.dns; import java.lang.ref.SoftReference; import java.util.Date; import java.util.Vector; /** * ZoneNode extends NameNode to represent a tree of the zones in the * DNS namespace, along with any intermediate nodes between zones. * A ZoneNode that represents a zone may be "populated" with a * NameNode tree containing the zone's contents. * * <p> A populated zone's contents will be flagged as having expired after * the time specified by the minimum TTL value in the zone's SOA record. * * <p> Since zone cuts aren't directly modeled by a tree of ZoneNodes, * ZoneNode.isZoneCut() always returns false. * * <p> The synchronization strategy is documented in DnsContext.java. * * <p> The zone's contents are accessed via a soft reference, so its * heap space may be reclaimed when necessary. The zone may be * repopulated later. * * @author Scott Seligman */ class ZoneNode extends NameNode { private SoftReference<NameNode> contentsRef = null; // the zone's namespace private long serialNumber = -1; // the zone data's serial number private Date expiration = null; // time when the zone's data expires ZoneNode(String label) { super(label); } protected NameNode newNameNode(String label) { return new ZoneNode(label); } /* * Clears the contents of this node. If the node was flagged as * expired, it remains so. */ synchronized void depopulate() { contentsRef = null; serialNumber = -1; } /* * Is this node currently populated? */ synchronized boolean isPopulated() { return (getContents() != null); } /* * Returns the zone's contents, or null if the zone is not populated. */ synchronized NameNode getContents() { return (contentsRef != null) ? contentsRef.get() : null; } /* * Has this zone's data expired? */ synchronized boolean isExpired() { return ((expiration != null) && expiration.before(new Date())); } /* * Returns the deepest populated zone on the path specified by a * fully-qualified domain name, or null if there is no populated * zone on that path. Note that a node may be depopulated after * being returned. */ ZoneNode getDeepestPopulated(DnsName fqdn) { ZoneNode znode = this; ZoneNode popNode = isPopulated() ? this : null; for (int i = 1; i < fqdn.size(); i++) { // "i=1" to skip root label znode = (ZoneNode) znode.get(fqdn.getKey(i)); if (znode == null) { break; } else if (znode.isPopulated()) { popNode = znode; } } return popNode; } /* * Populates (or repopulates) a zone given its own fully-qualified * name and its resource records. Returns the zone's new contents. */ NameNode populate(DnsName zone, ResourceRecords rrs) { // assert zone.get(0).isEmpty(); // zone has root label // assert (zone.size() == (depth() + 1)); // +1 due to root label NameNode newContents = new NameNode(null); for (int i = 0; i < rrs.answer.size(); i++) { ResourceRecord rr = rrs.answer.elementAt(i); DnsName n = rr.getName(); // Ignore resource records whose names aren't within the zone's // domain. Also skip records of the zone's top node, since // the zone's root NameNode is already in place. if ((n.size() > zone.size()) && n.startsWith(zone)) { NameNode nnode = newContents.add(n, zone.size()); if (rr.getType() == ResourceRecord.TYPE_NS) { nnode.setZoneCut(true); } } } // The zone's SOA record is the first record in the answer section. ResourceRecord soa = rrs.answer.firstElement(); synchronized (this) { contentsRef = new SoftReference<NameNode>(newContents); serialNumber = getSerialNumber(soa); setExpiration(getMinimumTtl(soa)); return newContents; } } /* * Set this zone's data to expire in {@code secsToExpiration} seconds. */ private void setExpiration(long secsToExpiration) { expiration = new Date(System.currentTimeMillis() + 1000 * secsToExpiration); } /* * Returns an SOA record's minimum TTL field. */ private static long getMinimumTtl(ResourceRecord soa) { String rdata = (String) soa.getRdata(); int pos = rdata.lastIndexOf(' ') + 1; return Long.parseLong(rdata.substring(pos)); } /* * Compares this zone's serial number with that of an SOA record. * Zone must be populated. * Returns a negative, zero, or positive integer as this zone's * serial number is less than, equal to, or greater than the SOA * record's. * See ResourceRecord.compareSerialNumbers() for a description of * serial number arithmetic. */ int compareSerialNumberTo(ResourceRecord soa) { // assert isPopulated(); return ResourceRecord.compareSerialNumbers(serialNumber, getSerialNumber(soa)); } /* * Returns an SOA record's serial number. */ private static long getSerialNumber(ResourceRecord soa) { String rdata = (String) soa.getRdata(); // An SOA record ends with: serial refresh retry expire minimum. // Set "beg" to the space before serial, and "end" to the space after. // We go "backward" to avoid dealing with escaped spaces in names. int beg = rdata.length(); int end = -1; for (int i = 0; i < 5; i++) { end = beg; beg = rdata.lastIndexOf(' ', end - 1); } return Long.parseLong(rdata.substring(beg + 1, end)); } }
⏎ com/sun/jndi/dns/ZoneNode.java
Or download all of them as a single archive file:
File name: jdk.naming.dns-17.0.5-src.zip File size: 48006 bytes Release date: 2022-09-13 Download
⇒ JDK 17 jdk.naming.rmi.jmod - Naming RMI Module
2023-07-29, 1149👍, 0💬
Popular Posts:
How to download and install Apache ZooKeeper Source Package? Apache ZooKeeper is an open-source serv...
The Jakarta-ORO Java classes are a set of text-processing Java classes that provide Perl5 compatible...
Java Servlet 3.0 Specification API. JAR File Size and Download Location: File name: servlet-api.jar,...
commons-fileupload-1.3.3 -sources.jaris the source JAR file for Apache Commons FileUpload 1.3., whic...
kernel.jar is a component in iText Java library to provide low-level functionalities. iText Java lib...