/** * Creates a new instance of ClonedServerEntry. * * The original entry is cloned in order to protect its content. * * @param originalEntry The original entry */ public ClonedServerEntry( Entry originalEntry ) { this.originalEntry = originalEntry; this.clonedEntry = originalEntry.clone(); }
/** * {@inheritDoc} */ @Override public Entry getRootDse( GetRootDseOperationContext getRootDseContext ) { return rootDse.clone(); }
/** * Clone an entry. All the element are duplicated, so a modification on * the original object won't affect the cloned object, as a modification * on the cloned object has no impact on the original object */ @Override public Entry clone() { return entry.clone(); }
public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapException { return addedEntry.clone(); } };
public Entry clone() { return clonedEntry.clone(); }
/** * Clone an entry. All the element are duplicated, so a modification on * the original object won't affect the cloned object, as a modification * on the cloned object has no impact on the original object */ @Override public Entry clone() { return entry.clone(); }
/** * Clone an entry. All the element are duplicated, so a modification on * the original object won't affect the cloned object, as a modification * on the cloned object has no impact on the original object */ @Override public Entry clone() { return entry.clone(); }
clone.entry = entry.clone();
clone.entry = entry.clone();
/** * {@inheritDoc} */ @Override public Entry lookup( LookupOperationContext lookupContext ) throws LdapException { Dn dn = lookupContext.getDn(); if ( dn.getNormName().equals( subschemaSubentryDn.getNormName() ) ) { return new ClonedServerEntry( rootDse.clone() ); } // This is for the case we do a lookup on the rootDSE if ( dn.isRootDse() ) { return new ClonedServerEntry( rootDse ); } Partition partition = getPartition( dn ); Entry entry = partition.lookup( lookupContext ); if ( entry == null ) { throw new LdapNoSuchObjectException( "Attempt to lookup non-existant entry: " + dn.getName() ); } return entry; }
public static Entry getSubschemaEntryCloned( DirectoryService directoryService ) throws LdapException { if ( schemaSubentry == null ) { Dn schemaModificationAttributesDn = new Dn( directoryService.getSchemaManager(), SchemaConstants.SCHEMA_MODIFICATIONS_DN ); Partition partition = directoryService.getSchemaPartition(); LookupOperationContext lookupContext = new LookupOperationContext( null, schemaModificationAttributesDn ); lookupContext.setPartition( partition ); try ( PartitionTxn partitionTxn = partition.beginReadTransaction() ) { lookupContext.setTransaction( partitionTxn ); generateSchemaSubentry( directoryService.getSchemaManager(), directoryService.getSchemaPartition().lookup( lookupContext ) ); } catch ( IOException ioe ) { throw new LdapOtherException( ioe.getMessage(), ioe ); } } return schemaSubentry.clone(); }
return schemaSubentry.clone();
/** * {@inheritDoc} */ @Override public void move( MoveOperationContext moveContext ) throws LdapException { Entry modifiedEntry = moveContext.getOriginalEntry().clone(); modifiedEntry.put( SchemaConstants.MODIFIERS_NAME_AT, getPrincipal( moveContext ).getName() ); modifiedEntry.put( SchemaConstants.MODIFY_TIMESTAMP_AT, DateUtils.getGeneralizedTime() ); Attribute csnAt = new DefaultAttribute( directoryService.getAtProvider().getEntryCSN(), directoryService .getCSN().toString() ); modifiedEntry.put( csnAt ); modifiedEntry.setDn( moveContext.getNewDn() ); moveContext.setModifiedEntry( modifiedEntry ); next( moveContext ); }
/** * {@inheritDoc} */ @Override public void rename( Entry entry, Rdn newRdn, boolean cascade ) throws LdapException { String schemaName = getSchemaName( entry.getDn() ); MatchingRule oldMr = factory.getMatchingRule( schemaManager, entry, schemaManager.getRegistries(), schemaName ); Entry targetEntry = entry.clone(); String newOid = newRdn.getValue(); checkOidIsUnique( newOid ); targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid ); MatchingRule mr = factory.getMatchingRule( schemaManager, targetEntry, schemaManager.getRegistries(), schemaName ); if ( isSchemaEnabled( schemaName ) ) { schemaManager.unregisterMatchingRule( oldMr.getOid() ); schemaManager.add( mr ); } else { unregisterOids( oldMr ); registerOids( mr ); } }
Entry targetEntry = entry.clone(); String newOid = newRdn.getValue(); checkOidIsUnique( newOid );
/** * {@inheritDoc} */ @Override public void rename( Entry entry, Rdn newRdn, boolean cascade ) throws LdapException { String oldOid = getOid( entry ); String schemaName = getSchemaName( entry.getDn() ); if ( schemaManager.getLdapSyntaxRegistry().contains( oldOid ) ) { throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, I18n.err( I18n.ERR_389, oldOid ) ); } Entry targetEntry = entry.clone(); String newOid = newRdn.getValue(); if ( schemaManager.getSyntaxCheckerRegistry().contains( newOid ) ) { throw new LdapSchemaViolationException( ResultCodeEnum.OTHER, I18n.err( I18n.ERR_390, newOid ) ); } targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid ); if ( isSchemaEnabled( schemaName ) ) { SyntaxChecker syntaxChecker = factory.getSyntaxChecker( schemaManager, targetEntry, schemaManager .getRegistries(), schemaName ); schemaManager.unregisterSyntaxChecker( oldOid ); schemaManager.add( syntaxChecker ); } }
/** * {@inheritDoc} */ @Override public void rename( RenameOperationContext renameContext ) throws LdapException { Entry entry = ( ( ClonedServerEntry ) renameContext.getEntry() ).getClonedEntry(); entry.put( SchemaConstants.MODIFIERS_NAME_AT, getPrincipal( renameContext ).getName() ); entry.put( SchemaConstants.MODIFY_TIMESTAMP_AT, DateUtils.getGeneralizedTime() ); Entry modifiedEntry = renameContext.getOriginalEntry().clone(); modifiedEntry.put( SchemaConstants.MODIFIERS_NAME_AT, getPrincipal( renameContext ).getName() ); modifiedEntry.put( SchemaConstants.MODIFY_TIMESTAMP_AT, DateUtils.getGeneralizedTime() ); Attribute csnAt = new DefaultAttribute( directoryService.getAtProvider().getEntryCSN(), directoryService .getCSN().toString() ); modifiedEntry.put( csnAt ); renameContext.setModifiedEntry( modifiedEntry ); next( renameContext ); }
/** * {@inheritDoc} */ @Override public void rename( Entry entry, Rdn newRdn, boolean cascade ) throws LdapException { String oldOid = getOid( entry ); String schemaName = getSchemaName( entry.getDn() ); if ( schemaManager.getMatchingRuleRegistry().contains( oldOid ) ) { throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, I18n.err( I18n.ERR_367, oldOid ) ); } String newOid = newRdn.getValue(); checkOidIsUniqueForNormalizer( newOid ); if ( isSchemaEnabled( schemaName ) ) { // Inject the new OID Entry targetEntry = entry.clone(); targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid ); // Inject the new Dn Dn newDn = targetEntry.getDn().getParent(); newDn = newDn.add( newRdn ); targetEntry.setDn( newDn ); Normalizer normalizer = factory.getNormalizer( schemaManager, targetEntry, schemaManager.getRegistries(), schemaName ); schemaManager.unregisterNormalizer( oldOid ); schemaManager.add( normalizer ); } }
Entry targetEntry = entry.clone(); String newOid = newRdn.getValue(); checkOidIsUnique( newOid );
ObjectClass oldOc = factory.getObjectClass( schemaManager, entry, schemaManager.getRegistries(), schemaName ); Entry targetEntry = entry.clone(); String newOid = newRdn.getValue(); targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );