22
22
return pos != std::string::npos && lower(endpoint.URLString.substr(0, pos)) != "ldap";
25
static URL CreateURL(std::string service) {
26
std::string::size_type pos1 = service.find("://");
27
if (pos1 == std::string::npos) {
28
service = "ldap://" + service;
30
} else if(lower(service.substr(0,pos1)) != "ldap") return URL();
32
std::string::size_type pos2 = service.find(":", pos1 + 3);
33
std::string::size_type pos3 = service.find("/", pos1 + 3);
34
if (pos2 == std::string::npos && pos3 == std::string::npos) {
35
service.append(":2170");
37
else if (pos2 == std::string::npos || pos2 > pos3) {
38
service.insert(pos3, ":2170");
44
25
static std::string CreateBDIIResourceURL(const std::string& host) { return "ldap://" + host + ":2170/Mds-Vo-name=resource,o=grid"; }
46
27
EndpointQueryingStatus ServiceEndpointRetrieverPluginBDII::Query(const UserConfig& uc,
47
28
const Endpoint& rEndpoint,
48
29
std::list<Endpoint>& seList,
49
30
const EndpointQueryOptions<Endpoint>&) const {
50
URL url(CreateURL(rEndpoint.URLString));
31
if (isEndpointNotSupported(rEndpoint)) {
32
return EndpointQueryingStatus::FAILED;
34
URL url((rEndpoint.URLString.find("://") == std::string::npos ? "ldap://" : "") + rEndpoint.URLString, false, 2170);
51
35
url.ChangeLDAPScope(URL::subtree);
52
36
//url.ChangeLDAPFilter("(|(GlueServiceType=bdii_site)(GlueServiceType=bdii_top))");
53
37
if (!url) return EndpointQueryingStatus::FAILED;