/** * Sets the attribute. * * @param attribute the new attribute * @throws LdapException if the attribute is not binary. */ public void setAttribute( Attribute attribute ) throws LdapException { if ( attribute.isHumanReadable() ) { throw new LdapInvalidAttributeValueException( ResultCodeEnum.CONSTRAINT_VIOLATION, I18n.err( I18n.ERR_16007_BINARY_REQUIRED ) ); } this.attribute = attribute; }
/** * Creates a new instance of LdapInvalidAttributeValueException. * * @param resultCode the ResultCodeEnum for this exception * @param message The exception message */ public LdapInvalidAttributeValueException( ResultCodeEnum resultCode, String message ) { super( message ); checkResultCode( resultCode ); this.resultCode = resultCode; }
public LdapComparatorDescription[] parseComparators( Attribute attr ) throws LdapInvalidAttributeValueException { if ( attr == null || attr.size() == 0 ) { return EMPTY_COMPARATORS; } LdapComparatorDescription[] comparatorDescriptions = new LdapComparatorDescription[attr.size()]; int pos = 0; for ( Value value : attr ) { try { comparatorDescriptions[pos++] = comparatorParser.parse( value.getValue() ); } catch ( ParseException e ) { LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err( I18n.ERR_407, value.getValue() ) ); iave.initCause( e ); throw iave; } } return comparatorDescriptions; }
/** * Creates a new SimpleNode object. * * @param attributeType the attribute name * @param bytes the data to inject * @param assertionType the type of assertion represented by this ExprNode */ protected SimpleNode( AttributeType attributeType, byte[] bytes, AssertionType assertionType ) { super( attributeType, assertionType ); this.bytes = bytes; try { if ( attributeType.isHR() ) { value = new Value( attributeType, Strings.utf8ToString( bytes ) ); } else { value = new Value( attributeType, bytes ); } } catch ( LdapInvalidAttributeValueException e ) { throw new RuntimeException( e.getMessage() ); } }
case INVALID_ATTRIBUTE_SYNTAX: LdapInvalidAttributeValueException ldapInvalidAttributeValueException = new LdapInvalidAttributeValueException( ldapResult.getResultCode(), ldapResult.getDiagnosticMessage() ); ldapInvalidAttributeValueException.setResolvedDn( ldapResult.getMatchedDn() );
throw new LdapInvalidDnException( e.getResultCode() );
NamingException ne = new NamingException( I18n.err( I18n.ERR_479, className, liave.getLocalizedMessage() ) ); ne.setRootCause( liave ); throw ne;
LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err( I18n.ERR_405, value ) ); iave.initCause( e ); throw iave;
throw new RuntimeException( e.getMessage() );
case INVALID_ATTRIBUTE_SYNTAX: LdapInvalidAttributeValueException ldapInvalidAttributeValueException = new LdapInvalidAttributeValueException( ldapResult.getResultCode(), ldapResult.getDiagnosticMessage() ); ldapInvalidAttributeValueException.setResolvedDn( ldapResult.getMatchedDn() );
throw new LdapInvalidDnException( e.getResultCode() );
LOG.error( I18n.err( I18n.ERR_134, cnfe.getLocalizedMessage() ) ); throw new IOException( cnfe.getLocalizedMessage() );
/** * Sets the attribute. * * @param attribute the new attribute * @throws LdapException if the attribute is not binary. */ public void setAttribute( Attribute attribute ) throws LdapException { if ( attribute.isHumanReadable() ) { throw new LdapInvalidAttributeValueException( ResultCodeEnum.CONSTRAINT_VIOLATION, I18n.err( I18n.ERR_16007_BINARY_REQUIRED ) ); } this.attribute = attribute; }
public NormalizerDescription[] parseNormalizers( Attribute attr ) throws LdapInvalidAttributeValueException { if ( attr == null || attr.size() == 0 ) { return EMPTY_NORMALIZERS; } NormalizerDescription[] normalizerDescriptions = new NormalizerDescription[attr.size()]; int pos = 0; for ( Value value : attr ) { try { normalizerDescriptions[pos++] = normalizerParser.parse( value.getValue() ); } catch ( ParseException e ) { LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err( I18n.ERR_406, value.getValue() ) ); iave.initCause( e ); throw iave; } } return normalizerDescriptions; }
/** * Creates a new SimpleNode object. * * @param attributeType the attribute name * @param bytes the data to inject * @param assertionType the type of assertion represented by this ExprNode */ protected SimpleNode( AttributeType attributeType, byte[] bytes, AssertionType assertionType ) { super( attributeType, assertionType ); this.bytes = bytes; try { if ( attributeType.isHR() ) { value = new Value( attributeType, Strings.utf8ToString( bytes ) ); } else { value = new Value( attributeType, bytes ); } } catch ( LdapInvalidAttributeValueException e ) { throw new RuntimeException( e.getMessage() ); } }
case INVALID_ATTRIBUTE_SYNTAX: LdapInvalidAttributeValueException ldapInvalidAttributeValueException = new LdapInvalidAttributeValueException( ldapResult.getResultCode(), ldapResult.getDiagnosticMessage() ); ldapInvalidAttributeValueException.setResolvedDn( ldapResult.getMatchedDn() );
/** * Creates a new instance of LdapInvalidAttributeValueException. * * @param resultCode the ResultCodeEnum for this exception */ public LdapInvalidAttributeValueException( ResultCodeEnum resultCode ) { super( null ); checkResultCode( resultCode ); this.resultCode = resultCode; }
throw new LdapInvalidDnException( e.getResultCode() );
/** * Sets the attribute. * * @param attribute the new attribute * @throws LdapException if the attribute is not binary. */ public void setAttribute( Attribute attribute ) throws LdapException { if ( attribute.isHumanReadable() ) { throw new LdapInvalidAttributeValueException( ResultCodeEnum.CONSTRAINT_VIOLATION, I18n.err( I18n.ERR_16007_BINARY_REQUIRED ) ); } this.attribute = attribute; }
LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err( I18n.ERR_421, value.getValue() ) ); iave.initCause( e ); throw iave;