public void setNdnIndexOn( AttributeType attrType, int cacheSize, int numDupLimit ) throws NamingException { if ( ndnIdx != null ) { NamingException e = new NamingException( "Index already set!" ); throw e; } ndnIdx = new JdbmIndex( attrType, workingDirectory, cacheSize, numDupLimit ); sysIndices.put( attrType.getOid(), ndnIdx ); }
/** * Update the associated MAY AttributeType, even if the SchemaObject is readOnly * * @param mayAttributeTypes the list of allowed AttributeTypes */ public void updateMayAttributeTypes( List<AttributeType> mayAttributeTypes ) { this.mayAttributeTypes.clear(); this.mayAttributeTypes.addAll( mayAttributeTypes ); // update the OIDS now mayAttributeTypeOids.clear(); for ( AttributeType may : mayAttributeTypes ) { mayAttributeTypeOids.add( may.getOid() ); } }
/** * Update the associated MUST AttributeType, even if the SchemaObject is readOnly * * @param mayAttributeTypes the list of allowed AttributeTypes */ public void updateMustAttributeTypes( List<AttributeType> mustAttributeTypes ) { this.mustAttributeTypes.clear(); this.mustAttributeTypes.addAll( mustAttributeTypes ); // update the OIDS now mustAttributeTypeOids.clear(); for ( AttributeType must : mustAttributeTypes ) { mustAttributeTypeOids.add( must.getOid() ); } }
public void setHierarchyIndexOn( AttributeType attrType, int cacheSize, int numDupLimit ) throws NamingException { if ( hierarchyIdx != null ) { NamingException e = new NamingException( "Index already set!" ); throw e; } hierarchyIdx = new JdbmIndex( attrType, workingDirectory, cacheSize, numDupLimit ); sysIndices.put( attrType.getOid(), hierarchyIdx ); }
public void setExistanceIndexOn( AttributeType attrType, int cacheSize, int numDupLimit ) throws NamingException { if ( existanceIdx != null ) { NamingException e = new NamingException( "Index already set!" ); throw e; } existanceIdx = new JdbmIndex( attrType, workingDirectory, cacheSize, numDupLimit ); sysIndices.put( attrType.getOid(), existanceIdx ); }
public void setSubAliasIndexOn( AttributeType attrType, int cacheSize, int numDupLimit ) throws NamingException { if ( subAliasIdx != null ) { NamingException e = new NamingException( "Index already set!" ); throw e; } subAliasIdx = new JdbmIndex( attrType, workingDirectory, cacheSize, numDupLimit ); sysIndices.put( attrType.getOid(), subAliasIdx ); }
public void addIndexOn( AttributeType spec, int cacheSize, int numDupLimit ) throws NamingException { Index idx = new JdbmIndex( spec, workingDirectory, cacheSize, numDupLimit ); indices.put( spec.getOid(), idx ); }
public void setAliasIndexOn( AttributeType attrType, int cacheSize, int numDupLimit ) throws NamingException { if ( aliasIdx != null ) { NamingException e = new NamingException( "Index already set!" ); throw e; } aliasIdx = new JdbmIndex( attrType, workingDirectory, cacheSize, numDupLimit ); sysIndices.put( attrType.getOid(), aliasIdx ); }
public void setOneAliasIndexOn( AttributeType attrType, int cacheSize, int numDupLimit ) throws NamingException { if ( oneAliasIdx != null ) { NamingException e = new NamingException( "Index already set!" ); throw e; } oneAliasIdx = new JdbmIndex( attrType, workingDirectory, cacheSize, numDupLimit ); sysIndices.put( attrType.getOid(), oneAliasIdx ); }
public void setUpdnIndexOn( AttributeType attrType, int cacheSize, int numDupLimit ) throws NamingException { if ( updnIdx != null ) { NamingException e = new NamingException( "Index already set!" ); throw e; } updnIdx = new JdbmIndex( attrType, workingDirectory, cacheSize, numDupLimit ); sysIndices.put( attrType.getOid(), updnIdx ); }
/** * Remove the AttributeType normalizer from the OidNormalizer map */ public void removeMappingFor( AttributeType attributeType ) throws LdapException { if ( attributeType == null ) { return; } oidNormalizerMap.remove( attributeType.getOid() ); // We also have to remove all the short names for this attribute for ( String name : attributeType.getNames() ) { oidNormalizerMap.remove( name.toLowerCase() ); } }
/** * Check the inheritance, and the existence of MatchingRules and LdapSyntax * for an attribute */ private void resolve( AttributeType attributeType, List<Throwable> errors ) { // This set is used to avoid having more than one error // for an AttributeType. It's mandatory when processing // a Superior, as it may be broken and referenced more than once. Set<String> processed = new HashSet<String>(); // Store the AttributeType itself in the processed, to avoid cycle processed.add( attributeType.getOid() ); // Call the recursive method, as we may have superiors to deal with resolveRecursive( attributeType, processed, errors ); }
public void register( String schema, AttributeType attributeType ) throws NamingException { if ( byOid.containsKey( attributeType.getOid() ) ) { NamingException e = new NamingException( "attributeType w/ OID " + attributeType.getOid() + " has already been registered!" ); monitor.registerFailed( attributeType, e ); throw e; } String[] names = attributeType.getNames(); for ( int ii = 0; ii < names.length; ii++ ) { oidRegistry.register( names[ii], attributeType.getOid() ); } registerDescendants( attributeType ); oidToSchema.put( attributeType.getOid(), schema ); byOid.put( attributeType.getOid(), attributeType ); monitor.registered( attributeType ); }
/** * Add a required AttributeType * * @param attributeType The attributeType */ public void addMustAttributeTypes( AttributeType attributeType ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } if ( !isReadOnly ) { if ( !mustAttributeTypeOids.contains( attributeType.getOid() ) ) { mustAttributeTypes.add( attributeType ); mustAttributeTypeOids.add( attributeType.getOid() ); } } }
public void registerDescendants( AttributeType attributeType ) throws NamingException { // add/create the descendent set for this attribute oidToDescendantSet.put( attributeType.getOid(), new HashSet( 5 ) ); // add this attribute to descendant list of other attributes in superior chain onRegisterAddToAncestorDescendants( attributeType, attributeType.getSuperior() ); }
/** * Set the matchingRule's AttributeType the MRU applies to. * * @param applicableAttributes The AttributeType list */ public void setApplicableAttributes( List<AttributeType> applicableAttributes ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } if ( !isReadOnly ) { this.applicableAttributes = applicableAttributes; // update the OIDS now applicableAttributeOids.clear(); for ( AttributeType at : applicableAttributes ) { applicableAttributeOids.add( at.getOid() ); } } }
/** * Update the associated Superior AttributeType, even if the SchemaObject is readOnly * * @param superior The superior for this AttributeType */ public void updateSuperior( AttributeType superior ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } this.superior = superior; this.superiorOid = superior.getOid(); }
/** * Sets the list of required AttributeTypes * * @param mayAttributeTypes the list of required AttributeTypes */ public void setMustAttributeTypes( List<AttributeType> mustAttributeTypes ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } if ( !isReadOnly ) { this.mustAttributeTypes = mustAttributeTypes; // update the OIDS now mustAttributeTypeOids.clear(); for ( AttributeType may : mustAttributeTypes ) { mustAttributeTypeOids.add( may.getOid() ); } } }
/** * Sets the superior for this AttributeType * * @param superior The superior for this AttributeType */ public void setSuperior( AttributeType superior ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } if ( !isReadOnly ) { this.superior = superior; this.superiorOid = superior.getOid(); } }
/** * Serialize a ServerModification. */ public void serialize( ObjectOutput out ) throws IOException { if ( attribute == null ) { throw new IOException( I18n.err( I18n.ERR_04471 ) ); } // Write the operation out.writeInt( operation.getValue() ); AttributeType at = ((DefaultServerAttribute)attribute).getAttributeType(); // Write the attribute's oid out.writeUTF( at.getOid() ); // Write the attribute ((DefaultServerAttribute)attribute).serialize( out ); }