Synch up with the main dev tree, sdk version = 4.02

This commit is contained in:
miodrag%netscape.com 1999-08-11 17:20:23 +00:00
parent 949285ee9e
commit 30e7eed2a6
4 changed files with 47 additions and 16 deletions

View File

@ -139,11 +139,10 @@ public class LDAPAttributeSchema extends LDAPSchemaElement {
*/
public LDAPAttributeSchema( String name, String oid, String description,
int syntax, boolean single ) {
super( name, oid, description );
attrName = "attributetypes";
this( name, oid, description, cisString, single );
this.syntax = syntax;
this.syntaxString = internalSyntaxToString();
this.single = single;
setQualifier( SYNTAX, this.syntaxString );
}
/**
@ -161,9 +160,13 @@ public class LDAPAttributeSchema extends LDAPSchemaElement {
String syntaxString, boolean single ) {
super( name, oid, description );
attrName = "attributetypes";
this.syntaxString = syntaxString;
this.syntax = syntaxCheck( syntaxString );
this.syntaxString = syntaxString;
setQualifier( SYNTAX, this.syntaxString );
this.single = single;
if ( single ) {
setQualifier( SINGLE, "" );
}
}
/**

View File

@ -226,11 +226,11 @@ public class LDAPConnection
/**
* Properties
*/
private final static Float SdkVersion = new Float(4.0f);
private final static Float SdkVersion = new Float(4.02f);
private final static Float ProtocolVersion = new Float(3.0f);
private final static String SecurityVersion = new String("none,simple,sasl");
private final static Float MajorVersion = new Float(4.0f);
private final static Float MinorVersion = new Float(0.0f);
private final static Float MinorVersion = new Float(0.2f);
private final static String DELIM = "#";
private final static String PersistSearchPackageName =
"netscape.ldap.controls.LDAPPersistSearchControl";

View File

@ -120,6 +120,7 @@ public class LDAPObjectClassSchema extends LDAPSchemaElement {
super( name, oid, description );
attrName = "objectclasses";
this.superiors = new String[] { superior };
setQualifier( SUPERIOR, superior );
for( int i = 0; i < required.length; i++ ) {
must.addElement( required[i] );
}
@ -150,6 +151,7 @@ public class LDAPObjectClassSchema extends LDAPSchemaElement {
int type ) {
this( name, oid, superiors[0], description, required, optional );
this.superiors = superiors;
setQualifier( SUPERIOR, this.superiors );
this.type = type;
}
@ -185,13 +187,21 @@ public class LDAPObjectClassSchema extends LDAPSchemaElement {
type = STRUCTURAL;
}
obsolete = properties.containsKey( OBSOLETE );
Vector v = (Vector)properties.get( "MAY" );
if ( v != null ) {
may = v;
Object o = properties.get( "MAY" );
if ( o != null ) {
if ( o instanceof Vector ) {
may = (Vector)o;
} else {
may.addElement( o );
}
}
v = (Vector)properties.get( "MUST" );
if ( v != null ) {
must = v;
o = properties.get( "MUST" );
if ( o != null ) {
if ( o instanceof Vector ) {
must = (Vector)o;
} else {
must.addElement( o );
}
}
}
@ -258,9 +268,9 @@ public class LDAPObjectClassSchema extends LDAPSchemaElement {
if ( val.length() > 0 ) {
s += val + ' ';
}
s += getValue( "MUST", false );
s += "MUST " + vectorToList( must );
s += ' ';
s += getValue( "MAY", false );
s += "MAY " + vectorToList( may );
s += ' ';
val = getCustomValues();
if ( val.length() > 0 ) {
@ -320,6 +330,24 @@ public class LDAPObjectClassSchema extends LDAPSchemaElement {
return s;
}
/**
* Create a list within parentheses, with $ as delimiter
*
* @param vals Values for list
* @return A String with a list of values
*/
protected String vectorToList( Vector vals ) {
String val = "( ";
for( int i = 0; i < vals.size(); i++ ) {
val += (String)vals.elementAt(i) + ' ';
if ( i < (vals.size() - 1) ) {
val += "$ ";
}
}
val += ')';
return val;
}
public static final int STRUCTURAL = 0;
public static final int ABSTRACT = 1;
public static final int AUXILIARY = 2;

View File

@ -443,7 +443,7 @@ public class LDAPSchema {
/* Get the schema definitions for attributes */
String entryName = getSchemaDN( ld, "" );
String[] attrs = { "attributetypes" };
LDAPEntry entry = readSchema( ld, entryName, attrs );
LDAPEntry entry = ld.read( entryName, attrs );
/* Get all attribute definitions, and check the first one */
LDAPAttribute attr = entry.getAttribute( "attributetypes" );
if ( attr != null ) {
@ -499,7 +499,7 @@ public class LDAPSchema {
throw new LDAPException( "No connection", LDAPException.OTHER );
}
String[] attrs = { "subschemasubentry" };
LDAPEntry entry = readSchema( ld, dn, attrs );
LDAPEntry entry = ld.read( dn, attrs );
if ( entry == null ) {
throw new LDAPException( "", LDAPException.NO_SUCH_OBJECT );
}