Index

A B C D E F G H K M N O P R S T U V W 
All Classes and Interfaces|All Packages

A

ack() - Method in class org.mqtt4j.hato.testkit.FakeMqttSubscriber.FakeMqttDelivery
Records the call, which FakeMqttSubscriber.FakeMqttDelivery.acked() then shows.
acked() - Method in class org.mqtt4j.hato.testkit.FakeMqttSubscriber.FakeMqttDelivery
Returns whether FakeMqttSubscriber.FakeMqttDelivery.ack() has been called, by the handler or the acceptor, or later by any thread.
advance(Duration) - Method in class org.mqtt4j.hato.testkit.ManualTimerScheduler
Advances time, including tasks newly scheduled within the elapsed interval.
announce(BrokerCapabilities) - Method in class org.mqtt4j.hato.testkit.BrokerControls
Makes the broker announce capabilities to the MQTT 5.0 clients that connect from now on, and hold their connections to them.

B

BrokerCapabilities - Class in org.mqtt4j.hato.testkit
The capabilities that an embedded broker announces to MQTT 5.0 clients in CONNACK and then holds their connections to, for BrokerControls.announce(BrokerCapabilities).
BrokerControls - Class in org.mqtt4j.hato.testkit
Experimental test controls for an embedded broker: rules that refuse publications, subscriptions, or connections, or grant subscriptions a lower QoS, responses held back until the test releases them, the capabilities that the broker announces to MQTT 5.0 clients, and the clients connected now, which the test can disconnect.
BrokerReason - Class in org.mqtt4j.hato.testkit
The reason that an embedded broker gives a client when a test makes it refuse a request or end a connection with BrokerControls: a reason code, and the Reason String and the Server Reference that MQTT 5.0 carries with it, if any.

C

clearConnectionRule(String) - Method in class org.mqtt4j.hato.testkit.BrokerControls
Removes the connection rule for clientId, if there is one, so that later connections of the client are accepted again.
clearPublicationRule(TopicFilter) - Method in class org.mqtt4j.hato.testkit.BrokerControls
Removes the publication rule for filter, if there is one, so that later publications to its topics go through unless another rule refuses them.
clearSubscriptionRule(TopicFilter) - Method in class org.mqtt4j.hato.testkit.BrokerControls
Removes the rule for filter, if there is one, so that later subscriptions to it are granted as requested.
clearSubscriptionRule(TopicFilter) - Method in class org.mqtt4j.hato.testkit.FakeMqttSubscriber
Removes the rule for filter, if there is one, so that later subscriptions to it are granted as requested.
clientId() - Method in record class org.mqtt4j.hato.testkit.HeldResponse
Returns the value of the clientId record component.
close() - Method in class org.mqtt4j.hato.testkit.FakeMqttSubscriber.FakeSubscription
Ends this subscription at once.
close() - Method in class org.mqtt4j.hato.testkit.FaultyTransport
 
complete(PublishResult) - Method in class org.mqtt4j.hato.testkit.FakeMqttPublisher.HeldPublication
Completes this publication with result.
completePublications(PublishResult) - Method in class org.mqtt4j.hato.testkit.FakeMqttPublisher
Completes later publications at once with result, as the fake does by default with PublishResult.of().
connectedClients() - Method in class org.mqtt4j.hato.testkit.BrokerControls
Returns the identifiers of the clients that have an open connection now, as an unmodifiable set that later changes do not affect.
connectionAttempt() - Method in class org.mqtt4j.hato.testkit.FakeMqttSubscriber.FakeMqttDelivery
Returns 1.

D

defaults() - Static method in class org.mqtt4j.hato.testkit.BrokerCapabilities
Returns what the broker announces until a test announces something else: the values that MQTT 5.0 assumes, except that each client may set up to 16 Topic Aliases.
deliver(MqttMessage) - Method in class org.mqtt4j.hato.testkit.FakeMqttSubscriber.FakeSubscription
Delivers message to the handler, or offers it to the acceptor of a hand-off subscription, on the calling thread, and returns the delivery once that returns.
disconnect(String) - Method in class org.mqtt4j.hato.testkit.BrokerControls
Closes the open connection of the client with clientId, as a broker does for an administrative reason: an MQTT 5.0 client first receives DISCONNECT with Administrative action.
disconnect(String, BrokerReason) - Method in class org.mqtt4j.hato.testkit.BrokerControls
Closes the open connection of the client with clientId as BrokerControls.disconnect(String) does, but an MQTT 5.0 client first receives DISCONNECT with reason, whose reason code must be one that MQTT 5.0 lets a server send in DISCONNECT (MQTT 5.0 section 3.14.2.1).
disconnect(Throwable) - Method in class org.mqtt4j.hato.testkit.FaultyTransport
Ends the connection with cause: later sends are rejected, delayed and later input is discarded, and the delegate is closed.
dup() - Method in class org.mqtt4j.hato.testkit.FakeMqttSubscriber.FakeMqttDelivery
Returns false, as the fake delivers no duplicates.

E

ended() - Method in class org.mqtt4j.hato.testkit.FakeMqttSubscriber.FakeSubscription
Returns whether this subscription has ended: the code under test closed or unsubscribed it, or the fake refused it.
equals(Object) - Method in class org.mqtt4j.hato.testkit.BrokerCapabilities
 
equals(Object) - Method in class org.mqtt4j.hato.testkit.BrokerReason
 
equals(Object) - Method in record class org.mqtt4j.hato.testkit.HeldResponse
Indicates whether some other object is "equal to" this one.
established() - Method in class org.mqtt4j.hato.testkit.FakeMqttSubscriber.FakeSubscription
Returns a future completed with the granted QoS while this subscription is active.

F

fail(Throwable) - Method in class org.mqtt4j.hato.testkit.FakeMqttPublisher.HeldPublication
Fails this publication with failure.
failPublications(Throwable) - Method in class org.mqtt4j.hato.testkit.FakeMqttPublisher
Fails later publications at once with failure, such as MqttNotConnectedException.
failure() - Method in class org.mqtt4j.hato.testkit.FakeMqttSubscriber.FakeMqttDelivery
Returns what the handler or the acceptor threw for this delivery, or empty if it returned normally.
FakeMqttPublisher - Class in org.mqtt4j.hato.testkit
A stand-in for the publishing role of a client, for tests of code that takes an MqttPublisher.
FakeMqttPublisher() - Constructor for class org.mqtt4j.hato.testkit.FakeMqttPublisher
Creates a fake that completes each publication at once with PublishResult.of().
FakeMqttPublisher.HeldPublication - Class in org.mqtt4j.hato.testkit
A publication that the fake holds until the test completes or fails it.
FakeMqttSubscriber - Class in org.mqtt4j.hato.testkit
A stand-in for the subscribing role of a client, for tests of code that takes an MqttSubscriber.
FakeMqttSubscriber() - Constructor for class org.mqtt4j.hato.testkit.FakeMqttSubscriber
Creates a fake with no subscriptions and no rules, which grants each subscription at once at the requested QoS.
FakeMqttSubscriber.FakeMqttDelivery - Class in org.mqtt4j.hato.testkit
FakeMqttSubscriber.FakeSubscription - Class in org.mqtt4j.hato.testkit
A subscription that the fake recorded.
FaultyTransport - Class in org.mqtt4j.hato.testkit
A wrapper that adds ordered receive delays, send delays, and disconnection to a transport.
FaultyTransport(Transport, TimerScheduler) - Constructor for class org.mqtt4j.hato.testkit.FaultyTransport
Wraps delegate, timing the delays with scheduler.
filter() - Method in class org.mqtt4j.hato.testkit.FakeMqttSubscriber.FakeMqttDelivery
 
filter() - Method in class org.mqtt4j.hato.testkit.FakeMqttSubscriber.FakeSubscription
 

G

grantAtMost(TopicFilter, Qos) - Method in class org.mqtt4j.hato.testkit.BrokerControls
Grants later subscriptions to exactly filter at most maximum.
grantAtMost(TopicFilter, Qos) - Method in class org.mqtt4j.hato.testkit.FakeMqttSubscriber
Grants later subscriptions to exactly filter the lower of maximum and the requested QoS.
grantedQos() - Method in class org.mqtt4j.hato.testkit.FakeMqttSubscriber.FakeSubscription
 

H

handOff(Subscribe, Predicate) - Method in class org.mqtt4j.hato.testkit.FakeMqttSubscriber
Records the hand-off subscription as FakeMqttSubscriber.subscribe(Subscribe, Consumer) records a subscription with a handler.
hashCode() - Method in class org.mqtt4j.hato.testkit.BrokerCapabilities
 
hashCode() - Method in class org.mqtt4j.hato.testkit.BrokerReason
 
hashCode() - Method in record class org.mqtt4j.hato.testkit.HeldResponse
Returns a hash code value for this object.
heldPublications() - Method in class org.mqtt4j.hato.testkit.FakeMqttPublisher
Returns the publications held now, in the order published, as an unmodifiable list that later changes do not affect.
HeldResponse - Record Class in org.mqtt4j.hato.testkit
A response that the broker holds back for a test: its kind, the identifier of the client that it is for, and the packet identifier of the request that it answers.
HeldResponse(ResponseKind, String, int) - Constructor for record class org.mqtt4j.hato.testkit.HeldResponse
Creates a held response.
heldResponses() - Method in class org.mqtt4j.hato.testkit.BrokerControls
Returns the responses that the broker holds back now, for each connection in the order held, as an unmodifiable list that later changes do not affect.
holdPublications() - Method in class org.mqtt4j.hato.testkit.FakeMqttPublisher
Holds later publications until the test completes or fails each one.
holdResponses(ResponseKind, String) - Method in class org.mqtt4j.hato.testkit.BrokerControls
Holds back the responses of kind to the client with clientId, from now until BrokerControls.releaseResponses(ResponseKind, String).

K

kind() - Method in record class org.mqtt4j.hato.testkit.HeldResponse
Returns the value of the kind record component.

M

ManualTimerScheduler - Class in org.mqtt4j.hato.testkit
A monotonic clock starting at zero.
ManualTimerScheduler() - Constructor for class org.mqtt4j.hato.testkit.ManualTimerScheduler
Creates a scheduler whose clock reads zero and that has no tasks.
maximumPacketSize() - Method in class org.mqtt4j.hato.testkit.BrokerCapabilities
Returns the largest packet, in bytes including the fixed header, that a client may send.
maximumQos() - Method in class org.mqtt4j.hato.testkit.BrokerCapabilities
Returns the highest QoS at which a client may publish, Wills included.
message() - Method in class org.mqtt4j.hato.testkit.FakeMqttPublisher.HeldPublication
Returns the message that the code under test published.
message() - Method in class org.mqtt4j.hato.testkit.FakeMqttSubscriber.FakeMqttDelivery
 

N

nanoTime() - Method in class org.mqtt4j.hato.testkit.ManualTimerScheduler
 

O

of(MqttBroker) - Static method in class org.mqtt4j.hato.testkit.BrokerControls
Returns the controls of broker.
of(ReasonCode) - Static method in class org.mqtt4j.hato.testkit.BrokerReason
Returns a reason with reasonCode alone.
org.mqtt4j.hato.testkit - module org.mqtt4j.hato.testkit
Test support for applications that use Hato.
org.mqtt4j.hato.testkit - package org.mqtt4j.hato.testkit
Stand-ins for the publishing and subscribing roles, deterministic timers, transport fault injection, and embedded broker controls for application tests.

P

packetId() - Method in record class org.mqtt4j.hato.testkit.HeldResponse
Returns the value of the packetId record component.
pendingTaskCount() - Method in class org.mqtt4j.hato.testkit.ManualTimerScheduler
Returns the number of tasks still retained by the scheduler, excluding cancelled or dispatched tasks.
PUBACK - Enum constant in enum class org.mqtt4j.hato.testkit.ResponseKind
The answer to a QoS 1 PUBLISH.
PUBCOMP - Enum constant in enum class org.mqtt4j.hato.testkit.ResponseKind
The answer to PUBREL, which completes a QoS 2 publication.
publish(MqttMessage) - Method in class org.mqtt4j.hato.testkit.FakeMqttPublisher
Records message and returns the result that the fake decides now: completed or failed at once, or held until the test completes or fails it through FakeMqttPublisher.heldPublications().
published() - Method in class org.mqtt4j.hato.testkit.FakeMqttPublisher
Returns the messages published so far, held and failed ones included, in the order published, as an unmodifiable list that later publications do not affect.
PUBREC - Enum constant in enum class org.mqtt4j.hato.testkit.ResponseKind
The first answer to a QoS 2 PUBLISH.

R

reasonCode() - Method in class org.mqtt4j.hato.testkit.BrokerReason
Returns the reason code.
reasonString() - Method in class org.mqtt4j.hato.testkit.BrokerReason
Returns the Reason String, if there is one.
receiveDelay(Duration) - Method in class org.mqtt4j.hato.testkit.FaultyTransport
Changes the delay of subsequently received chunks.
receiveMaximum() - Method in class org.mqtt4j.hato.testkit.BrokerCapabilities
Returns the number of QoS 1 and QoS 2 publications that a client may have unanswered at once.
refuseConnections(String, BrokerReason) - Method in class org.mqtt4j.hato.testkit.BrokerControls
Refuses later connections of the client with clientId with reason, whose reason code must be a failure that MQTT 5.0 allows in CONNACK (MQTT 5.0 section 3.2.2.2).
refused() - Method in class org.mqtt4j.hato.testkit.FakeMqttSubscriber.FakeMqttDelivery
Returns whether the acceptor of a hand-off subscription returned false for this delivery, which is always false for a subscription with a handler.
refusePublications(TopicFilter, BrokerReason) - Method in class org.mqtt4j.hato.testkit.BrokerControls
Refuses later publications to the topics that filter matches with reason, whose reason code must be a failure that MQTT 5.0 allows in PUBACK and PUBREC (MQTT 5.0 sections 3.4.2.1 and 3.5.2.1).
refuseSubscriptions(TopicFilter) - Method in class org.mqtt4j.hato.testkit.BrokerControls
Refuses later subscriptions to exactly filter.
refuseSubscriptions(TopicFilter) - Method in class org.mqtt4j.hato.testkit.FakeMqttSubscriber
Refuses later subscriptions to exactly filter, as written, with Unspecified error: their Subscription.established() fails with MqttSubscriptionRefusedException, and they end.
refuseSubscriptions(TopicFilter, BrokerReason) - Method in class org.mqtt4j.hato.testkit.BrokerControls
Refuses later subscriptions to exactly filter with reason, whose reason code must be a failure that MQTT 5.0 allows in SUBACK (MQTT 5.0 section 3.9.3).
releaseResponses(ResponseKind, String) - Method in class org.mqtt4j.hato.testkit.BrokerControls
Stops holding back the responses of kind to the client with clientId, and sends those held in the order held.
request() - Method in class org.mqtt4j.hato.testkit.FakeMqttSubscriber.FakeSubscription
Returns the request that the code under test subscribed with.
ResponseKind - Enum Class in org.mqtt4j.hato.testkit
A kind of response that BrokerControls can hold back: the acknowledgements that a client waits for after its requests.
retainAvailable() - Method in class org.mqtt4j.hato.testkit.BrokerCapabilities
Returns whether a client may publish retained messages, Wills included.

S

schedule(Duration, Runnable) - Method in class org.mqtt4j.hato.testkit.ManualTimerScheduler
 
send(long, byte[]) - Method in class org.mqtt4j.hato.testkit.FaultyTransport
 
sendDelay(Duration) - Method in class org.mqtt4j.hato.testkit.FaultyTransport
Changes the delay of subsequently admitted sends.
serverReference() - Method in class org.mqtt4j.hato.testkit.BrokerReason
Returns the Server Reference, if there is one.
start(URI, Duration, Transport.Listener) - Method in class org.mqtt4j.hato.testkit.FaultyTransport
 
SUBACK - Enum constant in enum class org.mqtt4j.hato.testkit.ResponseKind
The answer to SUBSCRIBE.
subscribe(Subscribe, Consumer) - Method in class org.mqtt4j.hato.testkit.FakeMqttSubscriber
Records the subscription and returns its handle, which FakeMqttSubscriber.subscriptions() also lists.
subscribe(Subscribe, DeliveryOptions, Consumer) - Method in class org.mqtt4j.hato.testkit.FakeMqttSubscriber
Records the subscription as FakeMqttSubscriber.subscribe(Subscribe, Consumer) does.
subscription(TopicFilter) - Method in class org.mqtt4j.hato.testkit.FakeMqttSubscriber
Returns the most recent subscription made to exactly filter, ended or not, or empty if none was made.
subscriptionIdentifiersAvailable() - Method in class org.mqtt4j.hato.testkit.BrokerCapabilities
Returns whether a client may give its subscriptions Subscription Identifiers.
subscriptions() - Method in class org.mqtt4j.hato.testkit.FakeMqttSubscriber
Returns the subscriptions made so far, ended ones included, in the order made, as an unmodifiable list that later subscriptions do not affect.

T

terminated() - Method in class org.mqtt4j.hato.testkit.FakeMqttSubscriber.FakeSubscription
Returns a future that completes once this subscription has ended and neither its handler nor its acceptor is running.
topicAliasMaximum() - Method in class org.mqtt4j.hato.testkit.BrokerCapabilities
Returns the number of Topic Aliases that a client may set for its connection.
toString() - Method in class org.mqtt4j.hato.testkit.BrokerCapabilities
 
toString() - Method in class org.mqtt4j.hato.testkit.BrokerReason
 
toString() - Method in record class org.mqtt4j.hato.testkit.HeldResponse
Returns a string representation of this record class.

U

UNSUBACK - Enum constant in enum class org.mqtt4j.hato.testkit.ResponseKind
The answer to UNSUBSCRIBE.
unsubscribe() - Method in class org.mqtt4j.hato.testkit.FakeMqttSubscriber.FakeSubscription
Ends this subscription at once and returns a completed future.

V

valueOf(String) - Static method in enum class org.mqtt4j.hato.testkit.ResponseKind
Returns the enum constant of this class with the specified name.
values() - Static method in enum class org.mqtt4j.hato.testkit.ResponseKind
Returns an array containing the constants of this enum class, in the order they are declared.

W

wildcardSubscriptionAvailable() - Method in class org.mqtt4j.hato.testkit.BrokerCapabilities
Returns whether a client may subscribe to filters that contain wildcards.
withMaximumPacketSize(int) - Method in class org.mqtt4j.hato.testkit.BrokerCapabilities
Returns a copy with a different largest packet, in bytes including the fixed header, that a client may send.
withMaximumQos(Qos) - Method in class org.mqtt4j.hato.testkit.BrokerCapabilities
Returns a copy with a different highest QoS at which a client may publish, Wills included.
withReasonString(String) - Method in class org.mqtt4j.hato.testkit.BrokerReason
Returns a copy with reasonString, which the broker sends to MQTT 5.0 clients for diagnostics.
withReceiveMaximum(int) - Method in class org.mqtt4j.hato.testkit.BrokerCapabilities
Returns a copy with a different number of QoS 1 and QoS 2 publications that a client may have unanswered at once.
withRetainAvailable(boolean) - Method in class org.mqtt4j.hato.testkit.BrokerCapabilities
Returns a copy with a different answer to whether a client may publish retained messages, Wills included.
withServerReference(String) - Method in class org.mqtt4j.hato.testkit.BrokerReason
Returns a copy with serverReference, which tells MQTT 5.0 clients the server or servers to use instead, as a space-separated list of references whose form MQTT leaves open.
withSubscriptionIdentifiersAvailable(boolean) - Method in class org.mqtt4j.hato.testkit.BrokerCapabilities
Returns a copy with a different answer to whether a client may give its subscriptions Subscription Identifiers, which the broker returns with their deliveries.
withTopicAliasMaximum(int) - Method in class org.mqtt4j.hato.testkit.BrokerCapabilities
Returns a copy with a different number of Topic Aliases that a client may set for its connection; with 0, a client may set none.
withWildcardSubscriptionAvailable(boolean) - Method in class org.mqtt4j.hato.testkit.BrokerCapabilities
Returns a copy with a different answer to whether a client may subscribe to filters that contain wildcards.
A B C D E F G H K M N O P R S T U V W 
All Classes and Interfaces|All Packages