Class Sasl2TaskResult
java.lang.Object
org.jivesoftware.openfire.sasl.task.Sasl2TaskResult
The outcome of one step of a
Sasl2Task.
A step either produces data that is to be sent to the peer in a <task-data/> element (after which the peer
is expected to respond with a <task-data/> element of its own), or completes the task.
A step that must abort the entire SASL2 negotiation does not return a result: it throws a
SaslFailureException instead.
Instances are immutable.- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Sasl2TaskResultA result that completes the task without contributing any data to the response that the peer receives.static Sasl2TaskResultcompleted(byte[] additionalData) A result that completes the task, contributing mechanism-style<additional-data/>to the response that the peer receives.byte[]Data to be rendered as<additional-data/>.List<org.dom4j.Element>The children of the<task-data/>element to send to the peer.getType()static Sasl2TaskResulttaskData(Collection<org.dom4j.Element> children) A result that sends a<task-data/>element containing the provided children to the peer.static Sasl2TaskResulttaskData(org.dom4j.Element... children) A result that sends a<task-data/>element containing the provided children to the peer.toString()
-
Method Details
-
taskData
A result that sends a<task-data/>element containing the provided children to the peer. Every child element must carry its own namespace:<task-data/>is in the SASL2 namespace, which is not an appropriate namespace for third-party payloads.- Parameters:
children- the child elements of the<task-data/>element that is sent to the peer.- Returns:
- a result (never null).
-
taskData
A result that sends a<task-data/>element containing the provided children to the peer.- Parameters:
children- the child elements of the<task-data/>element that is sent to the peer. Can be empty, which sends an empty<task-data/>element.- Returns:
- a result (never null).
-
completed
A result that completes the task without contributing any data to the response that the peer receives.- Returns:
- a result (never null).
-
completed
A result that completes the task, contributing mechanism-style<additional-data/>to the response that the peer receives. The data is placed in the next<continue/>element if another round of tasks follows, or in the final<success/>element if this was the last task. Most tasks have no such data and usecompleted().- Parameters:
additionalData- data to be base64-encoded into an<additional-data/>element, or null.- Returns:
- a result (never null).
-
getType
-
getTaskData
The children of the<task-data/>element to send to the peer. Only meaningful forSasl2TaskResult.Type.TASK_DATA. This list is immutable and contains defensive copies of the original elements.- Returns:
- an immutable list of elements (never null, possibly empty).
-
getAdditionalData
@Nullable public byte[] getAdditionalData()Data to be rendered as<additional-data/>. Only meaningful forSasl2TaskResult.Type.COMPLETED.- Returns:
- the additional data, or null.
-
toString
-