ldifEntry.addAttribute( SchemaConstants.ENTRY_UUID_AT, entryUuid.toString() );
ldifEntry.addAttribute( SchemaConstants.ENTRY_UUID_AT, entryUuid.toString() );
ldifEntry.addAttribute( SchemaConstants.ENTRY_UUID_AT, entryUuid.toString() );
/** * Compute a reverse LDIF of a DeleteRequest. We have to get the previous * entry in order to restore it. * * @param dn The deleted entry Dn * @param deletedEntry The entry which has been deleted * @return A reverse LDIF * @throws LdapException If something went wrong */ public static LdifEntry reverseDel( Dn dn, Entry deletedEntry ) throws LdapException { LdifEntry entry = new LdifEntry(); entry.setDn( dn ); entry.setChangeType( ChangeType.Add ); for ( Attribute attribute : deletedEntry ) { entry.addAttribute( attribute ); } return entry; }
/** * Compute a reverse LDIF of a DeleteRequest. We have to get the previous * entry in order to restore it. * * @param dn The deleted entry Dn * @param deletedEntry The entry which has been deleted * @return A reverse LDIF * @throws LdapException If something went wrong */ public static LdifEntry reverseDel( Dn dn, Entry deletedEntry ) throws LdapException { LdifEntry entry = new LdifEntry(); entry.setDn( dn ); entry.setChangeType( ChangeType.Add ); for ( Attribute attribute : deletedEntry ) { entry.addAttribute( attribute ); } return entry; }
/** * Compute a reverse LDIF of a DeleteRequest. We have to get the previous * entry in order to restore it. * * @param dn The deleted entry Dn * @param deletedEntry The entry which has been deleted * @return A reverse LDIF * @throws LdapException If something went wrong */ public static LdifEntry reverseDel( Dn dn, Entry deletedEntry ) throws LdapException { LdifEntry entry = new LdifEntry(); entry.setDn( dn ); entry.setChangeType( ChangeType.Add ); for ( Attribute attribute : deletedEntry ) { entry.addAttribute( attribute ); } return entry; }
entry.addAttribute( attribute );
entry.addAttribute( attributeType, attributeValue ); newAttributeType.setSyntax( schemaManager.getLdapSyntaxRegistry().get( SchemaConstants.DIRECTORY_STRING_SYNTAX ) ); schemaManager.add( newAttributeType ); entry.addAttribute( attributeType, attributeValue );
entry.addAttribute( attributeType, attributeValue ); newAttributeType.setSyntax( schemaManager.getLdapSyntaxRegistry().get( SchemaConstants.DIRECTORY_STRING_SYNTAX ) ); schemaManager.add( newAttributeType ); entry.addAttribute( attributeType, attributeValue );
entry.addAttribute( attributeType, attributeValue ); newAttributeType.setSyntax( schemaManager.getLdapSyntaxRegistry().get( SchemaConstants.DIRECTORY_STRING_SYNTAX ) ); schemaManager.add( newAttributeType ); entry.addAttribute( attributeType, attributeValue );
newLdifEntry.addAttribute( attribute ); newLdifEntry.addAttribute( attribute ); newLdifEntry.addAttribute( anonymizedAttribute );
newLdifEntry.addAttribute( attribute ); newLdifEntry.addAttribute( attribute ); newLdifEntry.addAttribute( anonymizedAttribute );
newLdifEntry.addAttribute( attribute ); newLdifEntry.addAttribute( attribute ); newLdifEntry.addAttribute( anonymizedAttribute );
public static LdifEntry getUserAddLdif( String dnstr, byte[] password, String cn, String sn ) throws LdapException { Dn dn = new Dn( dnstr ); LdifEntry ldif = new LdifEntry(); ldif.setDn( dnstr ); ldif.setChangeType( ChangeType.Add ); Attribute attr = new DefaultAttribute( "objectClass", "top", "person", "organizationalPerson", "inetOrgPerson" ); ldif.addAttribute( attr ); attr = new DefaultAttribute( "ou", "Engineering", "People" ); ldif.addAttribute( attr ); String uid = dn.getRdn().getValue(); ldif.putAttribute( "uid", uid ); ldif.putAttribute( "l", "Bogusville" ); ldif.putAttribute( "cn", cn ); ldif.putAttribute( "sn", sn ); ldif.putAttribute( "mail", uid + "@apache.org" ); ldif.putAttribute( "telephoneNumber", "+1 408 555 4798" ); ldif.putAttribute( "facsimileTelephoneNumber", "+1 408 555 9751" ); ldif.putAttribute( "roomnumber", "4612" ); ldif.putAttribute( "userPassword", password ); String givenName = cn.split( " " )[0]; ldif.putAttribute( "givenName", givenName ); return ldif; }
ldif.addAttribute( addEntry.get( attributeType ).clone() );
/** * {@inheritDoc} */ @Override public void add( AddOperationContext addContext ) throws LdapException { next( addContext ); if ( !changeLog.isEnabled() ) { return; } Entry addEntry = addContext.getEntry(); // we don't want to record addition of a tag as a change if ( addEntry.get( REV_AT_OID ) != null ) { return; } LdifEntry forward = new LdifEntry(); forward.setChangeType( ChangeType.Add ); forward.setDn( addContext.getDn() ); for ( Attribute attribute : addEntry.getAttributes() ) { AttributeType attributeType = attribute.getAttributeType(); forward.addAttribute( addEntry.get( attributeType ).clone() ); } LdifEntry reverse = LdifRevertor.reverseAdd( addContext.getDn() ); addContext.setChangeLogEvent( changeLog.log( getPrincipal( addContext ), forward, reverse ) ); }