Class MetadataAuthorizationHeader
- java.lang.Object
-
- com.adaptris.core.http.client.net.MetadataAuthorizationHeader
-
- All Implemented Interfaces:
HttpAuthenticator,HttpURLConnectionAuthenticator,java.lang.AutoCloseable
public class MetadataAuthorizationHeader extends java.lang.Object implements HttpURLConnectionAuthenticator
Build anHttpConstants.AUTHORIZATIONheader from metadata.In the adapter configuration file this class is aliased as http-metadata-authorization-header which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Constructor Summary
Constructors Constructor Description MetadataAuthorizationHeader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Undo whatever global state modifications have been made by this HttpAuthenticator.voidconfigureConnection(java.net.HttpURLConnection conn)Perform whatever actions are required to the HttpURLConnection after it's been opened (setting custom headers, etc).java.lang.StringgetMetadataKey()voidsetMetadataKey(java.lang.String metadataKey)The metadata key to retrieve the value for the Authorization header fromvoidsetup(java.lang.String target, AdaptrisMessage msg, ResourceTargetMatcher auth)Initialize the HttpAuthenticator for a message and return.
-
-
-
Method Detail
-
setup
public void setup(java.lang.String target, AdaptrisMessage msg, ResourceTargetMatcher auth) throws CoreExceptionDescription copied from interface:HttpAuthenticatorInitialize the HttpAuthenticator for a message and return. Any global state mutations should be done here.- Specified by:
setupin interfaceHttpAuthenticator- Parameters:
target- The URL to set authenticate formsg- The message to set up forauth- theResourceTargetMatcherto use, if null a default one will be created based on theResourceAuthenticator.ResourceTarget.getRequestingURL()- Throws:
CoreException
-
configureConnection
public void configureConnection(java.net.HttpURLConnection conn)
Description copied from interface:HttpURLConnectionAuthenticatorPerform whatever actions are required to the HttpURLConnection after it's been opened (setting custom headers, etc). Not all implementations of this interface will have something to do here.- Specified by:
configureConnectionin interfaceHttpURLConnectionAuthenticator
-
close
public void close()
Description copied from interface:HttpAuthenticatorUndo whatever global state modifications have been made by this HttpAuthenticator.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceHttpAuthenticator
-
getMetadataKey
public java.lang.String getMetadataKey()
-
setMetadataKey
public void setMetadataKey(java.lang.String metadataKey)
The metadata key to retrieve the value for the Authorization header from
-
-