public abstract class NegotiateChallengeHandler extends ChallengeHandler
create(), and registered at a location using
DispatchChallengeHandler.register(String, ChallengeHandler).
In addition, one can register more specific NegotiableChallengeHandler objects with
this initial NegotiateChallengeHandler to handle initial Negotiate challenges and subsequent challenges associated
with specific Negotiation mechanism types / object identifiers.
The following example establishes a Negotiation strategy at a specific URL location.
We show the use of a DispatchChallengeHandler to register a NegotiateChallengeHandler at
a specific location. The NegotiateChallengeHandler has a NegotiableChallengeHandler
instance registered as one of the potential negotiable alternative challenge handlers.
LoginHandler someServerLoginHandler = ...
NegotiateChallengeHandler nch = NegotiateChallengeHandler.create();
NegotiableChallengeHandler nblch = NegotiableChallengeHandler.create();
DispatchChallengeHandler dch = DispatchChallengeHandler.create();
WebSocketFactory wsFactory = WebSocketFactory.createWebSocketFactory();
wsFactory.setDefaultChallengeHandler(dch.register("ws://some.server.com",
nch.register(nblch).setLoginHandler(someServerLoginHandler)
);
// could register more alternatives to negotiate amongst here.
)
);
| Constructor and Description |
|---|
NegotiateChallengeHandler() |
| Modifier and Type | Method and Description |
|---|---|
static NegotiateChallengeHandler |
create()
Creates a new instance of
NegotiateChallengeHandler using the
ServiceLoader API with the implementation specified under
META-INF/services. |
static NegotiateChallengeHandler |
create(ClassLoader classLoader)
Creates a new instance of
NegotiateChallengeHandler with the
specified ClassLoader using the ServiceLoader API with
the implementation specified under META-INF/services. |
abstract NegotiateChallengeHandler |
register(NegotiableChallengeHandler handler)
Register a candidate negotiable challenge handler that will be used to respond
to an initial "Negotiate" server challenge and can then potentially be
a winning candidate in the race to handle the subsequent server challenge.
|
canHandle, create, create, handlepublic static NegotiateChallengeHandler create()
NegotiateChallengeHandler using the
ServiceLoader API with the implementation specified under
META-INF/services.public static NegotiateChallengeHandler create(ClassLoader classLoader)
NegotiateChallengeHandler with the
specified ClassLoader using the ServiceLoader API with
the implementation specified under META-INF/services.classLoader - ClassLoader to be used to instantiatepublic abstract NegotiateChallengeHandler register(NegotiableChallengeHandler handler)
handler - the mechanism-type-specific challenge handler.Copyright © 2016. All Rights Reserved.