Interface BridgePublishInboundOutput
-
- All Superinterfaces:
AsyncOutput<BridgePublishInboundOutput>,SimpleAsyncOutput<BridgePublishInboundOutput>
@DoNotImplement public interface BridgePublishInboundOutput extends AsyncOutput<BridgePublishInboundOutput>
This is the output parameter of anyBridgePublishInboundInterceptorproviding methods to define the outcome of PUBLISH interception.It can be used to
- Modify an inbound PUBLISH packet
- Prevent delivery of an inbound PUBLISH packet
Only one of the methods
preventPublishDelivery()may be called.Subsequent calls will fail with an
UnsupportedOperationException.- Since:
- Edge 2023.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull Async<BridgePublishInboundOutput>async(@NotNull Duration timeout, @NotNull TimeoutFallback timeoutFallback)If the timeout is expired beforeAsync.resume()is called then the outcome is handled either as failed or successful, depending on the specified fallback.@NotNull ModifiablePublishPacketgetPublishPacket()Use this object to make any changes to the inbound PUBLISH.voidpreventPublishDelivery()Prevent the onward delivery of the PUBLISH packet-
Methods inherited from interface com.hivemq.extension.sdk.api.async.SimpleAsyncOutput
async
-
-
-
-
Method Detail
-
getPublishPacket
@NotNull @NotNull ModifiablePublishPacket getPublishPacket()
Use this object to make any changes to the inbound PUBLISH.- Returns:
- A modifiable publish packet.
- Since:
- Edge 2023.1
-
preventPublishDelivery
void preventPublishDelivery()
Prevent the onward delivery of the PUBLISH packet- Throws:
UnsupportedOperationException- When preventPublishDelivery is called more than once.- Since:
- Edge 2023.1
-
async
@NotNull @NotNull Async<BridgePublishInboundOutput> async(@NotNull @NotNull Duration timeout, @NotNull @NotNull TimeoutFallback timeoutFallback)
If the timeout is expired beforeAsync.resume()is called then the outcome is handled either as failed or successful, depending on the specified fallback.Do not call this method more than once. If an async method is called multiple times an exception is thrown.
- Specified by:
asyncin interfaceAsyncOutput<BridgePublishInboundOutput>- Parameters:
timeout- Timeout that HiveMQ waits for the result of the async operation.timeoutFallback- Fallback behaviour if a timeout occurs.If the fallback is SUCCESS then the publish will be delivered.
If the fallback is FAILURE then the publish will be dropped.
- Returns:
- An
Asyncobject, containing thePublishInboundOutput. - Throws:
UnsupportedOperationException- If async is called more than once.- Since:
- Edge 2023.1
-
-