PTLib  Version 2.18.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PILSSession Class Reference

This class will create an LDAP client to access a remote ILS server. More...

#include <pils.h>

Inheritance diagram for PILSSession:
Collaboration diagram for PILSSession:

Classes

class  MSIPAddress
 Special IP address class. More...
 

Public Member Functions

 PILSSession ()
 Create an ILS client. More...
 
 PLDAP_ATTR_SIMP (RTPerson, PString, cn)
 
 PLDAP_ATTR_SIMP (RTPerson, PString, c)
 
 PLDAP_ATTR_SIMP (RTPerson, PString, o)
 
 PLDAP_ATTR_SIMP (RTPerson, PString, surname)
 
 PLDAP_ATTR_SIMP (RTPerson, PString, givenName)
 
 PLDAP_ATTR_SIMP (RTPerson, PString, rfc822Mailbox)
 
 PLDAP_ATTR_SIMP (RTPerson, PString, location)
 
 PLDAP_ATTR_SIMP (RTPerson, PString, comment)
 
 PLDAP_ATTR_SIMP (RTPerson, MSIPAddress, sipAddress)
 
 PLDAP_ATTR_SIMP (RTPerson, PWORDArray, sport)
 
 PLDAP_ATTR_INIT (RTPerson, unsigned, sflags, 0)
 
 PLDAP_ATTR_INIT (RTPerson, unsigned, ssecurity, 0)
 
 PLDAP_ATTR_INIT (RTPerson, unsigned, smodop, 0)
 
 PLDAP_ATTR_INIT (RTPerson, unsigned, sttl, 3600)
 
 PLDAP_ATTR_SIMP (RTPerson, PStringList, sprotid)
 
 PLDAP_ATTR_SIMP (RTPerson, PStringList, sprotmimetype)
 
 PLDAP_ATTR_INIT (RTPerson, PString, sappid, PProcess::Current().GetName())
 
 PLDAP_ATTR_INIT (RTPerson, PString, sappguid,"none")
 
 PLDAP_ATTR_SIMP (RTPerson, PStringList, smimetype)
 
 PLDAP_ATTR_INIT (RTPerson, PBoolean, ilsa32833566, 0)
 
 PLDAP_ATTR_INIT (RTPerson, PBoolean, ilsa32964638, 0)
 
 PLDAP_ATTR_INIT (RTPerson, PBoolean, ilsa26214430, 0)
 
 PLDAP_ATTR_INIT (RTPerson, unsigned, ilsa26279966, 0)
 
 PLDAP_ATTR_INIT (RTPerson, unsigned, ilsa39321630, 0)
 
 PLDAP_ATTR_INIT (RTPerson, time_t, timestamp, PTime().GetTimeInSeconds())
 
PString GetDN () const
 
 PLDAP_STRUCT_END ()
 
PBoolean AddPerson (const RTPerson &person)
 
PBoolean ModifyPerson (const RTPerson &person)
 
PBoolean DeletePerson (const RTPerson &person)
 
PBoolean SearchPerson (const PString &canonicalName, RTPerson &person)
 
PList< RTPerson > SearchPeople (const PString &filter)
 
- Public Member Functions inherited from PLDAPSession
 PLDAPSession (const PString &defaultBaseDN=PString::Empty())
 Create a LDAP client. More...
 
 ~PLDAPSession ()
 Close the sesison on destruction. More...
 
PBoolean Open (const PString &server, WORD port=0)
 Open the LDAP session to the specified server. More...
 
PBoolean Close ()
 Close the LDAP session. More...
 
PBoolean IsOpen () const
 Determine of session is open. More...
 
PBoolean SetOption (int optcode, int value)
 Set LDAP option parameter (OpenLDAp specific values) More...
 
PBoolean SetOption (int optcode, void *value)
 Set LDAP option parameter (OpenLDAP specific values) More...
 
PBoolean StartTLS ()
 Start encrypted connection. More...
 
PBoolean Bind (const PString &who=PString::Empty(), const PString &passwd=PString::Empty(), AuthenticationMethod authMethod=AuthSimple)
 Bind to the remote LDAP server. More...
 
PBoolean Add (const PString &dn, const PArray< ModAttrib > &attributes)
 Add a new distringuished name to LDAP dirctory. More...
 
PBoolean Add (const PString &dn, const PStringToString &attributes)
 Add a new distringuished name to LDAP dirctory. More...
 
PBoolean Add (const PString &dn, const PStringArray &attributes)
 Add a new distringuished name to LDAP dirctory. More...
 
PBoolean Add (const PString &dn, const PLDAPStructBase &data)
 Add a new distringuished name to LDAP dirctory. More...
 
PBoolean Modify (const PString &dn, const PArray< ModAttrib > &attributes)
 Modify an existing distringuished name to LDAP dirctory. More...
 
PBoolean Modify (const PString &dn, const PStringToString &attributes)
 Add a new distringuished name to LDAP dirctory. More...
 
PBoolean Modify (const PString &dn, const PStringArray &attributes)
 Add a new distringuished name to LDAP dirctory. More...
 
PBoolean Modify (const PString &dn, const PLDAPStructBase &data)
 Add a new distringuished name to LDAP dirctory. More...
 
PBoolean Delete (const PString &dn)
 Delete the distinguished name from LDAP directory. More...
 
PBoolean Search (SearchContext &context, const PString &filter, const PStringArray &attributes=PStringList(), const PString &base=PString::Empty(), SearchScope scope=ScopeSubTree)
 Start search for specified information. More...
 
PBoolean GetSearchResult (SearchContext &context, PStringToString &data)
 Get the current search result entry. More...
 
PBoolean GetSearchResult (SearchContext &context, const PString &attribute, PString &data)
 Get an attribute of the current search result entry. More...
 
PBoolean GetSearchResult (SearchContext &context, const PString &attribute, PStringArray &data)
 Get an attribute of the current search result entry. More...
 
PBoolean GetSearchResult (SearchContext &context, const PString &attribute, PArray< PBYTEArray > &data)
 Get an attribute of the current search result entry. More...
 
PBoolean GetSearchResult (SearchContext &context, PLDAPStructBase &data)
 Get all attributes of the current search result entry. More...
 
PString GetSearchResultDN (SearchContext &context)
 Get the current search result distinguished name entry. More...
 
PBoolean GetNextSearchResult (SearchContext &context)
 Get the next search result. More...
 
PList< PStringToStringSearch (const PString &filter, const PStringArray &attributes=PStringList(), const PString &base=PString::Empty(), SearchScope scope=ScopeSubTree)
 Search for specified information, returning all matches. More...
 
void SetBaseDN (const PString &dn)
 Set the default base DN for use if not specified for searches. More...
 
const PStringGetBaseDN () const
 Set the default base DN for use if not specified for searches. More...
 
int GetErrorNumber () const
 Get the last OpenLDAP error code. More...
 
PString GetErrorText () const
 Get the last OpenLDAP error as text string. More...
 
struct ldap * GetOpenLDAP () const
 Get the OpenLDAP context structure. More...
 
const PTimeIntervalGetTimeout () const
 Get the timeout for LDAP operations. More...
 
void SetTimeout (const PTimeInterval &t)
 Set the timeout for LDAP operations. More...
 
void SetSearchLimit (const unsigned s)
 Set a limit on the number of results to return. More...
 
- Public Member Functions inherited from PObject
__inline unsigned GetTraceContextIdentifier () const
 Get PTRACE context identifier. More...
 
__inline void SetTraceContextIdentifier (unsigned id)
 
__inline void SetTraceContextIdentifier (const PObject &obj)
 
__inline void SetTraceContextIdentifier (const PObject *obj)
 
__inline void CopyTraceContextIdentifier (PObject &obj) const
 
__inline void CopyTraceContextIdentifier (PObject *obj) const
 
virtual ~PObject ()
 
__inline const char * GetClass () const
 
__inline bool IsClass (const char *name) const
 
__inline const PObjectPTraceObjectInstance () const
 
virtual PObjectClone () const
 Create a copy of the class on the heap. More...
 
template<class CLS >
CLS * CloneAs () const
 As for Clone() but converts to specified type. More...
 
virtual PINDEX HashFunction () const
 This function yields a hash value required by the PDictionary class. More...
 
virtual Comparison Compare (const PObject &obj) const
 Compare the two objects and return their relative rank. More...
 
virtual Comparison CompareObjectMemoryDirect (const PObject &obj) const
 Determine the byte wise comparison of two objects. More...
 
bool operator== (const PObject &obj) const
 Compare the two objects. More...
 
bool operator!= (const PObject &obj) const
 Compare the two objects. More...
 
bool operator< (const PObject &obj) const
 Compare the two objects. More...
 
bool operator> (const PObject &obj) const
 Compare the two objects. More...
 
bool operator<= (const PObject &obj) const
 Compare the two objects. More...
 
bool operator>= (const PObject &obj) const
 Compare the two objects. More...
 
virtual void PrintOn (ostream &strm) const
 Output the contents of the object to the stream. More...
 
virtual void ReadFrom (istream &strm)
 Input the contents of the object from the stream. More...
 

Additional Inherited Members

- Public Types inherited from PLDAPSession
enum  AuthenticationMethod { AuthSimple, AuthSASL, AuthKerberos, NumAuthenticationMethod }
 
enum  SearchScope { ScopeBaseOnly, ScopeSingleLevel, ScopeSubTree, NumSearchScope }
 
- Public Types inherited from PObject
enum  Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 }
 Result of the comparison operation performed by the Compare() function. More...
 
- Static Public Member Functions inherited from PObject
static __inline void CopyTraceContextIdentifier (PObject &to, const PObject &from)
 
static __inline void CopyTraceContextIdentifier (PObject &to, const PObject *from)
 
static __inline void CopyTraceContextIdentifier (PObject *to, const PObject &from)
 
static __inline void CopyTraceContextIdentifier (PObject *to, const PObject *from)
 
static __inline const char * Class ()
 
static __inline const PObjectPTraceObjectInstance (const char *)
 
static __inline const PObjectPTraceObjectInstance (const PObject *obj)
 
template<typename T >
static Comparison Compare2 (T v1, T v2)
 Compare two types, returning Comparison type. More...
 
static Comparison InternalCompareObjectMemoryDirect (const PObject *obj1, const PObject *obj2, PINDEX size)
 Internal function caled from CompareObjectMemoryDirect() More...
 
- Protected Member Functions inherited from PObject
 PObject ()
 Constructor for PObject, made protected so cannot ever create one on its own. More...
 
- Protected Attributes inherited from PLDAPSession
struct ldap * m_ldapContext
 
int m_errorNumber
 
unsigned m_protocolVersion
 
PString m_defaultBaseDN
 
unsigned m_searchLimit
 
PTimeInterval m_timeout
 
PString m_multipleValueSeparator
 
- Protected Attributes inherited from PObject
unsigned m_traceContextIdentifier
 

Detailed Description

This class will create an LDAP client to access a remote ILS server.

Constructor & Destructor Documentation

PILSSession::PILSSession ( )

Create an ILS client.

Member Function Documentation

PBoolean PILSSession::AddPerson ( const RTPerson &  person)
PBoolean PILSSession::DeletePerson ( const RTPerson &  person)
PString PILSSession::GetDN ( ) const
PBoolean PILSSession::ModifyPerson ( const RTPerson &  person)
PILSSession::PLDAP_ATTR_INIT ( RTPerson  ,
unsigned  ,
sflags  ,
 
)
PILSSession::PLDAP_ATTR_INIT ( RTPerson  ,
unsigned  ,
ssecurity  ,
 
)
PILSSession::PLDAP_ATTR_INIT ( RTPerson  ,
unsigned  ,
smodop  ,
 
)
PILSSession::PLDAP_ATTR_INIT ( RTPerson  ,
unsigned  ,
sttl  ,
3600   
)
PILSSession::PLDAP_ATTR_INIT ( RTPerson  ,
PString  ,
sappid  ,
PProcess::  Current).GetName( 
)
PILSSession::PLDAP_ATTR_INIT ( RTPerson  ,
PString  ,
sappguid  ,
"none"   
)
PILSSession::PLDAP_ATTR_INIT ( RTPerson  ,
PBoolean  ,
ilsa32833566  ,
 
)
PILSSession::PLDAP_ATTR_INIT ( RTPerson  ,
PBoolean  ,
ilsa32964638  ,
 
)
PILSSession::PLDAP_ATTR_INIT ( RTPerson  ,
PBoolean  ,
ilsa26214430  ,
 
)
PILSSession::PLDAP_ATTR_INIT ( RTPerson  ,
unsigned  ,
ilsa26279966  ,
 
)
PILSSession::PLDAP_ATTR_INIT ( RTPerson  ,
unsigned  ,
ilsa39321630  ,
 
)
PILSSession::PLDAP_ATTR_INIT ( RTPerson  ,
time_t  ,
timestamp  ,
PTime().GetTimeInSeconds()   
)
PILSSession::PLDAP_ATTR_SIMP ( RTPerson  ,
PString  ,
cn   
)
PILSSession::PLDAP_ATTR_SIMP ( RTPerson  ,
PString  ,
 
)
PILSSession::PLDAP_ATTR_SIMP ( RTPerson  ,
PString  ,
 
)
PILSSession::PLDAP_ATTR_SIMP ( RTPerson  ,
PString  ,
surname   
)
PILSSession::PLDAP_ATTR_SIMP ( RTPerson  ,
PString  ,
givenName   
)
PILSSession::PLDAP_ATTR_SIMP ( RTPerson  ,
PString  ,
rfc822Mailbox   
)
PILSSession::PLDAP_ATTR_SIMP ( RTPerson  ,
PString  ,
location   
)
PILSSession::PLDAP_ATTR_SIMP ( RTPerson  ,
PString  ,
comment   
)
PILSSession::PLDAP_ATTR_SIMP ( RTPerson  ,
MSIPAddress  ,
sipAddress   
)
PILSSession::PLDAP_ATTR_SIMP ( RTPerson  ,
PWORDArray  ,
sport   
)
PILSSession::PLDAP_ATTR_SIMP ( RTPerson  ,
PStringList  ,
sprotid   
)
PILSSession::PLDAP_ATTR_SIMP ( RTPerson  ,
PStringList  ,
sprotmimetype   
)
PILSSession::PLDAP_ATTR_SIMP ( RTPerson  ,
PStringList  ,
smimetype   
)
PILSSession::PLDAP_STRUCT_END ( )
PList<RTPerson> PILSSession::SearchPeople ( const PString filter)
PBoolean PILSSession::SearchPerson ( const PString canonicalName,
RTPerson &  person 
)

The documentation for this class was generated from the following file: