public class SRRset extends RRset
{
private SecurityStatus mSecurityStatus;
-
+
/** Create a new, blank SRRset. */
public SRRset()
{
* contained RRsig records as well.
* @return The cloned SRRset.
*/
- public SRRset cloneSRRset(long withNewTTL)
- {
- SRRset nr = new SRRset();
-
- for (Iterator i = rrs(); i.hasNext();)
- {
- nr.addRR(((Record) i.next()).withTTL(withNewTTL));
- }
- for (Iterator i = sigs(); i.hasNext();)
- {
- nr.addRR(((Record) i.next()).withTTL(withNewTTL));
- }
-
- nr.mSecurityStatus = mSecurityStatus;
-
- return nr;
- }
+// public SRRset cloneSRRset(long withNewTTL)
+// {
+// SRRset nr = new SRRset();
+//
+// for (Iterator i = rrs(); i.hasNext();)
+// {
+// nr.addRR(((Record) i.next()).withTTL(withNewTTL));
+// }
+// for (Iterator i = sigs(); i.hasNext();)
+// {
+// nr.addRR(((Record) i.next()).withTTL(withNewTTL));
+// }
+//
+// nr.mSecurityStatus = mSecurityStatus;
+//
+// return nr;
+// }
public SRRset cloneSRRsetNoSigs()
{
return nr;
}
+
+
/**
* Return the current security status (generally: UNCHECKED, BOGUS, or
* SECURE).
* Set the current security status for this SRRset. This status will be
* shared amongst all copies of this SRRset (created with cloneSRRset())
*/
- public void setSecurityStatus(int status)
+ public void setSecurityStatus(byte status)
{
mSecurityStatus.setStatus(status);
}
+ public int totalSize() {
+ int num_sigs = 0;
+ for (Iterator i = sigs(); i.hasNext(); ) {
+ num_sigs++;
+ }
+ return size() + num_sigs;
+ }
+
/**
* @return The total number of records (data + sigs) in the SRRset.
*/
return totalSize();
}
+ public RRSIGRecord firstSig() {
+ for (Iterator i = sigs(); i.hasNext(); ) {
+ return (RRSIGRecord) i.next();
+ }
+ return null;
+ }
/**
* @return true if this RRset has RRSIG records that cover data records.
* (i.e., RRSIG SRRsets return false)
return sig.getSigner();
}
- public void setTTL(long ttl)
- {
- if (ttl < 0)
- {
- throw new IllegalArgumentException("ttl can't be less than zero, stupid! was " + ttl);
- }
- super.setTTL(ttl);
- }
+// public void setTTL(long ttl)
+// {
+// if (ttl < 0)
+// {
+// throw new IllegalArgumentException("ttl can't be less than zero, stupid! was " + ttl);
+// }
+// super.setTTL(ttl);
+// }
}