final Map < String , String > getPropertiesForConnectorConfigurationName ( final String connectorName ) { final Map < String , String > propertyMap = new HashMap < String , String > ( ) ; final String patternString = String . format ( CONNECTOR_PROPERTY_GRABBER_PATTERN , connectorName ) ; final Pattern propertyGrabPattern = Pattern . compile ( patternString ) ; final Set < Map . Entry < Object , Object > > entries = getSystemProperties ( ) . entrySet ( ) ; for ( Map . Entry < Object , Object > entry : entries ) { final String key = entry . getKey ( ) . toString ( ) ; final Object value = entry . getValue ( ) ; // check if property key has tracee connector format final Matcher matcher = propertyGrabPattern . matcher ( key ) ; if ( value != null && matcher . matches ( ) && matcher . groupCount ( ) > 0 ) { final String propertyName = matcher . group ( 1 ) ; propertyMap . put ( propertyName , value . toString ( ) ) ; } } return propertyMap ; }
Collects all properties for a given connector configuration name and writes them to a Map .