Package rocks.xmpp.extensions.httpauth
Class HttpAuthenticationManager
- java.lang.Object
-
- rocks.xmpp.core.stanza.AbstractIQHandler
-
- rocks.xmpp.extensions.httpauth.HttpAuthenticationManager
-
- All Implemented Interfaces:
ExtensionProtocol
,InboundMessageHandler
,IQHandler
public final class HttpAuthenticationManager extends AbstractIQHandler implements InboundMessageHandler, ExtensionProtocol
This manager allows to listen for inbound requests (by an XMPP server) to confirm that the current XMPP user made an HTTP request, i.e. to verify that the HTTP request was in fact made by the XMPP user.If you want to confirm or deny HTTP requests, add a listener and call
HttpAuthenticationEvent.confirm()
orHttpAuthenticationEvent.deny()
on the event object.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addHttpAuthenticationListener(Consumer<HttpAuthenticationEvent> httpAuthenticationListener)
Adds a HTTP authentication listener, which allows to listen for HTTP authentication confirmation requests.String
getNamespace()
The protocol's main namespace.void
handleInboundMessage(MessageEvent e)
Handles an inbound message.boolean
isEnabled()
Indicates whether this protocol is enabled.void
removeHttpAuthenticationListener(Consumer<HttpAuthenticationEvent> httpAuthenticationListener)
Removes a previously added HTTP authentication listener.-
Methods inherited from class rocks.xmpp.core.stanza.AbstractIQHandler
getPayloadClass, handleRequest
-
-
-
-
Method Detail
-
addHttpAuthenticationListener
public void addHttpAuthenticationListener(Consumer<HttpAuthenticationEvent> httpAuthenticationListener)
Adds a HTTP authentication listener, which allows to listen for HTTP authentication confirmation requests.- Parameters:
httpAuthenticationListener
- The listener.- See Also:
removeHttpAuthenticationListener(Consumer)
-
removeHttpAuthenticationListener
public void removeHttpAuthenticationListener(Consumer<HttpAuthenticationEvent> httpAuthenticationListener)
Removes a previously added HTTP authentication listener.- Parameters:
httpAuthenticationListener
- The listener.- See Also:
addHttpAuthenticationListener(Consumer)
-
handleInboundMessage
public void handleInboundMessage(MessageEvent e)
Description copied from interface:InboundMessageHandler
Handles an inbound message.- Specified by:
handleInboundMessage
in interfaceInboundMessageHandler
- Parameters:
e
- The message event.
-
getNamespace
public final String getNamespace()
Description copied from interface:ExtensionProtocol
The protocol's main namespace. This is used to uniquely identify the extension protocol.- Specified by:
getNamespace
in interfaceExtensionProtocol
- Returns:
- The main namespace.
-
isEnabled
public final boolean isEnabled()
Description copied from interface:ExtensionProtocol
Indicates whether this protocol is enabled.- Specified by:
isEnabled
in interfaceExtensionProtocol
- Returns:
- true, if enabled; false if disabled.
-
-