Package aQute.bnd.url
Class DefaultURLConnectionHandler
- java.lang.Object
-
- aQute.bnd.url.DefaultURLConnectionHandler
-
- All Implemented Interfaces:
Plugin,RegistryPlugin,URLConnectionHandler,aQute.service.reporter.Report,aQute.service.reporter.Reporter
- Direct Known Subclasses:
BasicAuthentication,BearerAuthentication,BndAuthentication,ConnectionSettings,HttpsVerification
public class DefaultURLConnectionHandler extends java.lang.Object implements URLConnectionHandler, Plugin, RegistryPlugin, aQute.service.reporter.Reporter
Base class for the URL Connection handlers. This class implements some convenient methods like the matching. In general you should subclass and implementhandle(URLConnection). Be aware to call thematches(URLConnection)method to verify the plugin is applicable.
-
-
Field Summary
Fields Modifier and Type Field Description protected Registryregistry-
Fields inherited from interface aQute.bnd.service.url.URLConnectionHandler
MATCH
-
-
Constructor Summary
Constructors Constructor Description DefaultURLConnectionHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description DefaultURLConnectionHandleraddMatcher(java.lang.String glob)aQute.service.reporter.Reporter.SetLocationerror(java.lang.String format, java.lang.Object... args)aQute.service.reporter.Reporter.SetLocationexception(java.lang.Throwable t, java.lang.String format, java.lang.Object... args)java.util.List<java.lang.String>getErrors()aQute.service.reporter.Report.LocationgetLocation(java.lang.String msg)java.util.List<java.lang.String>getWarnings()voidhandle(java.net.URLConnection connection)Not doing anything is perfect okbooleanisOk()booleanisPedantic()booleanmatches(java.net.URL url)Verify if the URL matches one of our globs.protected booleanmatches(java.net.URLConnection connection)Convenience method to make it easier to verify connectionsvoidprogress(float progress, java.lang.String format, java.lang.Object... args)Deprecated.Use SLF4J Logger.info() instead.voidsetProperties(java.util.Map<java.lang.String,java.lang.String> map)Set the properties for this plugin.voidsetRegistry(Registry registry)We are a @linkRegistryPluginfor convenience to our subclasses.voidsetReporter(aQute.service.reporter.Reporter processor)Set the current reporter.voidtrace(java.lang.String format, java.lang.Object... args)Deprecated.Use SLF4J Logger.debug instead.aQute.service.reporter.Reporter.SetLocationwarning(java.lang.String format, java.lang.Object... args)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface aQute.bnd.service.url.URLConnectionHandler
maxConcurrentConnections
-
-
-
-
Field Detail
-
registry
protected Registry registry
-
-
Method Detail
-
handle
public void handle(java.net.URLConnection connection) throws java.lang.ExceptionNot doing anything is perfect ok- Specified by:
handlein interfaceURLConnectionHandler- Parameters:
connection- The connection to modify- Throws:
java.lang.Exception
-
matches
public boolean matches(java.net.URL url)
Verify if the URL matches one of our globs. If there are no globs, we always return true.- Specified by:
matchesin interfaceURLConnectionHandler- Parameters:
url- the url to match- Returns:
- true if matched, false if not.
-
matches
protected boolean matches(java.net.URLConnection connection)
Convenience method to make it easier to verify connections- Parameters:
connection- The connection to match- Returns:
- true if this connection should be handled.
-
setRegistry
public void setRegistry(Registry registry)
We are a @linkRegistryPluginfor convenience to our subclasses.- Specified by:
setRegistryin interfaceRegistryPlugin
-
setProperties
public void setProperties(java.util.Map<java.lang.String,java.lang.String> map) throws java.lang.ExceptionSet the properties for this plugin. Subclasses should call this method before they handle their own properties.- Specified by:
setPropertiesin interfacePlugin- Parameters:
map- attributes and directives for this plugin's clause- Throws:
java.lang.Exception
-
setReporter
public void setReporter(aQute.service.reporter.Reporter processor)
Description copied from interface:PluginSet the current reporter. This is called at init time. This plugin should report all errors and warnings to this reporter.- Specified by:
setReporterin interfacePlugin
-
getWarnings
public java.util.List<java.lang.String> getWarnings()
- Specified by:
getWarningsin interfaceaQute.service.reporter.Report
-
getErrors
public java.util.List<java.lang.String> getErrors()
- Specified by:
getErrorsin interfaceaQute.service.reporter.Report
-
getLocation
public aQute.service.reporter.Report.Location getLocation(java.lang.String msg)
- Specified by:
getLocationin interfaceaQute.service.reporter.Report
-
isOk
public boolean isOk()
- Specified by:
isOkin interfaceaQute.service.reporter.Report
-
error
public aQute.service.reporter.Reporter.SetLocation error(java.lang.String format, java.lang.Object... args)- Specified by:
errorin interfaceaQute.service.reporter.Reporter
-
warning
public aQute.service.reporter.Reporter.SetLocation warning(java.lang.String format, java.lang.Object... args)- Specified by:
warningin interfaceaQute.service.reporter.Reporter
-
trace
@Deprecated public void trace(java.lang.String format, java.lang.Object... args)Deprecated.Use SLF4J Logger.debug instead.- Specified by:
tracein interfaceaQute.service.reporter.Reporter
-
progress
@Deprecated public void progress(float progress, java.lang.String format, java.lang.Object... args)Deprecated.Use SLF4J Logger.info() instead.- Specified by:
progressin interfaceaQute.service.reporter.Reporter
-
exception
public aQute.service.reporter.Reporter.SetLocation exception(java.lang.Throwable t, java.lang.String format, java.lang.Object... args)- Specified by:
exceptionin interfaceaQute.service.reporter.Reporter
-
isPedantic
public boolean isPedantic()
- Specified by:
isPedanticin interfaceaQute.service.reporter.Reporter
-
addMatcher
public DefaultURLConnectionHandler addMatcher(java.lang.String glob)
-
-