/** * Convert an Attributes as LDIF * * @param attrs the Attributes to convert * @return the corresponding LDIF code as a String * @throws LdapException If a naming exception is encountered. */ public static String convertToLdif( Attributes attrs ) throws LdapException { return convertAttributesToLdif( AttributeUtils.toEntry( attrs, null ), DEFAULT_LINE_LENGTH ); }
/** * Convert an Attributes as LDIF * * @param attrs the Attributes to convert * @param length The ldif line length * @return the corresponding LDIF code as a String * @throws LdapException If a naming exception is encountered. */ public static String convertToLdif( Attributes attrs, int length ) throws LdapException { return convertAttributesToLdif( AttributeUtils.toEntry( attrs, null ), length ); }
/** * Convert an Attributes as LDIF * * @param attrs the Attributes to convert * @param length The ldif line length * @return the corresponding LDIF code as a String * @throws LdapException If a naming exception is encountered. */ public static String convertToLdif( Attributes attrs, int length ) throws LdapException { return convertAttributesToLdif( AttributeUtils.toEntry( attrs, null ), length ); }
/** * Convert an Attributes as LDIF * * @param attrs the Attributes to convert * @return the corresponding LDIF code as a String * @throws LdapException If a naming exception is encountered. */ public static String convertToLdif( Attributes attrs ) throws LdapException { return convertAttributesToLdif( AttributeUtils.toEntry( attrs, null ), DEFAULT_LINE_LENGTH ); }
/** * Convert an Attributes as LDIF. The Dn is written. * * @param attrs the Attributes to convert * @param dn The Dn for this entry * @return the corresponding LDIF code as a String * @throws LdapException If a naming exception is encountered. */ public static String convertToLdif( Attributes attrs, Dn dn ) throws LdapException { return convertToLdif( AttributeUtils.toEntry( attrs, dn ), DEFAULT_LINE_LENGTH ); }
/** * Convert an Attributes as LDIF * * @param attrs the Attributes to convert * @param length The ldif line length * @return the corresponding LDIF code as a String * @throws LdapException If a naming exception is encountered. */ public static String convertToLdif( Attributes attrs, int length ) throws LdapException { return convertAttributesToLdif( AttributeUtils.toEntry( attrs, null ), length ); }
/** * Convert an Attributes as LDIF. The Dn is written. * * @param attrs the Attributes to convert * @param dn The Dn for this entry * @return the corresponding LDIF code as a String * @throws LdapException If a naming exception is encountered. */ public static String convertToLdif( Attributes attrs, Dn dn ) throws LdapException { return convertToLdif( AttributeUtils.toEntry( attrs, dn ), DEFAULT_LINE_LENGTH ); }
/** * Convert an Attributes as LDIF * * @param attrs the Attributes to convert * @return the corresponding LDIF code as a String * @throws LdapException If a naming exception is encountered. */ public static String convertToLdif( Attributes attrs ) throws LdapException { return convertAttributesToLdif( AttributeUtils.toEntry( attrs, null ), DEFAULT_LINE_LENGTH ); }
/** * Convert an Attributes as LDIF. The Dn is written. * * @param attrs the Attributes to convert * @param dn The Dn for this entry * @return the corresponding LDIF code as a String * @throws LdapException If a naming exception is encountered. */ public static String convertToLdif( Attributes attrs, Dn dn ) throws LdapException { return convertToLdif( AttributeUtils.toEntry( attrs, dn ), DEFAULT_LINE_LENGTH ); }
/** * Convert an Attributes as LDIF. The Dn is written. * * @param attrs the Attributes to convert * @param dn The Dn for this entry * @param length The ldif line length * @return the corresponding LDIF code as a String * @throws LdapException If a naming exception is encountered. */ public static String convertToLdif( Attributes attrs, Dn dn, int length ) throws LdapException { return convertToLdif( AttributeUtils.toEntry( attrs, dn ), length ); }
/** * Convert an Attributes as LDIF. The Dn is written. * * @param attrs the Attributes to convert * @param dn The Dn for this entry * @param length The ldif line length * @return the corresponding LDIF code as a String * @throws LdapException If a naming exception is encountered. */ public static String convertToLdif( Attributes attrs, Dn dn, int length ) throws LdapException { return convertToLdif( AttributeUtils.toEntry( attrs, dn ), length ); }
/** * Convert an Attributes as LDIF. The Dn is written. * * @param attrs the Attributes to convert * @param dn The Dn for this entry * @param length The ldif line length * @return the corresponding LDIF code as a String * @throws LdapException If a naming exception is encountered. */ public static String convertToLdif( Attributes attrs, Dn dn, int length ) throws LdapException { return convertToLdif( AttributeUtils.toEntry( attrs, dn ), length ); }
public void run() { try { // Preparing the add request AddRequest request = new AddRequestImpl(); request.setEntryDn( new Dn( dn ) ); request.setEntry( AttributeUtils.toEntry( attributes, new Dn( dn ) ) ); request.addAllControls( convertControls( controls ) ); // Performing the add operation AddResponse addResponse = ldapConnection.add( request ); // Checking the response checkResponse( addResponse ); } catch ( Exception e ) { exception = e; } NamingException ne = null; if ( exception != null ) { ne = new NamingException( exception.getMessage() ); } for ( IJndiLogger logger : getJndiLoggers() ) { logger.logChangetypeAdd( connection, dn, attributes, controls, ne ); } } };