2000-09-01 14:46:32 -04:00
|
|
|
/*
|
|
|
|
|
* Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
|
|
|
|
|
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef LDAP_URL_H
|
|
|
|
|
#define LDAP_URL_H
|
|
|
|
|
|
|
|
|
|
#include <ldap.h>
|
2001-03-15 06:07:58 -05:00
|
|
|
#include <StringList.h>
|
2001-02-19 06:34:28 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This class is used to analyze and store LDAP-Urls as returned by a
|
|
|
|
|
* LDAP-Server as Referrals and Search References. LDAP-URLs are defined
|
|
|
|
|
* in RFC1959 and have the following format: <BR>
|
|
|
|
|
* <code>
|
|
|
|
|
* ldap://host:port/baseDN[?attr[?scope[?filter]]] <BR>
|
|
|
|
|
* </code>
|
|
|
|
|
*/
|
2000-09-01 14:46:32 -04:00
|
|
|
class LDAPUrl{
|
|
|
|
|
|
|
|
|
|
public :
|
2001-02-19 06:34:28 -05:00
|
|
|
/**
|
2001-09-28 12:39:58 -04:00
|
|
|
* Create a new object from a c-std::string that contains a LDAP-Url
|
2001-02-19 06:34:28 -05:00
|
|
|
*/
|
2000-10-03 14:25:34 -04:00
|
|
|
LDAPUrl(const char *url);
|
2001-02-19 06:34:28 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Destructor
|
|
|
|
|
*/
|
2000-09-01 14:46:32 -04:00
|
|
|
~LDAPUrl();
|
|
|
|
|
|
2001-02-19 06:34:28 -05:00
|
|
|
/**
|
|
|
|
|
* @return The part of the URL that is representing the network
|
|
|
|
|
* port
|
|
|
|
|
*/
|
2000-09-01 14:46:32 -04:00
|
|
|
int getPort() const;
|
2001-02-19 06:34:28 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return The scope part of the URL is returned.
|
|
|
|
|
*/
|
2000-09-01 14:46:32 -04:00
|
|
|
int getScope() const;
|
2001-02-19 06:34:28 -05:00
|
|
|
|
|
|
|
|
/**
|
2001-09-28 12:39:58 -04:00
|
|
|
* @return The complete URL as a std::string
|
2001-02-19 06:34:28 -05:00
|
|
|
*/
|
2001-09-28 12:39:58 -04:00
|
|
|
const std::string& getURLString() const;
|
2001-02-19 06:34:28 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return The hostname or IP-Address of the destination host.
|
|
|
|
|
*/
|
2001-09-28 12:39:58 -04:00
|
|
|
const std::string& getHost() const;
|
2001-02-19 06:34:28 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return The Base-DN part of the URL
|
|
|
|
|
*/
|
2001-09-28 12:39:58 -04:00
|
|
|
const std::string& getDN() const;
|
2001-02-19 06:34:28 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return The Filter part of the URL
|
|
|
|
|
*/
|
2001-09-28 12:39:58 -04:00
|
|
|
const std::string& getFilter() const;
|
2001-02-19 06:34:28 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return The List of attributes that was in the URL
|
|
|
|
|
*/
|
2000-10-03 14:25:34 -04:00
|
|
|
const StringList& getAttrs() const;
|
2001-02-19 06:34:28 -05:00
|
|
|
|
|
|
|
|
protected :
|
|
|
|
|
int m_Port;
|
|
|
|
|
int m_Scope;
|
2001-09-28 12:39:58 -04:00
|
|
|
std::string m_Host;
|
|
|
|
|
std::string m_DN;
|
|
|
|
|
std::string m_Filter;
|
2001-02-19 06:34:28 -05:00
|
|
|
StringList m_Attrs;
|
|
|
|
|
LDAPURLDesc *m_urlDesc;
|
2001-09-28 12:39:58 -04:00
|
|
|
std::string m_urlString;
|
2000-09-01 14:46:32 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif //LDAP_URL_H
|