@Override
public Collection<AuthorizationResponse> authorizeDocids(String connectorName,
List<String> docidList, AuthenticationIdentity identity) {
try {
AuthorizationManager authzManager =
instantiator.getAuthorizationManager(connectorName);
if (authzManager == null) {
// This is a bad situation. This means the Connector has feed the
// content in such a way that it is being asked to authorize access to
// that content and yet it doesn't implement the AuthorizationManager
// interface. Log the situation and return the empty result.
LOGGER.warning("Connector " + connectorName
+ " is being asked to authorize documents but has not implemented"
+ " the AuthorizationManager interface.");
return null;
}
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine("AUTHORIZE: " + identity + ": docids = " + docidList);
}
Collection<AuthorizationResponse> results =
authzManager.authorizeDocids(docidList, identity);
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine("AUTHORIZATION: " + identity + ": authorized for "
+ results.size() + " of " + docidList.size() + " documents.");
}
if (LOGGER.isLoggable(Level.FINEST)) {