Refine search
throw new Exception( I18n.err( I18n.ERR_215 ) ); String modsOid = schemaManager.getAttributeTypeRegistry().getOidByName( mods.getId() ); objectClassIdx.drop( value.getString(), id ); ( ( AvlIndex ) index ).drop( value.get(), id ); AttributeType attrType = schemaManager.lookupAttributeTypeRegistry( modsOid ); if ( mods.size() == 0 ) entry.removeAttributes( attrType ); EntryAttribute entryAttr = entry.get( attrType ); entryAttr.remove( ( String ) value.get() ); entryAttr.remove( ( byte[] ) value.get() ); if ( entryAttr.size() == 0 ) entry.removeAttributes( entryAttr.getId() );
( start < 0 ) || ( length < 2 ) || // At least a type and '=' ( upValue.isNull() ) || ( normValue.isNull() ) ) else if ( upValue.isNull() ) else if ( normValue.isNull() ) out.writeUTF( normType ); boolean isHR = !normValue.isBinary(); out.writeUTF( upValue.getString() ); out.writeUTF( normValue.getString() ); out.writeInt( upValue.length() ); out.write( upValue.getBytes() ); out.writeInt( normValue.length() ); out.write( normValue.getBytes() );
/** * {@inheritDoc} */ public Value<?> normalize( final Value<?> value ) { if ( value == null ) { return null; } if ( !value.isBinary() ) { String str = value.getString(); for ( int i = 0; i < matchers.length; i++ ) { str = matchers[i].replaceAll( str ); } return new StringValue( str ); } return value; }
throw new Exception( I18n.err( I18n.ERR_215 ) ); String modsOid = schemaManager.getAttributeTypeRegistry().getOidByName( mods.getId() ); objectClassIdx.drop( value.getString(), id ); ( ( AvlIndex ) index ).add( value.get(), id ); AttributeType type = schemaManager.lookupAttributeTypeRegistry( modsOid ); entry.add( type, value ); addAliasIndices( id, new DN( ndnStr ), mods.getString() );
throw new Exception( I18n.err( I18n.ERR_215 ) ); String modsOid = schemaManager.getAttributeTypeRegistry().getOidByName( mods.getId() ); objectClassIdx.add( value.getString(), id ); ( ( AvlIndex<Object, E> ) index ).add( value.get(), id ); if ( mods.size() > 0 ) entry.put( mods ); entry.remove( mods ); if ( modsOid.equals( aliasAttributeOid ) && mods.size() > 0 ) addAliasIndices( id, new DN( ndnStr ), mods.getString() );
throw new Exception( I18n.err( I18n.ERR_215 ) ); DN normName = entry.getDn(); if ( normName.getNormName().equals( suffixDn.getNormName() ) ) parentDn = ( DN ) normName.clone(); parentDn.remove( parentDn.size() - 1 ); parentId = getEntryId( parentDn.getNormName() ); throw new LdapNoSuchObjectException( I18n.err( I18n.ERR_216, parentDn ) ); EntryAttribute objectClass = entry.get( OBJECT_CLASS_AT ); String msg = I18n.err( I18n.ERR_217, normName.getName(), entry ); throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_VIOLATION, msg ); objectClassIdx.add( value.getString(), id ); if ( objectClass.contains( SchemaConstants.ALIAS_OC ) ) EntryAttribute aliasAttr = entry.get( ALIASED_OBJECT_NAME_AT ); addAliasIndices( id, normName, aliasAttr.getString() ); entryCsnIdx.add( entryCsn.getString(), id ); idx.add( value.get(), id );
public void rename( DN dn, RDN newRdn, boolean deleteOldRdn ) throws Exception Long id = getEntryId( dn.getNormName() ); ServerEntry entry = lookup( id ); DN updn = entry.getDn(); Object newNormValue = newAtav.getNormValue().get(); AttributeType newRdnAttrType = schemaManager.lookupAttributeTypeRegistry( newNormType ); entry.add( newRdnAttrType, newAtav.getUpValue() ); RDN oldRdn = updn.getRdn(); for ( AVA oldAtav : oldRdn ) String oldNormValue = oldAtav.getNormValue().getString(); AttributeType oldRdnAttrType = schemaManager.lookupAttributeTypeRegistry( oldNormType ); entry.remove( oldRdnAttrType, oldNormValue ); DN newUpdn = ( DN ) updn.clone(); // copy da old updn newUpdn.remove( newUpdn.size() - 1 ); // remove old upRdn newUpdn.add( newRdn.getName() ); // add da new upRdn newUpdn.normalize( schemaManager.getNormalizerMapping() );
element.addAttribute( "dn", searchResultEntry.getObjectName().getName() ); attributeElement.addAttribute( "name", attribute.getId() ); if ( ParserUtils.needsBase64Encoding( value.get() ) ) ParserUtils.base64Encode( value.get() ) ); valueElement.addAttribute( new QName( "type", xsiNamespace ), ParserUtils.XSD + ":" + ParserUtils.BASE64BINARY ); attributeElement.addElement( "value" ).addText( value.getString() );
public Value<?> normalize( Value<?> value ) throws LdapException { if ( value.isBinary() ) { byte[] val = value.getBytes(); // each byte will be changed to be > 0, and spaces will be trimmed byte[] newVal = new byte[ val.length ]; int i = 0; for ( byte b:val ) { newVal[i++] = (byte)(b & 0x007F); } return new BinaryValue( StringTools.trim( newVal ) ); } throw new IllegalStateException( I18n.err( I18n.ERR_474 ) ); }
/** * {@inheritDoc} */ public Value<?> normalize( Value<?> value ) throws LdapException { DN dn = null; String dnStr = value.getString(); dn = new DN( dnStr ); dn.normalize( schemaManager.getNormalizerMapping() ); return new StringValue( dn.getNormName() ); }
objectNameBytes = StringTools.getBytesUtf8( entry.getDn().getName() ); int idLength = attribute.getId().getBytes().length; localAttributeLength = 1 + TLV.getNbBytes( idLength ) + idLength; if ( attribute.size() != 0 ) if ( attribute.size() > 0 ) byte[] binaryValue = value.getBytes(); localValuesLength += 1 + TLV.getNbBytes( binaryValue.length ) + binaryValue.length;
/** * {@inheritDoc} */ public Value<?> normalize( Value<?> value ) throws LdapInvalidDnException { if ( value == null ) { return null; } String strValue = value.getString(); return new StringValue( strValue.trim().toUpperCase() ); }
this.id = attribute.getId(); this.upId = attribute.getUpId(); isHR = attribute.isHR(); add( value.clone() ); serverValue = new StringValue( attributeType, clientValue.getString() ); clientValue.getBytes() ); clientValue.getString() ); serverValue = new BinaryValue( attributeType, clientValue.getBytes() );
modifyRequestLength = 1 + TLV.getNbBytes( DN.getNbBytes( object ) ) + DN.getNbBytes( object ); int typeLength = modification.getAttribute().getId().length(); int localModificationLength = 1 + TLV.getNbBytes( typeLength ) + typeLength; if ( modification.getAttribute().size() != 0 ) localValuesLength += 1 + TLV.getNbBytes( value.getBytes().length ) + value.getBytes().length;