/** * Transform a schema name to a Dn pointing to the correct position in the DIT * * @param schemaName The schema name * @return the Dn associated with this schema in the DIT */ @Override public String dnToLdif( String schemaName ) throws LdapException { StringBuilder sb = new StringBuilder(); String dn = "m-oid=" + oid + ", " + SchemaConstants.ATTRIBUTE_TYPES_PATH + ", cn=" + Rdn.escapeValue( schemaName ) + ", ou=schema"; // First dump the Dn only Entry entry = new DefaultEntry( dn ); sb.append( LdifUtils.convertToLdif( entry ) ); return sb.toString(); } }
/** * Transform a schema name to a Dn pointing to the correct position in the DIT * * @param schemaName The schema name * @return the Dn associated with this schema in the DIT */ @Override public String dnToLdif( String schemaName ) throws LdapException { StringBuilder sb = new StringBuilder(); String dn = "m-oid=" + oid + ", " + SchemaConstants.OBJECT_CLASSES_PATH + ", cn=" + Rdn.escapeValue( schemaName ) + ", ou=schema"; // First dump the Dn only Entry entry = new DefaultEntry( dn ); sb.append( LdifUtils.convertToLdif( entry ) ); return sb.toString(); } }
/** * Transform a schema name to a Dn pointing to the correct position in the DIT * * @param schemaName The schema name * @return the Dn associated with this schema in the DIT */ @Override public String dnToLdif( String schemaName ) throws LdapException { StringBuilder sb = new StringBuilder(); String dn = "m-oid=" + oid + ", " + SchemaConstants.OBJECT_CLASSES_PATH + ", cn=" + Rdn.escapeValue( schemaName ) + ", ou=schema"; // First dump the Dn only Entry entry = new DefaultEntry( dn ); sb.append( LdifUtils.convertToLdif( entry ) ); return sb.toString(); } }
/** * Transform a schema name to a Dn pointing to the correct position in the DIT * * @param schemaName The schema name * @return the Dn associated with this schema in the DIT */ @Override public String dnToLdif( String schemaName ) throws LdapException { StringBuilder sb = new StringBuilder(); String dn = "m-oid=" + oid + ", " + SchemaConstants.ATTRIBUTE_TYPES_PATH + ", cn=" + Rdn.escapeValue( schemaName ) + ", ou=schema"; // First dump the Dn only Entry entry = new DefaultEntry( dn ); sb.append( LdifUtils.convertToLdif( entry ) ); return sb.toString(); } }
/** * Transform a value in a String, accordingly to RFC 2253 * * @param attrValue The attribute value to be escaped * @return The escaped string value. */ public static String escapeValue( byte[] attrValue ) { if ( Strings.isEmpty( attrValue ) ) { return ""; } String value = Strings.utf8ToString( attrValue ); return escapeValue( value ); }
/** * Transform a value in a String, accordingly to RFC 2253 * * @param attrValue The attribute value to be escaped * @return The escaped string value. */ public static String escapeValue( byte[] attrValue ) { if ( Strings.isEmpty( attrValue ) ) { return ""; } String value = Strings.utf8ToString( attrValue ); return escapeValue( value ); }
/** * Transform a value in a String, accordingly to RFC 2253 * * @param attrValue The attribute value to be escaped * @return The escaped string value. */ public static String escapeValue( byte[] attrValue ) { if ( Strings.isEmpty( attrValue ) ) { return ""; } String value = Strings.utf8ToString( attrValue ); return escapeValue( value ); }
/** * Construct a schema aware Ava. The AttributeType and value will be checked accordingly * to the SchemaManager. * <p> * Note that the upValue should <b>not</b> be null or empty, or resolve * to an empty string after having trimmed it. * * @param schemaManager The SchemaManager instance * @param upType The User Provided type * @param value The value */ private void createAva( SchemaManager schemaManager, String upType, Value value ) { StringBuilder sb = new StringBuilder(); normType = attributeType.getOid(); this.upType = upType; this.value = value; sb.append( upType ); sb.append( '=' ); if ( value != null ) { sb.append( Rdn.escapeValue( value.getValue() ) ); } upName = sb.toString(); hashCode(); }
/** * Construct a schema aware Ava. The AttributeType and value will be checked accordingly * to the SchemaManager. * <p> * Note that the upValue should <b>not</b> be null or empty, or resolve * to an empty string after having trimmed it. * * @param schemaManager The SchemaManager instance * @param upType The User Provided type * @param value The value */ private void createAva( SchemaManager schemaManager, String upType, Value value ) { StringBuilder sb = new StringBuilder(); normType = attributeType.getOid(); this.upType = upType; this.value = value; sb.append( upType ); sb.append( '=' ); if ( value != null ) { sb.append( Rdn.escapeValue( value.getValue() ) ); } upName = sb.toString(); hashCode(); }
/** * Construct a schema aware Ava. The AttributeType and value will be checked accordingly * to the SchemaManager. * <p> * Note that the upValue should <b>not</b> be null or empty, or resolve * to an empty string after having trimmed it. * * @param schemaManager The SchemaManager instance * @param upType The User Provided type * @param value The value */ private void createAva( SchemaManager schemaManager, String upType, Value value ) { StringBuilder sb = new StringBuilder(); normType = attributeType.getOid(); this.upType = upType; this.value = value; sb.append( upType ); sb.append( '=' ); if ( value != null ) { sb.append( Rdn.escapeValue( value.getValue() ) ); } upName = sb.toString(); hashCode(); }
sb.append( Rdn.escapeValue( rdnValues[i] ) );