/** * Normalize the ReturningAttributes. It reads all the String from the returningAttributesString, * and grab the associated AttributeType from the schema to store it into the returningAttributes * Set. * * @param schemaManager The schema manager */ public void normalize( SchemaManager schemaManager ) { for ( String returnAttribute : returningAttributesStr ) { try { String id = SchemaUtils.stripOptions( returnAttribute ); Set<String> options = SchemaUtils.getOptions( returnAttribute ); AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( id ); AttributeTypeOptions attrOptions = new AttributeTypeOptions( attributeType, options ); returningAttributes.add( attrOptions ); } catch ( LdapException ne ) { LOG.warn( "Requested attribute {} does not exist in the schema, it will be ignored", returnAttribute ); // Unknown attributes should be silently ignored, as RFC 2251 states } } }
/** * Renders a list of attributeTypes for things like the must or may list of * objectClasses using the ( oid $ oid ) format. * * @param ats * the attributeTypes to list * @return a buffer which contains the rendered list */ public static StringBuffer render( AttributeType[] ats ) { StringBuffer buf = new StringBuffer(); return render( buf, ats ); }
renderQDescrs( buf, names ); renderQDString( buf, mru.getDescription() ); renderOids( buf, applies );
renderQDescrs( buf, names ); renderQDString( buf, dsr.getDescription() );
/** * Returns a String description of a schema. The resulting String format is : * <br> * (OID [DESC '<description>'] FQCN <fcqn> [BYTECODE <bytecode>] X-SCHEMA '<schema>') * <br> * @param description The description to transform to a String * @return */ public static String render( LoadableSchemaObject description ) { StringBuffer buf = new StringBuffer(); buf.append( "( " ).append( description.getOid() ); if ( description.getDescription() != null ) { buf.append( " DESC " ); renderQDString( buf, description.getDescription() ); } buf.append( " FQCN " ).append( description.getFqcn() ); if ( !StringTools.isEmpty( description.getBytecode() ) ) { buf.append( " BYTECODE " ).append( description.getBytecode() ); } buf.append( " X-SCHEMA '" ); buf.append( getSchemaName( description ) ); buf.append( "' )" ); return buf.toString(); }
renderQDString( buf, syntax.getDescription() );
public void checkModify( LdapDN normName, ModificationItemImpl[] mods ) throws NamingException { Attributes originalEntry = nexus.lookup( normName ); Attributes targetEntry = SchemaUtils.getTargetEntry( mods, originalEntry ); Attribute targetObjectClasses = targetEntry.get( "objectClass" ); if ( AttributeUtils.containsValueCaseIgnore( targetObjectClasses, "collectiveAttributeSubentry" ) ) { return; } if ( addsAnyCollectiveAttributes( mods ) ) { /* * TODO: Replace the Exception and the ResultCodeEnum with the correct ones. */ throw new LdapSchemaViolationException( "Cannot operate on collective attributes in non-collectiveAttributeSubentries", ResultCodeEnum.OTHER); } }
renderQDescrs( buf, names ); renderQDString( buf, nf.getDescription() ); renderOids( buf, nf.getMustAttributeTypeOids() ); renderOids( buf, may );
renderQDescrs( buf, names ); renderQDString( buf, mr.getDescription() );
renderQDescrs( buf, names ); renderQDString( buf, dcr.getDescription() ); renderOids( buf, aux ); renderOids( buf, must ); renderOids( buf, may ); renderOids( buf, not );
String id = SchemaUtils.stripOptions( attributeId ); Set<String> options = SchemaUtils.getOptions( attributeId );
/** * Renders a list of object classes for things like a list of superior * objectClasses using the ( oid $ oid ) format. * * @param ocs * the objectClasses to list * @return a buffer which contains the rendered list */ public static StringBuffer render( ObjectClass[] ocs ) { StringBuffer buf = new StringBuffer(); return render( buf, ocs ); }
renderQDescrs( buf, names ); renderQDString( buf, at.getDescription() );
renderQDescrs( buf, names ); renderQDString( buf, oc.getDescription() ); renderOids( buf, superiorOids ); renderOids( buf, must ); renderOids( buf, may );
attr.add( SchemaUtils.render( oc ).toString() ); attr.add( SchemaUtils.render( at ).toString() ); attr.add( SchemaUtils.render( mr ).toString() ); attr.add( SchemaUtils.render( mru ).toString() ); attr.add( SchemaUtils.render( syntax ).toString() ); attr.add( SchemaUtils.render( dcr ).toString() ); attr.add( SchemaUtils.render( dsr ).toString() ); attr.add( SchemaUtils.render( nf ).toString() );