go to  ForumEasy.com   
LdapPro  
 
 
   Home  |  MyForum  |  FAQ  |  Archive    You are not logged in. [Login] or [Register]  
Forum Home » LDAP Model, Schema & LDIF » What's extensibleObject used for?
Email To Friend  |   Set Alert To This Topic Rewarding Points Availabe: 0 (What's this) New Topic  |   Post Reply
Author Topic: What's extensibleObject used for?
eLDAP
member
offline   
 
posts: 107
joined: 08/02/2006
from: Austin, TX
  posted on: 01/30/2007 08:46:52 PM    Edit  |   Quote  |   Report 
What's extensibleObject used for?
extensibleObject is objectclass defined in RFC 2252 to allow for flexibility of adding and modifying attributes on the server side.
objectClasses: ( 1.3.6.1.4.1.1466.101.120.111 NAME 'extensibleObject' DESC 'LDAPv3 extensible object' SUP top AUXILIARY X-ORIGIN 'RFC 2252' )


For example, the following code

	  DirContext ctx = new InitialDirContext(env);
		
	  // Create attributes to be associated with object
	  Attributes attrs = new BasicAttributes(true); // case-ignore
	  Attribute objclass = new BasicAttribute("objectclass");
	  objclass.add("top");
	  objclass.add("person");
	  attrs.put(objclass);
	  attrs("sn", "Smith");
	  attrs("givenName", "John");
	  attrs("cn", "John Smith");
	  attrs("ssn", "999-99-9999");
	
	  // Perform bind
	  ctx.bind("cn=John Smith,ou=People,dc=myCompany,dc=Com", attrs);


is going to throw exception of 'InvalidAttributeIdentifierException', since attribute 'ssn' is not defined in MUST or MAY list of 'person'. For 'ssn' to be added into DIT, the 'extensibleObject' objectclass should be added to make any (extra) attributes valid.

	  DirContext ctx = new InitialDirContext(env);
		
	  // Create attributes to be associated with object
	  Attributes attrs = new BasicAttributes(true); // case-ignore
	  Attribute objclass = new BasicAttribute("objectclass");
	  objclass.add("top");
	  objclass.add("person");
	  objclass.add("extensibleObject");
	  attrs.put(objclass);
	  attrs("sn", "Smith");
	  attrs("givenName", "John");
	  attrs("cn", "John Smith");
	  attrs("ssn", "999-99-9999");
	
	  // Perform bind
	  ctx.bind("cn=John Smith,ou=People,dc=myCompany,dc=Com", attrs);


Definitely, your server must support the extensibleObject objectclass anyway.

 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.