blob: 9afe402de1260e0e611202d28bd4705a6e4b3ec2 [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) -->
<title>SaslServerContext (Qpid ProtonJ2 Parent 1.0.0-M18 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="declaration: package: org.apache.qpid.protonj2.engine.sasl, interface: SaslServerContext">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
<body class="class-declaration-page">
<script type="text/javascript">var evenRowColor = "even-row-color";
var oddRowColor = "odd-row-color";
var tableTab = "table-tab";
var activeTableTab = "active-table-tab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top">
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="../../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="class-use/SaslServerContext.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../help-doc.html#class">Help</a></li>
</ul>
</div>
<div class="sub-nav">
<div>
<ul class="sub-nav-list">
<li>Summary:&nbsp;</li>
<li><a href="#nested-class-summary">Nested</a>&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&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="#method-detail">Method</a></li>
</ul>
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">org.apache.qpid.protonj2.engine.sasl</a></div>
<h1 title="Interface SaslServerContext" class="title">Interface SaslServerContext</h1>
</div>
<section class="class-description" id="class-description">
<dl class="notes">
<dt>All Superinterfaces:</dt>
<dd><code><a href="SaslContext.html" title="interface in org.apache.qpid.protonj2.engine.sasl">SaslContext</a></code></dd>
</dl>
<hr>
<div class="type-signature"><span class="modifiers">public interface </span><span class="element-name type-name-label">SaslServerContext</span><span class="extends-implements">
extends <a href="SaslContext.html" title="interface in org.apache.qpid.protonj2.engine.sasl">SaslContext</a></span></div>
<div class="block">SASL Server operating context used by an <a href="../Engine.html" title="interface in org.apache.qpid.protonj2.engine"><code>Engine</code></a> that has been
configured as a SASL server or that has receiver an AMQP header thereby
forcing it into becoming the server side of the SASL exchange.</div>
</section>
<section class="summary">
<ul class="summary-list">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<li>
<section class="nested-class-summary" id="nested-class-summary">
<h2>Nested Class Summary</h2>
<div class="inherited-list">
<h2 id="nested-classes-inherited-from-class-org.apache.qpid.protonj2.engine.sasl.SaslContext">Nested classes/interfaces inherited from interface&nbsp;org.apache.qpid.protonj2.engine.sasl.<a href="SaslContext.html" title="interface in org.apache.qpid.protonj2.engine.sasl">SaslContext</a></h2>
<code><a href="SaslContext.Role.html" title="enum in org.apache.qpid.protonj2.engine.sasl">SaslContext.Role</a></code></div>
</section>
</li>
<!-- ========== METHOD SUMMARY =========== -->
<li>
<section class="method-summary" id="method-summary">
<h2>Method Summary</h2>
<div id="method-summary-table">
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab3" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab3', 3)" class="table-tab">Abstract Methods</button><button id="method-summary-table-tab5" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab5', 3)" class="table-tab">Default Methods</button></div>
<div id="method-summary-table.tabpanel" role="tabpanel">
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
<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-tab3"><code><a href="SaslServerListener.html" title="interface in org.apache.qpid.protonj2.engine.sasl">SaslServerListener</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getListener()" class="member-name-link">getListener</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">&nbsp;</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="SaslServerContext.html" title="interface in org.apache.qpid.protonj2.engine.sasl">SaslServerContext</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#saslFailure(javax.security.sasl.SaslException)" class="member-name-link">saslFailure</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.security.sasl/javax/security/sasl/SaslException.html" title="class or interface in javax.security.sasl" class="external-link">SaslException</a>&nbsp;failure)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Allows the server implementation to fail the SASL negotiation process due to some
unrecoverable error.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="SaslServerContext.html" title="interface in org.apache.qpid.protonj2.engine.sasl">SaslServerContext</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#sendChallenge(org.apache.qpid.protonj2.buffer.ProtonBuffer)" class="member-name-link">sendChallenge</a><wbr>(<a href="../../buffer/ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;challenge)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Sends the SASL challenge defined by the SASL mechanism that is in use during
this SASL negotiation.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default <a href="SaslServerContext.html" title="interface in org.apache.qpid.protonj2.engine.sasl">SaslServerContext</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#sendMechanisms(java.lang.String%5B%5D)" class="member-name-link">sendMechanisms</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[]&nbsp;mechanisms)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5">
<div class="block">Sends the set of supported mechanisms to the SASL client from which it must
choose and return one mechanism which will then be the basis for the SASL
authentication negotiation.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="SaslServerContext.html" title="interface in org.apache.qpid.protonj2.engine.sasl">SaslServerContext</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#sendMechanisms(org.apache.qpid.protonj2.types.Symbol%5B%5D)" class="member-name-link">sendMechanisms</a><wbr>(<a href="../../types/Symbol.html" title="class in org.apache.qpid.protonj2.types">Symbol</a>[]&nbsp;mechanisms)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Sends the set of supported mechanisms to the SASL client from which it must
choose and return one mechanism which will then be the basis for the SASL
authentication negotiation.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="SaslServerContext.html" title="interface in org.apache.qpid.protonj2.engine.sasl">SaslServerContext</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#sendOutcome(org.apache.qpid.protonj2.engine.sasl.SaslOutcome,org.apache.qpid.protonj2.buffer.ProtonBuffer)" class="member-name-link">sendOutcome</a><wbr>(<a href="SaslOutcome.html" title="enum in org.apache.qpid.protonj2.engine.sasl">SaslOutcome</a>&nbsp;outcome,
<a href="../../buffer/ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;additional)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Sends a response to a server side challenge that comprises the challenge / response
exchange for the chosen SASL mechanism.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="SaslServerContext.html" title="interface in org.apache.qpid.protonj2.engine.sasl">SaslServerContext</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#setListener(org.apache.qpid.protonj2.engine.sasl.SaslServerListener)" class="member-name-link">setListener</a><wbr>(<a href="SaslServerListener.html" title="interface in org.apache.qpid.protonj2.engine.sasl">SaslServerListener</a>&nbsp;listener)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Sets the <a href="SaslServerListener.html" title="interface in org.apache.qpid.protonj2.engine.sasl"><code>SaslServerListener</code></a> that will be used to driver the server side SASL
negotiations with a connected "client".</div>
</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-org.apache.qpid.protonj2.engine.sasl.SaslContext">Methods inherited from interface&nbsp;org.apache.qpid.protonj2.engine.sasl.<a href="SaslContext.html" title="interface in org.apache.qpid.protonj2.engine.sasl">SaslContext</a></h3>
<code><a href="SaslContext.html#getAttachments()">getAttachments</a>, <a href="SaslContext.html#getChosenMechanism()">getChosenMechanism</a>, <a href="SaslContext.html#getHostname()">getHostname</a>, <a href="SaslContext.html#getLinkedResource()">getLinkedResource</a>, <a href="SaslContext.html#getLinkedResource(java.lang.Class)">getLinkedResource</a>, <a href="SaslContext.html#getRole()">getRole</a>, <a href="SaslContext.html#getSaslOutcome()">getSaslOutcome</a>, <a href="SaslContext.html#getSaslState()">getSaslState</a>, <a href="SaslContext.html#getServerMechanisms()">getServerMechanisms</a>, <a href="SaslContext.html#isClient()">isClient</a>, <a href="SaslContext.html#isDone()">isDone</a>, <a href="SaslContext.html#isServer()">isServer</a>, <a href="SaslContext.html#setLinkedResource(java.lang.Object)">setLinkedResource</a></code></div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ============ METHOD DETAIL ========== -->
<li>
<section class="method-details" id="method-detail">
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="setListener(org.apache.qpid.protonj2.engine.sasl.SaslServerListener)">
<h3>setListener</h3>
<div class="member-signature"><span class="return-type"><a href="SaslServerContext.html" title="interface in org.apache.qpid.protonj2.engine.sasl">SaslServerContext</a></span>&nbsp;<span class="element-name">setListener</span><wbr><span class="parameters">(<a href="SaslServerListener.html" title="interface in org.apache.qpid.protonj2.engine.sasl">SaslServerListener</a>&nbsp;listener)</span></div>
<div class="block">Sets the <a href="SaslServerListener.html" title="interface in org.apache.qpid.protonj2.engine.sasl"><code>SaslServerListener</code></a> that will be used to driver the server side SASL
negotiations with a connected "client". As the client initiates or responds to the
various phases of the SASL negotiation the <a href="SaslServerListener.html" title="interface in org.apache.qpid.protonj2.engine.sasl"><code>SaslServerListener</code></a> will be notified
and allowed to respond.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>listener</code> - The <a href="SaslServerListener.html" title="interface in org.apache.qpid.protonj2.engine.sasl"><code>SaslServerListener</code></a> to use for SASL negotiations, cannot be null.</dd>
<dt>Returns:</dt>
<dd>this server context.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getListener()">
<h3>getListener</h3>
<div class="member-signature"><span class="return-type"><a href="SaslServerListener.html" title="interface in org.apache.qpid.protonj2.engine.sasl">SaslServerListener</a></span>&nbsp;<span class="element-name">getListener</span>()</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the currently set <a href="SaslServerListener.html" title="interface in org.apache.qpid.protonj2.engine.sasl"><code>SaslServerListener</code></a> instance.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="sendMechanisms(org.apache.qpid.protonj2.types.Symbol[])">
<h3>sendMechanisms</h3>
<div class="member-signature"><span class="return-type"><a href="SaslServerContext.html" title="interface in org.apache.qpid.protonj2.engine.sasl">SaslServerContext</a></span>&nbsp;<span class="element-name">sendMechanisms</span><wbr><span class="parameters">(<a href="../../types/Symbol.html" title="class in org.apache.qpid.protonj2.types">Symbol</a>[]&nbsp;mechanisms)</span>
throws <span class="exceptions"><a href="../exceptions/EngineStateException.html" title="class in org.apache.qpid.protonj2.engine.exceptions">EngineStateException</a></span></div>
<div class="block">Sends the set of supported mechanisms to the SASL client from which it must
choose and return one mechanism which will then be the basis for the SASL
authentication negotiation.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>mechanisms</code> - The mechanisms that this server supports.</dd>
<dt>Returns:</dt>
<dd>this server context.</dd>
<dt>Throws:</dt>
<dd><code><a href="../exceptions/EngineStateException.html" title="class in org.apache.qpid.protonj2.engine.exceptions">EngineStateException</a></code> - if the engine has already shutdown or failed while processing the mechanisms.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="sendMechanisms(java.lang.String[])">
<h3>sendMechanisms</h3>
<div class="member-signature"><span class="modifiers">default</span>&nbsp;<span class="return-type"><a href="SaslServerContext.html" title="interface in org.apache.qpid.protonj2.engine.sasl">SaslServerContext</a></span>&nbsp;<span class="element-name">sendMechanisms</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[]&nbsp;mechanisms)</span>
throws <span class="exceptions"><a href="../exceptions/EngineStateException.html" title="class in org.apache.qpid.protonj2.engine.exceptions">EngineStateException</a></span></div>
<div class="block">Sends the set of supported mechanisms to the SASL client from which it must
choose and return one mechanism which will then be the basis for the SASL
authentication negotiation.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>mechanisms</code> - The mechanisms that this server supports.</dd>
<dt>Returns:</dt>
<dd>this server context.</dd>
<dt>Throws:</dt>
<dd><code><a href="../exceptions/EngineStateException.html" title="class in org.apache.qpid.protonj2.engine.exceptions">EngineStateException</a></code> - if the engine has already shutdown or failed while processing the mechanisms.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="sendChallenge(org.apache.qpid.protonj2.buffer.ProtonBuffer)">
<h3>sendChallenge</h3>
<div class="member-signature"><span class="return-type"><a href="SaslServerContext.html" title="interface in org.apache.qpid.protonj2.engine.sasl">SaslServerContext</a></span>&nbsp;<span class="element-name">sendChallenge</span><wbr><span class="parameters">(<a href="../../buffer/ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;challenge)</span>
throws <span class="exceptions"><a href="../exceptions/EngineStateException.html" title="class in org.apache.qpid.protonj2.engine.exceptions">EngineStateException</a></span></div>
<div class="block">Sends the SASL challenge defined by the SASL mechanism that is in use during
this SASL negotiation. The challenge is an opaque binary that is provided to
the server by the security mechanism. Upon sending a challenge the SASL server
should expect a response from the SASL client.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>challenge</code> - The buffer containing the server challenge.</dd>
<dt>Returns:</dt>
<dd>this server context.</dd>
<dt>Throws:</dt>
<dd><code><a href="../exceptions/EngineStateException.html" title="class in org.apache.qpid.protonj2.engine.exceptions">EngineStateException</a></code> - if the engine has already shutdown or failed while sending the challenge.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="sendOutcome(org.apache.qpid.protonj2.engine.sasl.SaslOutcome,org.apache.qpid.protonj2.buffer.ProtonBuffer)">
<h3>sendOutcome</h3>
<div class="member-signature"><span class="return-type"><a href="SaslServerContext.html" title="interface in org.apache.qpid.protonj2.engine.sasl">SaslServerContext</a></span>&nbsp;<span class="element-name">sendOutcome</span><wbr><span class="parameters">(<a href="SaslOutcome.html" title="enum in org.apache.qpid.protonj2.engine.sasl">SaslOutcome</a>&nbsp;outcome,
<a href="../../buffer/ProtonBuffer.html" title="interface in org.apache.qpid.protonj2.buffer">ProtonBuffer</a>&nbsp;additional)</span>
throws <span class="exceptions"><a href="../exceptions/EngineStateException.html" title="class in org.apache.qpid.protonj2.engine.exceptions">EngineStateException</a></span></div>
<div class="block">Sends a response to a server side challenge that comprises the challenge / response
exchange for the chosen SASL mechanism.
<p>
Sending an outcome that indicates SASL does not trigger a failure of the engine or
cause a shutdown, the caller must ensure that after failing the SASL exchange the
engine is shutdown or failed so that event handlers are triggered or should pro-actively
close any I/O channel that was opened. The <a href="#saslFailure(javax.security.sasl.SaslException)"><code>saslFailure(SaslException)</code></a> method
has no effect once this method has been called as SASL negotiations are considered done
once an outcome is sent.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>outcome</code> - The outcome of the SASL negotiation to be sent to the client.</dd>
<dd><code>additional</code> - The additional bytes to be sent from the server along with the outcome.</dd>
<dt>Returns:</dt>
<dd>this server context.</dd>
<dt>Throws:</dt>
<dd><code><a href="../exceptions/EngineStateException.html" title="class in org.apache.qpid.protonj2.engine.exceptions">EngineStateException</a></code> - if the engine has already shutdown or failed while processing the outcome.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="saslFailure(javax.security.sasl.SaslException)">
<h3>saslFailure</h3>
<div class="member-signature"><span class="return-type"><a href="SaslServerContext.html" title="interface in org.apache.qpid.protonj2.engine.sasl">SaslServerContext</a></span>&nbsp;<span class="element-name">saslFailure</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.security.sasl/javax/security/sasl/SaslException.html" title="class or interface in javax.security.sasl" class="external-link">SaslException</a>&nbsp;failure)</span></div>
<div class="block">Allows the server implementation to fail the SASL negotiation process due to some
unrecoverable error. Failing the process will signal the <a href="../Engine.html" title="interface in org.apache.qpid.protonj2.engine"><code>Engine</code></a> that the SASL process
has failed and place the engine in a failed state as well as notify the registered error
handler for the <a href="../Engine.html" title="interface in org.apache.qpid.protonj2.engine"><code>Engine</code></a>.
<p>
This method will not perform any action if called after the <a href="#sendOutcome(org.apache.qpid.protonj2.engine.sasl.SaslOutcome,org.apache.qpid.protonj2.buffer.ProtonBuffer)"><code>sendOutcome(SaslOutcome, ProtonBuffer)</code></a>
method has been called as the SASL negotiation process was marked as completed and the implementation
is free to tear down SASL resources following that call.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>failure</code> - The exception to report to the <a href="../Engine.html" title="interface in org.apache.qpid.protonj2.engine"><code>Engine</code></a> that describes the failure.</dd>
<dt>Returns:</dt>
<dd>this server context.</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
<footer role="contentinfo">
<hr>
<p class="legal-copy"><small>Copyright &#169; 2023 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</div>
</div>
</body>
</html>