/** * {@inheritDoc} */ public void unregisterSchemaElements( String schemaName ) throws LdapException { if ( schemaName == null ) { return; } // Loop on all the SchemaObjects stored and remove those associated // with the give schemaName for ( LdapComparator<?> comparator : this ) { if ( schemaName.equalsIgnoreCase( comparator.getSchemaName() ) ) { String oid = comparator.getOid(); SchemaObject removed = unregister( oid ); if ( DEBUG ) { LOG.debug( "Removed {} with oid {} from the registry", removed, oid ); } } } }
/** * @param schemaManager the schemaManager to set */ public void setSchemaManager( SchemaManager schemaManager ) { if ( wrapped == null ) { try { wrapped = (Comparator<E>)schemaManager.lookupComparatorRegistry( matchingRuleOid ); } catch ( LdapException ne ) { // Not found : get the default comparator wrapped = (Comparator<E>)new ComparableComparator<Comparable<E>>( matchingRuleOid ); } } ((LdapComparator<E>)wrapped).setSchemaManager( schemaManager ); super.setSchemaManager( schemaManager ); } }
/** * Attempts to resolve the LdapComparator * * @param comparator the LdapComparator * @param errors the list of errors to add exceptions to */ private void resolve( LdapComparator<?> comparator, List<Throwable> errors ) { // This is currently doing nothing. try { comparator.addToRegistries( errors, this ); } catch ( LdapException e ) { errors.add( e ); } }
comparator = ( LdapComparator<?> ) clazz.newInstance(); if ( !comparator.getOid().equals( oid ) ) String msg = I18n.err( I18n.ERR_10015, oid, comparator.getOid() ); throw new LdapInvalidAttributeValueException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg ); comparator.setBytecode( byteCodeStr ); comparator.setFqcn( className ); comparator.setSchemaManager( schemaManager );
return comparator.compare( n1, n2 );
if ( !ldapComparator.equals( that.ldapComparator ) )
return getLdapComparator().compare( getNormalizedValue(), stringValue.getNormalizedValue() );
.compare( getNormalizedValueReference(), binaryValue.getNormalizedValueReference() );