thrownewIllegalStateException("A class name for the admin provider must be specified via openfire.xml or the system properties using property: "+PROPERTY_ADMINPROVIDER_CLASSNAME);
thrownewIllegalStateException("A class name for the user provider must be specified via openfire.xml or the system properties using property: "+PROPERTY_USERPROVIDER_CLASSNAME);
}
}
@Override
publicUserProvidergetUserProvider(Stringusername)
{
// TODO add optional caching, to prevent retrieving the administrative users upon every invocation.
Log.warn("UserProvider.findUsers is not supported by this UserProvider: {}. Its users are not returned as part of search queries.",provider.getClass().getName());
supportSearch--;
}
}
if(supportSearch==0)
{
thrownewUnsupportedOperationException("None of the backing providers support this operation.");
}
returnuserList;
}
/**
* Searches for users based on a set of fields and a query string. The fields must be taken from the values
* returned by {@link #getSearchFields()}. The query can include wildcards. For example, a search on the field
* "Name" with a query of "Ma*" might return user's with the name "Matt", "Martha" and "Madeline".
*
* This method throws an UnsupportedOperationException when none of the backing providers support search.
*
* When fields are provided that are not supported by a particular provider, those fields are ignored by that
* provider (but can still be used by other providers).
*
* The startIndex and numResults parameters are used to page through search results. For example, if the startIndex
* is 0 and numResults is 10, the first 10 search results will be returned. Note that numResults is a request for
* the number of results to return and that the actual number of results returned may be fewer.
*
* @param fields the fields to search on.
* @param query the query string.
* @param startIndex the starting index in the search result to return.
* @param numResults the number of users to return in the search result.
* @return a Collection of users that match the search.
* @throws UnsupportedOperationException When none of the providers support search.
Log.warn("UserProvider.findUsers is not supported by this UserProvider: "+provider.getClass().getName());
supportSearch--;
}
}
if(supportSearch==0)
{
thrownewUnsupportedOperationException("None of the backing providers support this operation.");
}
returnuserList;
}
/**
* Returns the combination of search fields supported by the backing providers. Note that the returned fields might
* not be supported by every backing provider.
*
* @throws UnsupportedOperationException If no search fields are returned, or when at least one of the providers throws UnsupportedOperationException when its #getSearchField() is invoked.