ConfigurationImpl[] listConfigurations( ConfigurationAdminImpl configurationAdmin, String filterString )
throws IOException, InvalidSyntaxException
{
Filter filter = null;
if ( filterString != null )
{
filter = bundleContext.createFilter( filterString );
}
log( LogService.LOG_DEBUG, "Listing configurations matching {0}", new Object[]
{ filterString } );
List configList = new ArrayList();
PersistenceManager[] pmList = getPersistenceManagers();
for ( int i = 0; i < pmList.length; i++ )
{
Enumeration configs = pmList[i].getDictionaries();
while ( configs.hasMoreElements() )
{
final Dictionary config = ( Dictionary ) configs.nextElement();
// ignore non-Configuration dictionaries
final String pid = ( String ) config.get( Constants.SERVICE_PID );
if ( pid == null )
{
continue;
}
// CM 1.4 / 104.13.2.3 Permission required
if ( !configurationAdmin.hasPermission( this,
( String ) config.get( ConfigurationAdmin.SERVICE_BUNDLELOCATION ) ) )
{
log(
LogService.LOG_DEBUG,
"Omitting configuration {0}: No permission for bundle {1} on configuration bound to {2}",
new Object[]
{ pid, configurationAdmin.getBundle().getLocation(),
config.get( ConfigurationAdmin.SERVICE_BUNDLELOCATION ) } );
continue;
}
// check filter
if ( filter == null || filter.match( config ) )
{
// ensure the service.pid and returned a cached config if available
ConfigurationImpl cfg = getCachedConfiguration( pid );
if ( cfg == null )
{