LDAPSchema dirSchema = new LDAPSchema();
// Get the schema from the directory.
dirSchema.fetchSchema( connection );
LDAPObjectClassSchema objClass = dirSchema.getObjectClass(object);
if ( objClass == null ) {
System.out.println("Object = "+object+" not found ");
}
else{
System.out.println("-------------------------");
System.out.println(object+" : "+objClass.toString());
Enumeration reqAttribute = objClass.getRequiredAttributes();
System.out.println("MUST Attributes");
while ( reqAttribute.hasMoreElements() ) {
String req = (String)reqAttribute.nextElement();
System.out.println("\t\t"+req);
}
Enumeration optAttribute = objClass.getOptionalAttributes();
System.out.println("MAY Attributes");
while ( optAttribute.hasMoreElements() ) {
String opt = (String)optAttribute.nextElement();
//System.out.println("schema oc = "+oc.getName());