/** * {@inheritDoc} */ @Override public T get( String oid ) { try { return oidRegistry.getSchemaObject( oid ); } catch ( LdapException ne ) { return null; } }
/** * Creates a new default NormalizerRegistry instance. */ public DefaultNormalizerRegistry() { super( SchemaObjectType.NORMALIZER, new OidRegistry<Normalizer>() ); }
/** * {@inheritDoc} */ @Override public Iterator<T> iterator() { return oidRegistry.iterator(); }
oidRegistry.put( value ); if ( oidRegistry.contains( value.getOid() ) ) copiedValue = oidRegistry.getSchemaObject( value.getOid() ); oidRegistry.put( copiedValue );
clone.globalOidRegistry = globalOidRegistry.copy(); clone.globalOidRegistry.put( attributeType ); clone.globalOidRegistry.put( ditContentRule ); clone.globalOidRegistry.put( ditStructureRule ); clone.globalOidRegistry.put( matchingRule ); clone.globalOidRegistry.put( matchingRuleUse ); clone.globalOidRegistry.put( nameForm ); clone.globalOidRegistry.put( objectClass ); clone.globalOidRegistry.put( syntax ); SchemaObject copy = clone.globalOidRegistry.getSchemaObject( original.getOid() ); SchemaObjectWrapper newWrapper = new SchemaObjectWrapper( copy ); objects.add( newWrapper );
protected void checkOidIsUnique( String oid ) throws LdapException { if ( schemaManager.getGlobalOidRegistry().contains( oid ) ) { throw new LdapSchemaViolationException( ResultCodeEnum.OTHER, I18n.err( I18n.ERR_335, oid ) ); } }
if ( !( schemaObject instanceof LoadableSchemaObject ) && !globalOidRegistry.contains( schemaObject.getOid() ) ) globalOidRegistry.unregister( oid );
/** * Check that a SchemaObject exists in the global OidRegsitry, and if so, * return it. * * @param entry The Entry we want to verify the existence of * @return The found SchemaObject * @throws LdapException If the check failed */ protected SchemaObject checkOidExists( Entry entry ) throws LdapException { String oid = getOid( entry ); if ( schemaManager.getGlobalOidRegistry().contains( oid ) ) { return schemaManager.getGlobalOidRegistry().getSchemaObject( oid ); } else { throw new LdapSchemaViolationException( ResultCodeEnum.OTHER, I18n.err( I18n.ERR_336, oid ) ); } }
/** * Unregister a SchemaObject's OID from the associated oidRegistry * * @param obj The SchemaObject to unregister * @throws LdapException If the unregistering failed */ protected void unregisterOids( SchemaObject obj ) throws LdapException { schemaManager.getGlobalOidRegistry().unregister( obj.getOid() ); }
/** * Register a SchemaObject's OID in the associated oidRegistry * * @param obj The SchemaObject to register * @throws LdapException If the registering failed */ protected void registerOids( SchemaObject obj ) throws LdapException { schemaManager.getGlobalOidRegistry().register( obj ); }
/** * {@inheritDoc} */ @Override public void clear() { // Clear all the schemaObjects for ( SchemaObject schemaObject : oidRegistry ) { // Don't clear LoadableSchemaObject if ( !( schemaObject instanceof LoadableSchemaObject ) ) { schemaObject.clear(); } } // Remove the byName elements byName.clear(); // Clear the OidRegistry oidRegistry.clear(); } }
oidRegistry.put( value ); if ( oidRegistry.contains( value.getOid() ) ) copiedValue = oidRegistry.getSchemaObject( value.getOid() ); oidRegistry.put( copiedValue );
clone.globalOidRegistry = globalOidRegistry.copy(); clone.globalOidRegistry.put( attributeType ); clone.globalOidRegistry.put( ditContentRule ); clone.globalOidRegistry.put( ditStructureRule ); clone.globalOidRegistry.put( matchingRule ); clone.globalOidRegistry.put( matchingRuleUse ); clone.globalOidRegistry.put( nameForm ); clone.globalOidRegistry.put( objectClass ); clone.globalOidRegistry.put( syntax ); SchemaObject copy = clone.globalOidRegistry.getSchemaObject( original.getOid() ); SchemaObjectWrapper newWrapper = new SchemaObjectWrapper( copy ); objects.add( newWrapper );
protected void checkOidIsUnique( Entry entry ) throws LdapException { String oid = getOid( entry ); if ( schemaManager.getGlobalOidRegistry().contains( oid ) ) { throw new LdapOtherException( I18n.err( I18n.ERR_335, oid ) ); } }
if ( !( schemaObject instanceof LoadableSchemaObject ) && !globalOidRegistry.contains( schemaObject.getOid() ) ) globalOidRegistry.unregister( oid );
/** * {@inheritDoc} */ @Override public T unregister( String numericOid ) throws LdapException { if ( !Oid.isOid( numericOid ) ) { String msg = I18n.err( I18n.ERR_13738_OID_NOT_A_NUMERIC_OID, numericOid ); LOG.error( msg ); throw new LdapException( msg ); } T schemaObject = byName.remove( numericOid ); for ( String name : schemaObject.getNames() ) { byName.remove( name ); } // And remove the SchemaObject from the oidRegistry oidRegistry.unregister( numericOid ); if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_13702_REMOVED_FROM_REGISTRY, schemaObject, numericOid ) ); } return schemaObject; }
oidRegistry.register( schemaObject );