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 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
implement
handle(URLConnection)
. Be aware to call the
matches(URLConnection)
method to verify the plugin is applicable.-
Nested Class Summary
Nested classes/interfaces inherited from interface aQute.service.reporter.Report
aQute.service.reporter.Report.Location
Nested classes/interfaces inherited from interface aQute.service.reporter.Reporter
aQute.service.reporter.Reporter.SetLocation
-
Field Summary
FieldsFields inherited from interface aQute.bnd.service.url.URLConnectionHandler
MATCH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddMatcher
(String glob) aQute.service.reporter.Reporter.SetLocation
aQute.service.reporter.Reporter.SetLocation
aQute.service.reporter.Report.Location
getLocation
(String msg) void
handle
(URLConnection connection) Not doing anything is perfect okboolean
isOk()
boolean
boolean
Verify if the URL matches one of our globs.protected boolean
matches
(URLConnection connection) Convenience method to make it easier to verify connectionsvoid
Deprecated.Use SLF4J Logger.info() instead.void
setProperties
(Map<String, String> map) Set the properties for this plugin.void
setRegistry
(Registry registry) We are a @linkRegistryPlugin
for convenience to our subclasses.void
setReporter
(aQute.service.reporter.Reporter processor) Set the current reporter.void
Deprecated.Use SLF4J Logger.debug instead.aQute.service.reporter.Reporter.SetLocation
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 Details
-
registry
-
-
Constructor Details
-
DefaultURLConnectionHandler
public DefaultURLConnectionHandler()
-
-
Method Details
-
handle
Not doing anything is perfect ok- Specified by:
handle
in interfaceURLConnectionHandler
- Parameters:
connection
- The connection to modify- Throws:
Exception
-
matches
Verify if the URL matches one of our globs. If there are no globs, we always return true.- Specified by:
matches
in interfaceURLConnectionHandler
- Parameters:
url
- the url to match- Returns:
- true if matched, false if not.
-
matches
Convenience method to make it easier to verify connections- Parameters:
connection
- The connection to match- Returns:
- true if this connection should be handled.
-
setRegistry
We are a @linkRegistryPlugin
for convenience to our subclasses.- Specified by:
setRegistry
in interfaceRegistryPlugin
-
setProperties
Set the properties for this plugin. Subclasses should call this method before they handle their own properties.- Specified by:
setProperties
in interfacePlugin
- Parameters:
map
- attributes and directives for this plugin's clause- Throws:
Exception
-
setReporter
public void setReporter(aQute.service.reporter.Reporter processor) Description copied from interface:Plugin
Set the current reporter. This is called at init time. This plugin should report all errors and warnings to this reporter.- Specified by:
setReporter
in interfacePlugin
-
getWarnings
- Specified by:
getWarnings
in interfaceaQute.service.reporter.Report
-
getErrors
- Specified by:
getErrors
in interfaceaQute.service.reporter.Report
-
getLocation
- Specified by:
getLocation
in interfaceaQute.service.reporter.Report
-
isOk
public boolean isOk()- Specified by:
isOk
in interfaceaQute.service.reporter.Report
-
error
- Specified by:
error
in interfaceaQute.service.reporter.Reporter
-
warning
- Specified by:
warning
in interfaceaQute.service.reporter.Reporter
-
trace
Deprecated.Use SLF4J Logger.debug instead.- Specified by:
trace
in interfaceaQute.service.reporter.Reporter
-
progress
Deprecated.Use SLF4J Logger.info() instead.- Specified by:
progress
in interfaceaQute.service.reporter.Reporter
-
exception
public aQute.service.reporter.Reporter.SetLocation exception(Throwable t, String format, Object... args) - Specified by:
exception
in interfaceaQute.service.reporter.Reporter
-
isPedantic
public boolean isPedantic()- Specified by:
isPedantic
in interfaceaQute.service.reporter.Reporter
-
addMatcher
-