go to  ForumEasy.com   
LdapPro  
 
 
   Home  |  MyForum  |  FAQ  |  Archive    You are not logged in. [Login] or [Register]  
Forum Home » LDAP RFCs & SPECs » LDAP Persistent Search Control
Email To Friend  |   Set Alert To This Topic Rewarding Points Availabe: 0 (What's this) New Topic  |   Post Reply
Author Topic: LDAP Persistent Search Control
SteveHB
member
offline   
 
posts: 113
joined: 05/31/2006
from: Mountain View, CA
  posted on: 09/14/2006 03:16:43 PM    Edit  |   Quote  |   Report 
LDAP Persistent Search Control
http://www3.ietf.org/proceedings/01mar/I-D/ldapext-psearch-03.txt

This document defines two controls that extend the LDAPv3 [LDAP] search operation to provide a simple mechanism by which an LDAP client can receive notification of changes that occur in an LDAP server. The mechanism is designed to be very flexible yet easy for clients and servers to implement.

The approach taken by the Persistent Search mechanism described in this document is to alter the standard LDAP search operation so that it does not end after the initial set of entries matching the search criteria are returned. Instead, LDAP servers keep the search operation going. This provides clients and servers participating in Persistent Search with an active channel through which entries that change (and additional information about the changes that occur) can be communicated.


 Profile | Reply Points Earned: 0
SteveHB
member
offline   
 
posts: 113
joined: 05/31/2006
from: Mountain View, CA
  posted on: 09/14/2006 08:57:45 PM    Edit  |   Quote  |   Report 
LDAP Persistent Search Control Protocol -- Request

The control sent to server may be included in the Controls portion of an LDAPv3 SearchRequest message, as defined in Section 4.1.12 of [LDAPv3]. The structure of this control is as follows:
	PersistentSearchControl ::= SEQUENCE {
        	controlType     2.16.840.1.113730.3.4.3,
	        criticality     BOOLEAN DEFAULT FALSE,
	        controlValue    persistentSearchControlValue
	}


The persistentSearchControlValue is an OCTET STRING wrapping the BER-encoded
version of the following SEQUENCE:

	persistentSearchControlValue::= SEQUENCE {
                   changeTypes INTEGER,
			-- add(1)|delete(2)|modify(4)|modDN(8)
                   changesOnly BOOLEAN,
                   returnECs BOOLEAN
	}


 Profile | Reply Points Earned: 0
SteveHB
member
offline   
 
posts: 113
joined: 05/31/2006
from: Mountain View, CA
  posted on: 09/14/2006 09:10:41 PM    Edit  |   Quote  |   Report 
LDAP Persistent Search Control Protocol -- Response
Upon receiving the above Persistent Search Control, a server that supports it MUST process this as a standard LDAPv3 search with the following exceptions:

  • The server MUST NOT return a SearchResultDone message. Instead, the search operation MUST be kept active until it is abandoned by the client or until the client unbinds.

  • If changesOnly is TRUE, the server MUST NOT return any existing entries that match the search criteria. Entries are only returned when they are changed (added, modified, deleted, or subject to a modifyDN operation).

  • As changes are made to the server, the effected entries MUST be returned to the client if they match the standard search criteria and if the operation that caused the change is included in the changeTypes field.

  • If returnECs is TRUE, the server MUST return an Entry Change Notification control with each entry returned as the result of changes.


    Entry Change Notification control

    This control provides additional information about the change the caused a particular entry to be returned as the result of a persistent search. If the client set the returnECs boolean to TRUE in the PersistentSearch control, servers MUST include an EntryChangeNotification control in the Controls portion of each SearchResultEntry that is returned due to an entry being added, deleted, or modified.

    	EntryChangeNotificationControl::= SEQUENCE {
            	controlType     2.16.840.1.113730.3.4.7,
    	        criticality     BOOLEAN DEFAULT FALSE,
    	        controlValue    entryChangeNotificationControlValue
    	}
    


    The entryChangeNotificationControlValue is an OCTET STRING wrapping the BER-encoded version of the following SEQUENCE:

    	entryChangeNotificationControlValue::= SEQUENCE {
                  changeType ENUMERATED {
                          add             (1),
                          delete          (2),
                          modify          (4),
                          modDN           (8)
                  },
                  previousDN   LDAPDN OPTIONAL,     -- modifyDN ops. only
                  changeNumber INTEGER OPTIONAL     -- if supported
    	}
    



  • previousDN is present only for modifyDN operations and gives the DN of the entry before it was renamed and/or moved. Servers MUST include this optional field only when returning change notifications as a result of modifyDN operations.

  • changeNumber is the change number assigned by a server for the change. If a server supports an LDAP change log it SHOULD include this field.


  •  Profile | Reply Points Earned: 0
    SteveHB
    member
    offline   
     
    posts: 113
    joined: 05/31/2006
    from: Mountain View, CA
      posted on: 03/15/2010 07:51:35 PM    Edit  |   Quote  |   Report 
    Persistent Search Control JNDI Client Sample
    A JNDI client sample to demonstrate how to use PersistentSearchControl:

    http://www.forumeasy.com/forums/thread.jsp?tid=117381072609&fid=ldapprof2&highlight=LDAP+Persistent+Search+Control+JNDI+Client

     Profile | Reply Points Earned: 0

     
    Powered by ForumEasy © 2003-2005, All Rights Reserved. | Privacy Policy | Terms of Use
     
    Get your own forum today. It's easy and free.