{
List result = new ArrayList();
if (hasEndpoints())
{
XrdsServiceEndpoint endpoint;
Iterator endpointsIter = _endpoints.iterator();
while (endpointsIter.hasNext()) {
endpoint = (XrdsServiceEndpoint) endpointsIter.next();
Iterator typesIter = endpoint.getTypes().iterator();
while (typesIter.hasNext()) {
String type = (String) typesIter.next();
if (!targetTypes.contains(type)) continue;
try {
result.add(new DiscoveryInformation(
new URL(endpoint.getUri()),
DiscoveryInformation.OPENID_SIGNON_TYPES.contains(type) ?
new UrlIdentifier(_normalizedUrl) : null,
DiscoveryInformation.OPENID2.equals(type) ? endpoint.getLocalId() :
DiscoveryInformation.OPENID1_SIGNON_TYPES.contains(type) ? endpoint.getDelegate() : null,
type,
endpoint.getTypes()));
} catch (MalformedURLException e) {
throw new YadisException("Invalid endpoint URL discovered: " + endpoint.getUri(), OpenIDException.YADIS_INVALID_URL);
}
}
}
}
return result;