Refine search
MatchingRule mr = attributeType.getEquality(); mr = attributeType.getOrdering(); mr = attributeType.getSubstring(); throw new Exception( I18n.err( I18n.ERR_212, attributeType ) ); forward = new AvlTable<K, Long>( attributeType.getName(), comp, LongComparator.INSTANCE, true ); if ( attributeType.isSingleValued() ) reverse = new AvlTable<Long, K>( attributeType.getName(), LongComparator.INSTANCE, comp, false ); reverse = new AvlTable<Long, K>( attributeType.getName(), LongComparator.INSTANCE, comp, true );
MatchingRule matchingRule = type.getEquality(); OidNormalizer oidNormalizer = null; log.warn( "Attribute " + type.getName() + " does not have normalizer : using NoopNormalizer" ); oidNormalizer = new OidNormalizer( type.getOid(), new NoOpNormalizer() ); oidNormalizer = new OidNormalizer( type.getOid(), matchingRule.getNormalizer() ); mapping.put( type.getOid(), oidNormalizer ); String[] aliases = type.getNames(); for ( int jj = 0; jj < aliases.length; jj++ )
if ( attributeType.getEquality() != null ) delReference( attributeType, attributeType.getEquality() ); if ( attributeType.getOrdering() != null ) delReference( attributeType, attributeType.getOrdering() ); if ( attributeType.getSubstring() != null ) delReference( attributeType, attributeType.getSubstring() ); if ( attributeType.getSyntax() != null ) delReference( attributeType, attributeType.getSyntax() ); if ( attributeType.getSuperior() != null ) delReference( attributeType, attributeType.getSuperior() );
/** * Checks to see if this AttributeType is the descendant of another * attributeType. * * @param ancestor the perspective ancestor to check * @return true if this AttributeType truly descends from the ancestor */ public boolean isDescendantOf( AttributeType ancestor ) { if ( ( ancestor == null ) || equals( ancestor ) ) { return false; } return isAncestorOrEqual( ancestor, this ); }
/** * Recursive method which checks to see if a descendant is really an ancestor or if the two * are equal. * * @param ancestor the possible ancestor of the descendant * @param descendant the possible descendant of the ancestor * @return true if the ancestor equals the descendant or if the descendant is really * a subtype of the ancestor. otherwise false */ private boolean isAncestorOrEqual( AttributeType ancestor, AttributeType descendant ) { if ( ( ancestor == null ) || ( descendant == null ) ) { return false; } if ( ancestor.equals( descendant ) ) { return true; } return isAncestorOrEqual( ancestor, descendant.getSuperior() ); }
/** * Check if the value is stored into an instance of the given * AttributeType, or one of its ascendant. * * For instance, if the Value is associated with a CommonName, * checking for Name will match. * * @param attributeType The AttributeType we are looking at * @return <code>true</code> if the value is associated with the given * attributeType or one of its ascendant */ public boolean instanceOf( AttributeType attributeType ) throws LdapException { if ( ( attributeType != null ) && this.attributeType.equals( attributeType ) ) { if ( this.attributeType.equals( attributeType ) ) { return true; } return this.attributeType.isDescendantOf( attributeType ); } return false; }
throw new Exception( I18n.err( I18n.ERR_215 ) ); DN normName = entry.getDn(); throw new LdapNoSuchObjectException( I18n.err( I18n.ERR_216, parentDn ) ); EntryAttribute objectClass = entry.get( OBJECT_CLASS_AT ); String msg = I18n.err( I18n.ERR_217, normName.getName(), entry ); throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_VIOLATION, msg ); objectClassIdx.add( value.getString(), id ); if ( objectClass.contains( SchemaConstants.ALIAS_OC ) ) EntryAttribute aliasAttr = entry.get( ALIASED_OBJECT_NAME_AT ); addAliasIndices( id, normName, aliasAttr.getString() ); entryCsnIdx.add( entryCsn.getString(), id ); String attributeOid = attribute.getAttributeType().getOid(); idx.add( value.get(), id );
private void setupUserIndices() throws Exception { if ( userIndices != null && userIndices.size() > 0 ) { Map<String, AvlIndex<? extends Object, E>> tmp = new HashMap<String, AvlIndex<? extends Object, E>>(); for ( AvlIndex<? extends Object, E> index : userIndices.values() ) { String oid = schemaManager.getAttributeTypeRegistry().getOidByName( index.getAttributeId() ); AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( oid ); // Check that the attributeType has an EQUALITY matchingRule MatchingRule mr = attributeType.getEquality(); if ( mr != null ) { index.initialize( schemaManager.lookupAttributeTypeRegistry( oid ) ); tmp.put( oid, index ); } else { LOG.error( I18n.err( I18n.ERR_4, attributeType.getName() ) ); } } userIndices = tmp; } else { userIndices = new HashMap<String, AvlIndex<? extends Object, E>>(); } }
throw new IllegalArgumentException( I18n.err( I18n.ERR_465 ) ); return attr1.clone(); return attr0.clone(); else if ( !attr0.getAttributeType().equals( attr1.getAttributeType() ) ) throw new IllegalArgumentException( I18n.err( I18n.ERR_466 ) );
AttributeType attributeType = directoryService.getSchemaManager().lookupAttributeTypeRegistry( oid ); if ( attributeType.getSyntax().isHumanReadable() ) throw new LdapException( I18n.err( I18n.ERR_309, oid ) ); throw new LdapException( I18n.err( I18n.ERR_309, oid ) );
buf.append( "( " ).append( at.getOid() ); List<String> names = at.getNames(); if ( at.getDescription() != null ) renderQDString( buf, at.getDescription() ); if ( at.isObsolete() ) if ( at.getSuperior() != null ) buf.append( " SUP " ).append( at.getSuperior().getName() ); if ( at.getEquality() != null ) buf.append( " EQUALITY " ).append( at.getEquality().getName() ); if ( at.getOrdering() != null ) buf.append( " ORDERING " ).append( at.getOrdering().getName() ); if ( at.getSubstring() != null ) buf.append( " SUBSTR " ).append( at.getSubstring().getName() ); if ( at.getSyntax() != null ) buf.append( " SYNTAX " ).append( at.getSyntax().getOid() );
buf.append( attributeType.getOid() ); buf.append( '\n' ); if ( attributeType.getNames().size() != 0 ) getQDescrs( buf, attributeType.getNames() ); if ( attributeType.getDescription() != null ) buf.append( attributeType.getDescription() ); buf.append( '\n' ); if ( attributeType.isObsolete() ) if ( attributeType.getSuperior() != null ) buf.append( attributeType.getSuperiorName() ); buf.append( '\n' ); if ( attributeType.getEquality() != null ) buf.append( attributeType.getEqualityName() ); buf.append( '\n' ); if ( attributeType.getOrdering() != null ) buf.append( attributeType.getOrderingName() ); buf.append( '\n' );
if ( ! at0.getSuperiorOid().equals( at1.getSuperiorOid() ) ) if ( ! at0.getEqualityOid().equals( at1.getEqualityOid() ) ) if ( ! at0.getSubstringOid().equals( at1.getSubstringOid() ) ) if ( ! at0.getOrderingOid().equals( at1.getOrderingOid() ) ) if ( ! at0.getSyntaxOid().equals( at1.getSyntaxOid() ) ) if ( at0.getSyntaxLength() != at1.getSyntaxLength() ) if ( at0.isSingleValued() != at1.isSingleValued() ) if ( at0.isCollective() != at1.isCollective() ) if ( at0.isUserModifiable() != at1.isUserModifiable() ) if ( at0.getUsage() != at1.getUsage() )
if ( !schemaManager.isSchemaLoaded( schemaName ) ) schema = schemaManager.getLoadedSchema( schemaName ); AttributeType attributeType = new AttributeType( oid ); attributeType.setSyntaxOid( mSyntax.getString() ); attributeType.setSyntaxLength( Integer.parseInt( mSyntaxLength.getString() ) ); attributeType.setEqualityOid( mEquality.getString() ); attributeType.setOrderingOid( mOrdering.getString() ); attributeType.setSubstringOid( mSubstr.getString() ); attributeType.setSuperiorOid( mSupAttributeType.getString() ); String val = mCollective.getString(); attributeType.setCollective( val.equalsIgnoreCase( "TRUE" ) ); String val = mSingleValued.getString(); attributeType.setSingleValued( val.equalsIgnoreCase( "TRUE" ) ); String val = mNoUserModification.getString(); attributeType.setUserModifiable( !val.equalsIgnoreCase( "TRUE" ) ); attributeType.setUsage( UsageEnum.getUsage( mUsage.getString() ) );
isSuccess &= resolve( at.getSuperior(), errors ); isSuccess &= resolve( at.getEquality(), errors ); if ( at.getEquality() != null ) isSuccess &= resolve( at.getOrdering(), errors ); if ( at.getOrdering() != null ) isSuccess &= resolve( at.getSubstr(), errors ); if ( at.getSubstr() != null ) isSuccess &= resolve( at.getSyntax(), errors ); if ( at.getSyntax() == null ) String schema = attributeTypeRegistry.getSchemaName( at.getOid() ); errors.add( new NullPointerException( "attributeType " + at.getName() + " in schema " + schema + " with OID " + at.getOid() + " has a null Syntax" ) ); isSuccess = false;
attributeType = new AttributeType(numericoid(oid.getText())); et.track("NAME", name); attributeType.setNames(qdescrs(name.getText())); et.track("DESC", desc); attributeType.setDescription(qdstring(desc.getText())); et.track("OBSOLETE", obsolete); attributeType.setObsolete( true ); et.track("SUP", superior); attributeType.setSuperiorOid(oid(superior.getText())); et.track("EQUALITY", equality); attributeType.setEqualityOid(oid(equality.getText())); et.track("ORDERING", ordering); attributeType.setOrderingOid(oid(ordering.getText())); et.track("SUBSTR", substring); attributeType.setSubstringOid(oid(substring.getText())); attributeType.setSyntaxOid(noidlen.noid); attributeType.setSyntaxLength(noidlen.len); et.track("SINGLE_VALUE", singleValued); attributeType.setSingleValued( true ); et.track("COLLECTIVE", collective); attributeType.setCollective( true ); et.track("NO_USER_MODIFICATION", noUserModification); attributeType.setUserModifiable( false ); et.track("USAGE", usage1); attributeType.setUsage( UsageEnum.USER_APPLICATIONS ); match(USAGE); match(DIRECTORY_OPERATION);
Long parentId = getParentId( id ); EntryAttribute objectClass = entry.get( OBJECT_CLASS_AT ); if ( objectClass.contains( SchemaConstants.ALIAS_OC ) ) objectClassIdx.drop( value.getString(), id ); String attributeOid = attribute.getAttributeType().getOid(); ( ( AvlIndex ) index ).drop( value.get(), id );
if ( !((EntryAttribute)objectClass).getAttributeType().equals( OBJECT_CLASS_AT ) ) if ( !attribute.contains( value.getString() ) )