|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.adamcin.httpsig.http.ning.AsyncUtil
public final class AsyncUtil
| Method Summary | ||
|---|---|---|
static void |
calculateSignature(Signer signer,
com.ning.http.client.Request request,
com.ning.http.client.RequestBuilderBase<?> requestBuilder)
|
|
static void |
enableAuth(com.ning.http.client.AsyncHttpClient client,
Signer signer)
Attaches the provided Signer to the AsyncHttpClient as a signature calculator. |
|
static void |
enableAuth(com.ning.http.client.AsyncHttpClient client,
Signer signer,
com.ning.http.client.SignatureCalculator calcBefore)
Attaches the provided Signer to the AsyncHttpClient as a signature calculator. |
|
protected static String |
getRequestPath(com.ning.http.client.Request request)
|
|
static Future<com.ning.http.client.Response> |
login(com.ning.http.client.AsyncHttpClient client,
Signer signer,
com.ning.http.client.Request loginRequest)
Executes and replays a login request until one is found which satisfies the Challenge being returned by the server, or until there are no more keys in the
keychain. |
|
static
|
login(com.ning.http.client.AsyncHttpClient client,
Signer signer,
com.ning.http.client.Request loginRequest,
com.ning.http.client.AsyncCompletionHandler<T> responseHandler)
Executes and replays a login request until one is found which satisfies the Challenge being returned by the server, or until there are no more keys in the
keychain. |
|
static
|
login(com.ning.http.client.AsyncHttpClient client,
Signer signer,
com.ning.http.client.Request loginRequest,
com.ning.http.client.AsyncCompletionHandler<T> responseHandler,
com.ning.http.client.SignatureCalculator calcBefore)
Executes and replays a login request until one is found which satisfies the Challenge being returned by the server, or until there are no more keys in the
keychain. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void enableAuth(com.ning.http.client.AsyncHttpClient client,
Signer signer)
Signer to the AsyncHttpClient as a signature calculator.
It is expected that key rotation and Challenge management is outside the scope
of this method, so only the Keychain.currentKey() will be used, and signature
content will be built according to the last Challenge provided to the
Signer.rotateKeys(net.adamcin.httpsig.api.Challenge) method.
client - the AsyncHttpClient to use forsigner - the Signer to use for authentication. It's keys must be rotated separately.login(com.ning.http.client.AsyncHttpClient, net.adamcin.httpsig.api.Signer, com.ning.http.client.Request)
public static void enableAuth(com.ning.http.client.AsyncHttpClient client,
Signer signer,
com.ning.http.client.SignatureCalculator calcBefore)
Signer to the AsyncHttpClient as a signature calculator.
It is expected that key rotation and Challenge management is outside the scope
of this method, so only the Keychain.currentKey() will be used, and signature
content will be built according to the last Challenge provided to the
Signer.rotateKeys(net.adamcin.httpsig.api.Challenge) method.
client - the AsyncHttpClient to use forsigner - the Signer to use for authentication. It's keys must be rotated separately.calcBefore - provide another SignatureCalculator to call (such as a Content-MD5 generator) prior to
generating the signature for authentication.login(com.ning.http.client.AsyncHttpClient, net.adamcin.httpsig.api.Signer, com.ning.http.client.Request)
public static Future<com.ning.http.client.Response> login(com.ning.http.client.AsyncHttpClient client,
Signer signer,
com.ning.http.client.Request loginRequest)
throws IOException
Challenge being returned by the server, or until there are no more keys in the
keychain.
client - the AsyncHttpClient to which the Signer will be attachedsigner - the Signer used for login and subsequent signature authenticationloginRequest - the login Request to be executed and replayed while rotating the keychain
Future expecting a Response
IOException - if a request throws an exception
public static <T> Future<T> login(com.ning.http.client.AsyncHttpClient client,
Signer signer,
com.ning.http.client.Request loginRequest,
com.ning.http.client.AsyncCompletionHandler<T> responseHandler)
throws IOException
Challenge being returned by the server, or until there are no more keys in the
keychain.
T - type parameter for completion handlerclient - the AsyncHttpClient to which the Signer will be attachedsigner - the Signer used for login and subsequent signature authenticationloginRequest - the login Request to be executed and replayed while rotating the keychainresponseHandler - an AsyncCompletionHandler of type T
Future of type T
IOException - if thrown by a login request
public static <T> Future<T> login(com.ning.http.client.AsyncHttpClient client,
Signer signer,
com.ning.http.client.Request loginRequest,
com.ning.http.client.AsyncCompletionHandler<T> responseHandler,
com.ning.http.client.SignatureCalculator calcBefore)
throws IOException
Challenge being returned by the server, or until there are no more keys in the
keychain.
T - type parameter for completion handlerclient - the AsyncHttpClient to which the Signer will be attachedsigner - the Signer used for login and subsequent signature authenticationloginRequest - the login Request to be executed and replayed while rotating the keychainresponseHandler - an AsyncCompletionHandler of type TcalcBefore - provide another SignatureCalculator to call (such as a Content-MD5 generator) prior to
generating the signature for authentication.
Future of type T
IOException - if thrown by a login requestprotected static String getRequestPath(com.ning.http.client.Request request)
public static void calculateSignature(Signer signer,
com.ning.http.client.Request request,
com.ning.http.client.RequestBuilderBase<?> requestBuilder)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||