@Test public void testClone() { }
@Override public Registries clone() throws CloneNotSupportedException { Registries clone = ( Registries ) super.clone(); clone.globalOidRegistry = globalOidRegistry.copy(); clone.attributeTypeRegistry = attributeTypeRegistry.copy(); clone.comparatorRegistry = comparatorRegistry.copy(); clone.ditContentRuleRegistry = ditContentRuleRegistry.copy(); clone.ditStructureRuleRegistry = ditStructureRuleRegistry.copy(); clone.ldapSyntaxRegistry = ldapSyntaxRegistry.copy(); clone.matchingRuleRegistry = matchingRuleRegistry.copy(); clone.matchingRuleUseRegistry = matchingRuleUseRegistry.copy(); clone.nameFormRegistry = nameFormRegistry.copy(); clone.normalizerRegistry = normalizerRegistry.copy(); clone.objectClassRegistry = objectClassRegistry.copy(); clone.syntaxCheckerRegistry = syntaxCheckerRegistry.copy(); clone.errorHandler = errorHandler; for ( AttributeType attributeType : clone.attributeTypeRegistry ) { clone.globalOidRegistry.put( attributeType ); } for ( DitContentRule ditContentRule : clone.ditContentRuleRegistry ) { clone.globalOidRegistry.put( ditContentRule ); } for ( DitStructureRule ditStructureRule : clone.ditStructureRuleRegistry ) { clone.globalOidRegistry.put( ditStructureRule ); } for ( MatchingRule matchingRule : clone.matchingRuleRegistry ) { clone.globalOidRegistry.put( matchingRule ); } for ( MatchingRuleUse matchingRuleUse : clone.matchingRuleUseRegistry ) { clone.globalOidRegistry.put( matchingRuleUse ); } for ( NameForm nameForm : clone.nameFormRegistry ) { clone.globalOidRegistry.put( nameForm ); } for ( ObjectClass objectClass : clone.objectClassRegistry ) { clone.globalOidRegistry.put( objectClass ); } for ( LdapSyntax syntax : clone.ldapSyntaxRegistry ) { clone.globalOidRegistry.put( syntax ); } clone.loadedSchemas = new HashMap<>(); for ( Map.Entry<String, Set<SchemaObjectWrapper>> entry : schemaObjects.entrySet() ) { clone.loadedSchemas.put( entry.getKey(), loadedSchemas.get( entry.getKey() ) ); } clone.using = new HashMap<>(); clone.usedBy = new HashMap<>(); clone.buildReferences(); clone.checkRefInteg(); clone.schemaObjects = new HashMap<>(); for ( Map.Entry<String, Set<SchemaObjectWrapper>> entry : schemaObjects.entrySet() ) { Set<SchemaObjectWrapper> objects = new HashSet<>(); for ( SchemaObjectWrapper schemaObjectWrapper : entry.getValue() ) { SchemaObject original = schemaObjectWrapper.get(); try { if ( !( original instanceof LoadableSchemaObject ) ) { SchemaObject copy = clone.globalOidRegistry.getSchemaObject( original.getOid() ); SchemaObjectWrapper newWrapper = new SchemaObjectWrapper( copy ); objects.add( newWrapper ); } else { SchemaObjectWrapper newWrapper = new SchemaObjectWrapper( original ); objects.add( newWrapper ); } } catch ( LdapException ne ) { } } clone.schemaObjects.put( entry.getKey(), objects ); } return clone; }
Registries implements SchemaLoaderListener, Cloneable { @Override public Registries clone() throws CloneNotSupportedException { Registries clone = ( Registries ) super.clone(); clone.globalOidRegistry = globalOidRegistry.copy(); clone.attributeTypeRegistry = attributeTypeRegistry.copy(); clone.comparatorRegistry = comparatorRegistry.copy(); clone.ditContentRuleRegistry = ditContentRuleRegistry.copy(); clone.ditStructureRuleRegistry = ditStructureRuleRegistry.copy(); clone.ldapSyntaxRegistry = ldapSyntaxRegistry.copy(); clone.matchingRuleRegistry = matchingRuleRegistry.copy(); clone.matchingRuleUseRegistry = matchingRuleUseRegistry.copy(); clone.nameFormRegistry = nameFormRegistry.copy(); clone.normalizerRegistry = normalizerRegistry.copy(); clone.objectClassRegistry = objectClassRegistry.copy(); clone.syntaxCheckerRegistry = syntaxCheckerRegistry.copy(); clone.errorHandler = errorHandler; for ( AttributeType attributeType : clone.attributeTypeRegistry ) { clone.globalOidRegistry.put( attributeType ); } for ( DitContentRule ditContentRule : clone.ditContentRuleRegistry ) { clone.globalOidRegistry.put( ditContentRule ); } for ( DitStructureRule ditStructureRule : clone.ditStructureRuleRegistry ) { clone.globalOidRegistry.put( ditStructureRule ); } for ( MatchingRule matchingRule : clone.matchingRuleRegistry ) { clone.globalOidRegistry.put( matchingRule ); } for ( MatchingRuleUse matchingRuleUse : clone.matchingRuleUseRegistry ) { clone.globalOidRegistry.put( matchingRuleUse ); } for ( NameForm nameForm : clone.nameFormRegistry ) { clone.globalOidRegistry.put( nameForm ); } for ( ObjectClass objectClass : clone.objectClassRegistry ) { clone.globalOidRegistry.put( objectClass ); } for ( LdapSyntax syntax : clone.ldapSyntaxRegistry ) { clone.globalOidRegistry.put( syntax ); } clone.loadedSchemas = new HashMap<>(); for ( Map.Entry<String, Set<SchemaObjectWrapper>> entry : schemaObjects.entrySet() ) { clone.loadedSchemas.put( entry.getKey(), loadedSchemas.get( entry.getKey() ) ); } clone.using = new HashMap<>(); clone.usedBy = new HashMap<>(); clone.buildReferences(); clone.checkRefInteg(); clone.schemaObjects = new HashMap<>(); for ( Map.Entry<String, Set<SchemaObjectWrapper>> entry : schemaObjects.entrySet() ) { Set<SchemaObjectWrapper> objects = new HashSet<>(); for ( SchemaObjectWrapper schemaObjectWrapper : entry.getValue() ) { SchemaObject original = schemaObjectWrapper.get(); try { if ( !( original instanceof LoadableSchemaObject ) ) { SchemaObject copy = clone.globalOidRegistry.getSchemaObject( original.getOid() ); SchemaObjectWrapper newWrapper = new SchemaObjectWrapper( copy ); objects.add( newWrapper ); } else { SchemaObjectWrapper newWrapper = new SchemaObjectWrapper( original ); objects.add( newWrapper ); } } catch ( LdapException ne ) { } } clone.schemaObjects.put( entry.getKey(), objects ); } return clone; } }
Registries implements SchemaLoaderListener, Cloneable { @Override public Registries clone() throws CloneNotSupportedException { Registries clone = ( Registries ) super.clone(); clone.globalOidRegistry = globalOidRegistry.copy(); clone.attributeTypeRegistry = attributeTypeRegistry.copy(); clone.comparatorRegistry = comparatorRegistry.copy(); clone.ditContentRuleRegistry = ditContentRuleRegistry.copy(); clone.ditStructureRuleRegistry = ditStructureRuleRegistry.copy(); clone.ldapSyntaxRegistry = ldapSyntaxRegistry.copy(); clone.matchingRuleRegistry = matchingRuleRegistry.copy(); clone.matchingRuleUseRegistry = matchingRuleUseRegistry.copy(); clone.nameFormRegistry = nameFormRegistry.copy(); clone.normalizerRegistry = normalizerRegistry.copy(); clone.objectClassRegistry = objectClassRegistry.copy(); clone.syntaxCheckerRegistry = syntaxCheckerRegistry.copy(); clone.errorHandler = errorHandler; for ( AttributeType attributeType : clone.attributeTypeRegistry ) { clone.globalOidRegistry.put( attributeType ); } for ( DitContentRule ditContentRule : clone.ditContentRuleRegistry ) { clone.globalOidRegistry.put( ditContentRule ); } for ( DitStructureRule ditStructureRule : clone.ditStructureRuleRegistry ) { clone.globalOidRegistry.put( ditStructureRule ); } for ( MatchingRule matchingRule : clone.matchingRuleRegistry ) { clone.globalOidRegistry.put( matchingRule ); } for ( MatchingRuleUse matchingRuleUse : clone.matchingRuleUseRegistry ) { clone.globalOidRegistry.put( matchingRuleUse ); } for ( NameForm nameForm : clone.nameFormRegistry ) { clone.globalOidRegistry.put( nameForm ); } for ( ObjectClass objectClass : clone.objectClassRegistry ) { clone.globalOidRegistry.put( objectClass ); } for ( LdapSyntax syntax : clone.ldapSyntaxRegistry ) { clone.globalOidRegistry.put( syntax ); } clone.loadedSchemas = new HashMap<>(); for ( Map.Entry<String, Set<SchemaObjectWrapper>> entry : schemaObjects.entrySet() ) { clone.loadedSchemas.put( entry.getKey(), loadedSchemas.get( entry.getKey() ) ); } clone.using = new HashMap<>(); clone.usedBy = new HashMap<>(); clone.buildReferences(); clone.checkRefInteg(); clone.schemaObjects = new HashMap<>(); for ( Map.Entry<String, Set<SchemaObjectWrapper>> entry : schemaObjects.entrySet() ) { Set<SchemaObjectWrapper> objects = new HashSet<>(); for ( SchemaObjectWrapper schemaObjectWrapper : entry.getValue() ) { SchemaObject original = schemaObjectWrapper.get(); try { if ( !( original instanceof LoadableSchemaObject ) ) { SchemaObject copy = clone.globalOidRegistry.getSchemaObject( original.getOid() ); SchemaObjectWrapper newWrapper = new SchemaObjectWrapper( copy ); objects.add( newWrapper ); } else { SchemaObjectWrapper newWrapper = new SchemaObjectWrapper( original ); objects.add( newWrapper ); } } catch ( LdapException ne ) { } } clone.schemaObjects.put( entry.getKey(), objects ); } return clone; } Registries(); }
Registries implements SchemaLoaderListener, Cloneable { @Override public Registries clone() throws CloneNotSupportedException { Registries clone = ( Registries ) super.clone(); clone.globalOidRegistry = globalOidRegistry.copy(); clone.attributeTypeRegistry = attributeTypeRegistry.copy(); clone.comparatorRegistry = comparatorRegistry.copy(); clone.ditContentRuleRegistry = ditContentRuleRegistry.copy(); clone.ditStructureRuleRegistry = ditStructureRuleRegistry.copy(); clone.ldapSyntaxRegistry = ldapSyntaxRegistry.copy(); clone.matchingRuleRegistry = matchingRuleRegistry.copy(); clone.matchingRuleUseRegistry = matchingRuleUseRegistry.copy(); clone.nameFormRegistry = nameFormRegistry.copy(); clone.normalizerRegistry = normalizerRegistry.copy(); clone.objectClassRegistry = objectClassRegistry.copy(); clone.syntaxCheckerRegistry = syntaxCheckerRegistry.copy(); clone.errorHandler = errorHandler; for ( AttributeType attributeType : clone.attributeTypeRegistry ) { clone.globalOidRegistry.put( attributeType ); } for ( DitContentRule ditContentRule : clone.ditContentRuleRegistry ) { clone.globalOidRegistry.put( ditContentRule ); } for ( DitStructureRule ditStructureRule : clone.ditStructureRuleRegistry ) { clone.globalOidRegistry.put( ditStructureRule ); } for ( MatchingRule matchingRule : clone.matchingRuleRegistry ) { clone.globalOidRegistry.put( matchingRule ); } for ( MatchingRuleUse matchingRuleUse : clone.matchingRuleUseRegistry ) { clone.globalOidRegistry.put( matchingRuleUse ); } for ( NameForm nameForm : clone.nameFormRegistry ) { clone.globalOidRegistry.put( nameForm ); } for ( ObjectClass objectClass : clone.objectClassRegistry ) { clone.globalOidRegistry.put( objectClass ); } for ( LdapSyntax syntax : clone.ldapSyntaxRegistry ) { clone.globalOidRegistry.put( syntax ); } clone.loadedSchemas = new HashMap<>(); for ( Map.Entry<String, Set<SchemaObjectWrapper>> entry : schemaObjects.entrySet() ) { clone.loadedSchemas.put( entry.getKey(), loadedSchemas.get( entry.getKey() ) ); } clone.using = new HashMap<>(); clone.usedBy = new HashMap<>(); clone.buildReferences(); clone.checkRefInteg(); clone.schemaObjects = new HashMap<>(); for ( Map.Entry<String, Set<SchemaObjectWrapper>> entry : schemaObjects.entrySet() ) { Set<SchemaObjectWrapper> objects = new HashSet<>(); for ( SchemaObjectWrapper schemaObjectWrapper : entry.getValue() ) { SchemaObject original = schemaObjectWrapper.get(); try { if ( !( original instanceof LoadableSchemaObject ) ) { SchemaObject copy = clone.globalOidRegistry.getSchemaObject( original.getOid() ); SchemaObjectWrapper newWrapper = new SchemaObjectWrapper( copy ); objects.add( newWrapper ); } else { SchemaObjectWrapper newWrapper = new SchemaObjectWrapper( original ); objects.add( newWrapper ); } } catch ( LdapException ne ) { } } clone.schemaObjects.put( entry.getKey(), objects ); } return clone; } Registries(); AttributeTypeRegistry getAttributeTypeRegistry(); ComparatorRegistry getComparatorRegistry(); DitContentRuleRegistry getDitContentRuleRegistry(); DitStructureRuleRegistry getDitStructureRuleRegistry(); MatchingRuleRegistry getMatchingRuleRegistry(); MatchingRuleUseRegistry getMatchingRuleUseRegistry(); NameFormRegistry getNameFormRegistry(); NormalizerRegistry getNormalizerRegistry(); ObjectClassRegistry getObjectClassRegistry(); OidRegistry<SchemaObject> getGlobalOidRegistry(); SyntaxCheckerRegistry getSyntaxCheckerRegistry(); LdapSyntaxRegistry getLdapSyntaxRegistry(); String getOid( String name ); Schema getLoadedSchema( String schemaName ); boolean isSchemaLoaded( String schemaName ); void checkRefInteg(); void delCrossReferences( AttributeType attributeType ); void delCrossReferences( MatchingRule matchingRule ); void buildReference( SchemaObject schemaObject ); void removeReference( SchemaObject schemaObject ); void buildReferences(); void add( SchemaObject schemaObject, boolean check ); void delete( SchemaObject schemaObject ); @Override void schemaLoaded( Schema schema ); @Override void schemaUnloaded( Schema schema ); Map<String, Schema> getLoadedSchemas(); Map<String, Set<SchemaObjectWrapper>> getObjectBySchemaName(); boolean contains( SchemaObject schemaObject ); Set<SchemaObjectWrapper> addSchema( String schemaName ); void associateWithSchema( SchemaObject schemaObject ); void dissociateFromSchema( SchemaObject schemaObject ); boolean isReferenced( SchemaObject schemaObject ); Set<SchemaObjectWrapper> getUsedBy( SchemaObject schemaObject ); String dumpUsedBy(); String dumpUsing(); Set<SchemaObjectWrapper> getUsing( SchemaObject schemaObject ); void addReference( SchemaObject base, SchemaObject referenced ); void delReference( SchemaObject base, SchemaObject referenced ); boolean check(); @Override Registries clone(); boolean isRelaxed(); boolean isStrict(); void setRelaxed(); void setStrict(); SchemaErrorHandler getErrorHandler(); void setErrorHandler( SchemaErrorHandler errorHandler ); boolean isDisabledAccepted(); Set<SchemaObjectWrapper> getReferencing( SchemaObject schemaObject ); void setDisabledAccepted( boolean disabledAccepted ); void clear(); @Override String toString(); }
Registries implements SchemaLoaderListener, Cloneable { @Override public Registries clone() throws CloneNotSupportedException { Registries clone = ( Registries ) super.clone(); clone.globalOidRegistry = globalOidRegistry.copy(); clone.attributeTypeRegistry = attributeTypeRegistry.copy(); clone.comparatorRegistry = comparatorRegistry.copy(); clone.ditContentRuleRegistry = ditContentRuleRegistry.copy(); clone.ditStructureRuleRegistry = ditStructureRuleRegistry.copy(); clone.ldapSyntaxRegistry = ldapSyntaxRegistry.copy(); clone.matchingRuleRegistry = matchingRuleRegistry.copy(); clone.matchingRuleUseRegistry = matchingRuleUseRegistry.copy(); clone.nameFormRegistry = nameFormRegistry.copy(); clone.normalizerRegistry = normalizerRegistry.copy(); clone.objectClassRegistry = objectClassRegistry.copy(); clone.syntaxCheckerRegistry = syntaxCheckerRegistry.copy(); clone.errorHandler = errorHandler; for ( AttributeType attributeType : clone.attributeTypeRegistry ) { clone.globalOidRegistry.put( attributeType ); } for ( DitContentRule ditContentRule : clone.ditContentRuleRegistry ) { clone.globalOidRegistry.put( ditContentRule ); } for ( DitStructureRule ditStructureRule : clone.ditStructureRuleRegistry ) { clone.globalOidRegistry.put( ditStructureRule ); } for ( MatchingRule matchingRule : clone.matchingRuleRegistry ) { clone.globalOidRegistry.put( matchingRule ); } for ( MatchingRuleUse matchingRuleUse : clone.matchingRuleUseRegistry ) { clone.globalOidRegistry.put( matchingRuleUse ); } for ( NameForm nameForm : clone.nameFormRegistry ) { clone.globalOidRegistry.put( nameForm ); } for ( ObjectClass objectClass : clone.objectClassRegistry ) { clone.globalOidRegistry.put( objectClass ); } for ( LdapSyntax syntax : clone.ldapSyntaxRegistry ) { clone.globalOidRegistry.put( syntax ); } clone.loadedSchemas = new HashMap<>(); for ( Map.Entry<String, Set<SchemaObjectWrapper>> entry : schemaObjects.entrySet() ) { clone.loadedSchemas.put( entry.getKey(), loadedSchemas.get( entry.getKey() ) ); } clone.using = new HashMap<>(); clone.usedBy = new HashMap<>(); clone.buildReferences(); clone.checkRefInteg(); clone.schemaObjects = new HashMap<>(); for ( Map.Entry<String, Set<SchemaObjectWrapper>> entry : schemaObjects.entrySet() ) { Set<SchemaObjectWrapper> objects = new HashSet<>(); for ( SchemaObjectWrapper schemaObjectWrapper : entry.getValue() ) { SchemaObject original = schemaObjectWrapper.get(); try { if ( !( original instanceof LoadableSchemaObject ) ) { SchemaObject copy = clone.globalOidRegistry.getSchemaObject( original.getOid() ); SchemaObjectWrapper newWrapper = new SchemaObjectWrapper( copy ); objects.add( newWrapper ); } else { SchemaObjectWrapper newWrapper = new SchemaObjectWrapper( original ); objects.add( newWrapper ); } } catch ( LdapException ne ) { } } clone.schemaObjects.put( entry.getKey(), objects ); } return clone; } Registries(); AttributeTypeRegistry getAttributeTypeRegistry(); ComparatorRegistry getComparatorRegistry(); DitContentRuleRegistry getDitContentRuleRegistry(); DitStructureRuleRegistry getDitStructureRuleRegistry(); MatchingRuleRegistry getMatchingRuleRegistry(); MatchingRuleUseRegistry getMatchingRuleUseRegistry(); NameFormRegistry getNameFormRegistry(); NormalizerRegistry getNormalizerRegistry(); ObjectClassRegistry getObjectClassRegistry(); OidRegistry<SchemaObject> getGlobalOidRegistry(); SyntaxCheckerRegistry getSyntaxCheckerRegistry(); LdapSyntaxRegistry getLdapSyntaxRegistry(); String getOid( String name ); Schema getLoadedSchema( String schemaName ); boolean isSchemaLoaded( String schemaName ); void checkRefInteg(); void delCrossReferences( AttributeType attributeType ); void delCrossReferences( MatchingRule matchingRule ); void buildReference( SchemaObject schemaObject ); void removeReference( SchemaObject schemaObject ); void buildReferences(); void add( SchemaObject schemaObject, boolean check ); void delete( SchemaObject schemaObject ); @Override void schemaLoaded( Schema schema ); @Override void schemaUnloaded( Schema schema ); Map<String, Schema> getLoadedSchemas(); Map<String, Set<SchemaObjectWrapper>> getObjectBySchemaName(); boolean contains( SchemaObject schemaObject ); Set<SchemaObjectWrapper> addSchema( String schemaName ); void associateWithSchema( SchemaObject schemaObject ); void dissociateFromSchema( SchemaObject schemaObject ); boolean isReferenced( SchemaObject schemaObject ); Set<SchemaObjectWrapper> getUsedBy( SchemaObject schemaObject ); String dumpUsedBy(); String dumpUsing(); Set<SchemaObjectWrapper> getUsing( SchemaObject schemaObject ); void addReference( SchemaObject base, SchemaObject referenced ); void delReference( SchemaObject base, SchemaObject referenced ); boolean check(); @Override Registries clone(); boolean isRelaxed(); boolean isStrict(); void setRelaxed(); void setStrict(); SchemaErrorHandler getErrorHandler(); void setErrorHandler( SchemaErrorHandler errorHandler ); boolean isDisabledAccepted(); Set<SchemaObjectWrapper> getReferencing( SchemaObject schemaObject ); void setDisabledAccepted( boolean disabledAccepted ); void clear(); @Override String toString(); static final boolean STRICT; static final boolean RELAXED; }