/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* 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
*/
super(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.
*/
return (contentsRef != null)
: null;
}
/*
* Has this zone's data expired?
*/
synchronized boolean isExpired() {
}
/*
* 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.
*/
break;
} else if (znode.isPopulated()) {
}
}
return popNode;
}
/*
* Populates (or repopulates) a zone given its own fully-qualified
* name and its resource records. Returns the zone's new contents.
*/
// assert zone.get(0).equals(""); // zone has root label
// assert (zone.size() == (depth() + 1)); // +1 due to root label
// 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.
nnode.setZoneCut(true);
}
}
}
// The zone's SOA record is the first record in the answer section.
synchronized (this) {
return newContents;
}
}
/*
* Set this zone's data to expire in <tt>secsToExpiration</tt> seconds.
*/
1000 * secsToExpiration);
}
/*
* Returns an SOA record's minimum TTL field.
*/
}
/*
* 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.
*/
// assert isPopulated();
}
/*
* Returns an SOA record's serial number.
*/
// 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 end = -1;
for (int i = 0; i < 5; i++) {
}
}
}