Skip to content

Commit

Permalink
Added setTTL methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike committed Jul 18, 2024
1 parent c98ebda commit 75f0ff7
Show file tree
Hide file tree
Showing 7 changed files with 255 additions and 9 deletions.
Binary file modified dist/zeroconf-1.0.1.jar
Binary file not shown.
Binary file modified dist/zeroconf-test-1.0.1.jar
Binary file not shown.
66 changes: 58 additions & 8 deletions docs/com/bfo/zeroconf/Packet.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#constructor-summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method-summary">Method</a></li>
</ul>
<ul class="sub-nav-list">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#constructor-detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method-detail">Method</a></li>
</ul>
</div>
Expand Down Expand Up @@ -82,6 +82,21 @@ <h1 title="Class Packet" class="title">Class Packet</h1>
</section>
<section class="summary">
<ul class="summary-list">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<li>
<section class="constructor-summary" id="constructor-summary">
<h2>Constructor Summary</h2>
<div class="caption"><span>Constructors</span></div>
<div class="summary-table two-column-summary">
<div class="table-header col-first">Constructor</div>
<div class="table-header col-last">Description</div>
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(java.lang.String)" class="member-name-link">Packet</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;tostring)</code></div>
<div class="col-last even-row-color">
<div class="block">Create a Packet from its String representation</div>
</div>
</div>
</section>
</li>
<!-- ========== METHOD SUMMARY =========== -->
<li>
<section class="method-summary" id="method-summary">
Expand All @@ -93,12 +108,17 @@ <h2>Method Summary</h2>
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Method</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#toString()" class="member-name-link">toString</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#write(java.nio.ByteBuffer)" class="member-name-link">write</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="external-link">ByteBuffer</a>&nbsp;out)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>long</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#timestamp()" class="member-name-link">timestamp</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Return the packet timestamp</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#toString()" class="member-name-link">toString</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#write(java.nio.ByteBuffer)" class="member-name-link">write</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="external-link">ByteBuffer</a>&nbsp;out)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Write the packet</div>
</div>
</div>
Expand All @@ -113,12 +133,42 @@ <h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from cl
</section>
<section class="details">
<ul class="details-list">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<li>
<section class="constructor-details" id="constructor-detail">
<h2>Constructor Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="&lt;init&gt;(java.lang.String)">
<h3>Packet</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">Packet</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;tostring)</span></div>
<div class="block">Create a Packet from its String representation</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>tostring</code> - the packets string-format, in the same format as <a href="#toString()"><code>toString()</code></a></dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></code> - if the format is incorrec5</dd>
<dt>Since:</dt>
<dd>1.0.1</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
<!-- ============ METHOD DETAIL ========== -->
<li>
<section class="method-details" id="method-detail">
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="timestamp()">
<h3>timestamp</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">long</span>&nbsp;<span class="element-name">timestamp</span>()</div>
<div class="block">Return the packet timestamp</div>
</section>
</li>
<li>
<section class="detail" id="write(java.nio.ByteBuffer)">
<h3>write</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">write</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="external-link">ByteBuffer</a>&nbsp;out)</span></div>
Expand Down
136 changes: 136 additions & 0 deletions docs/com/bfo/zeroconf/Service.Builder.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,26 @@ <h2>Method Summary</h2>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Build a new Service which can be announced with <a href="Service.html#announce()"><code>Service.announce()</code></a></div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getTTL_A()" class="member-name-link">getTTL_A</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Get the time-to-live in seconds for any "a" records announced for this service.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getTTL_PTR()" class="member-name-link">getTTL_PTR</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Get the time-to-live in seconds for any "ptr" records announced for this service.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getTTL_SRV()" class="member-name-link">getTTL_SRV</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Get the time-to-live in seconds for any "srv" records announced for this service.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getTTL_TXT()" class="member-name-link">getTTL_TXT</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Get the time-to-live in seconds for any "txt" records announced for this service.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Service.Builder.html" title="class in com.bfo.zeroconf">Service.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#put(java.lang.String,java.lang.String)" class="member-name-link">put</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;key,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;value)</code></div>
Expand Down Expand Up @@ -157,6 +177,26 @@ <h2>Method Summary</h2>
<div class="block">(Required) Set the port to announce.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Service.Builder.html" title="class in com.bfo.zeroconf">Service.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setTTL_A(int)" class="member-name-link">setTTL_A</a><wbr>(int&nbsp;ttl)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Set the time-to-live in seconds for any "a" or "aaaa" records announced for this service.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Service.Builder.html" title="class in com.bfo.zeroconf">Service.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setTTL_PTR(int)" class="member-name-link">setTTL_PTR</a><wbr>(int&nbsp;ttl)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Set the time-to-live in seconds for any "ptr" records announced for this service.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Service.Builder.html" title="class in com.bfo.zeroconf">Service.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setTTL_SRV(int)" class="member-name-link">setTTL_SRV</a><wbr>(int&nbsp;ttl)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Set the time-to-live in seconds for any "srv" records announced for this service.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Service.Builder.html" title="class in com.bfo.zeroconf">Service.Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setTTL_TXT(int)" class="member-name-link">setTTL_TXT</a><wbr>(int&nbsp;ttl)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Set the time-to-live in seconds for any "txt" records announced for this service.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Service.Builder.html" title="class in com.bfo.zeroconf">Service.Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setType(java.lang.String)" class="member-name-link">setType</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;type)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">(Required) Set the service type - a combination of the service name and protocol, eg "_http.</div>
Expand Down Expand Up @@ -275,6 +315,102 @@ <h3>setPort</h3>
</section>
</li>
<li>
<section class="detail" id="getTTL_PTR()">
<h3>getTTL_PTR</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">getTTL_PTR</span>()</div>
<div class="block">Get the time-to-live in seconds for any "ptr" records announced for this service.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the time-to-live</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setTTL_PTR(int)">
<h3>setTTL_PTR</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Service.Builder.html" title="class in com.bfo.zeroconf">Service.Builder</a></span>&nbsp;<span class="element-name">setTTL_PTR</span><wbr><span class="parameters">(int&nbsp;ttl)</span></div>
<div class="block">Set the time-to-live in seconds for any "ptr" records announced for this service.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>ttl</code> - the time-to-live in seconds</dd>
<dt>Returns:</dt>
<dd>this</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getTTL_SRV()">
<h3>getTTL_SRV</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">getTTL_SRV</span>()</div>
<div class="block">Get the time-to-live in seconds for any "srv" records announced for this service.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the time-to-live</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setTTL_SRV(int)">
<h3>setTTL_SRV</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Service.Builder.html" title="class in com.bfo.zeroconf">Service.Builder</a></span>&nbsp;<span class="element-name">setTTL_SRV</span><wbr><span class="parameters">(int&nbsp;ttl)</span></div>
<div class="block">Set the time-to-live in seconds for any "srv" records announced for this service.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>ttl</code> - the time-to-live in seconds</dd>
<dt>Returns:</dt>
<dd>this</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getTTL_TXT()">
<h3>getTTL_TXT</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">getTTL_TXT</span>()</div>
<div class="block">Get the time-to-live in seconds for any "txt" records announced for this service.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the time-to-live</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setTTL_TXT(int)">
<h3>setTTL_TXT</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Service.Builder.html" title="class in com.bfo.zeroconf">Service.Builder</a></span>&nbsp;<span class="element-name">setTTL_TXT</span><wbr><span class="parameters">(int&nbsp;ttl)</span></div>
<div class="block">Set the time-to-live in seconds for any "txt" records announced for this service.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>ttl</code> - the time-to-live in seconds</dd>
<dt>Returns:</dt>
<dd>this</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getTTL_A()">
<h3>getTTL_A</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">getTTL_A</span>()</div>
<div class="block">Get the time-to-live in seconds for any "a" records announced for this service.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the time-to-live</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setTTL_A(int)">
<h3>setTTL_A</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Service.Builder.html" title="class in com.bfo.zeroconf">Service.Builder</a></span>&nbsp;<span class="element-name">setTTL_A</span><wbr><span class="parameters">(int&nbsp;ttl)</span></div>
<div class="block">Set the time-to-live in seconds for any "a" or "aaaa" records announced for this service.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>ttl</code> - the time-to-live in seconds</dd>
<dt>Returns:</dt>
<dd>this</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="put(java.lang.String,java.lang.String)">
<h3>put</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Service.Builder.html" title="class in com.bfo.zeroconf">Service.Builder</a></span>&nbsp;<span class="element-name">put</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;key,
Expand Down
Loading

0 comments on commit 75f0ff7

Please sign in to comment.