org.apache.jena.atlas.web.auth
Class DelegatingAuthenticator

java.lang.Object
  extended by org.apache.jena.atlas.web.auth.AbstractCredentialsAuthenticator
      extended by org.apache.jena.atlas.web.auth.AbstractScopedAuthenticator<HttpAuthenticator>
          extended by org.apache.jena.atlas.web.auth.DelegatingAuthenticator
All Implemented Interfaces:
HttpAuthenticator

public class DelegatingAuthenticator
extends AbstractScopedAuthenticator<HttpAuthenticator>

A scoped authenticator which is actually a wrapper around other authenticators and thus can be used to mix and match different authentication mechanisms to different services as desired


Constructor Summary
DelegatingAuthenticator(Map<URI,HttpAuthenticator> authenticators)
          Creates a new delegating authenticator
DelegatingAuthenticator(URI target, HttpAuthenticator authenticator)
          Creates a new delegating authenticator
 
Method Summary
 void apply(org.apache.http.impl.client.AbstractHttpClient client, org.apache.http.protocol.HttpContext context, URI target)
          Applies any necessary authentication methods to the given HTTP Client
 
Methods inherited from class org.apache.jena.atlas.web.auth.AbstractCredentialsAuthenticator
invalidate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegatingAuthenticator

public DelegatingAuthenticator(URI target,
                               HttpAuthenticator authenticator)
Creates a new delegating authenticator

Parameters:
target - Target URI
authenticator - Authenticator to delegate to

DelegatingAuthenticator

public DelegatingAuthenticator(Map<URI,HttpAuthenticator> authenticators)
Creates a new delegating authenticator

Parameters:
authenticators - Mapping between URIs and authenticators
Method Detail

apply

public void apply(org.apache.http.impl.client.AbstractHttpClient client,
                  org.apache.http.protocol.HttpContext context,
                  URI target)
Description copied from interface: HttpAuthenticator
Applies any necessary authentication methods to the given HTTP Client

The target parameter indicates the URI to which the request is being made and so may be used by an authenticator to determine whether it actually needs to apply any authentication or to scope authentication appropriately.

Specified by:
apply in interface HttpAuthenticator
Overrides:
apply in class AbstractCredentialsAuthenticator
Parameters:
client - HTTP Client
context - HTTP Context
target - Target URI to which code wants to authenticate


Licenced under the Apache License, Version 2.0