Class AbstractDatabaseCollector
- java.lang.Object
-
- de.hybris.datasupplier.collectors.impl.AbstractDatabaseCollector
-
- All Implemented Interfaces:
DatabaseCollector
- Direct Known Subclasses:
HanaCollector
,HsqlCollector
,MySQLCollector
,OracleCollector
,SqlServerCollector
public abstract class AbstractDatabaseCollector extends java.lang.Object implements DatabaseCollector
Provides a base implementation for database collecting strategies (DatabaseCollectingStrategy)
-
-
Constructor Summary
Constructors Constructor Description AbstractDatabaseCollector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.URI
getHost(java.lang.String url)
Extracts host as a URI from the jdbc connection string.protected java.lang.String
matchAndReturn(java.lang.String regex, java.lang.String url)
Matches a pattern to the provided regex and returns it.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.datasupplier.collectors.DatabaseCollector
getName, isApplicable
-
-
-
-
Method Detail
-
getHost
public java.net.URI getHost(java.lang.String url) throws java.net.URISyntaxException
Description copied from interface:DatabaseCollector
Extracts host as a URI from the jdbc connection string.- Specified by:
getHost
in interfaceDatabaseCollector
- Parameters:
url
- jdbc connection string- Returns:
- host of the database as a URI
- Throws:
java.net.URISyntaxException
- in case of being unable to parse the connection string to a URI
-
matchAndReturn
protected java.lang.String matchAndReturn(java.lang.String regex, java.lang.String url)
Matches a pattern to the provided regex and returns it. The matching is case insensitive.- Parameters:
regex
- regular expressionurl
- text that needs to be searched for the pattern- Returns:
- matched string or null if none
-
-