/** * {@inheritDoc} */ @Override public void unregister( int ruleId ) throws LdapException { throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_13704_CANNOT_MODIFY_DITSR_REGISTRY_COPY ) ); }
/** * {@inheritDoc} */ @Override public void setMaxLengthLength( int maxLengthLength ) throws DecoderException { if ( ( this.indefiniteLengthAllowed ) && ( maxLengthLength > 126 ) ) { throw new DecoderException( I18n.err( I18n.ERR_01006_LENGTH_TOO_LONG_FOR_DEFINITE_FORM ) ); } this.maxLengthLength = maxLengthLength; }
/** * Check that the Dn is not null * * @param dn The Dn to check * @throws LdapException If teh Dn is null or empty */ private void checkDn( Dn dn ) throws LdapException { if ( ( dn == null ) || dn.isEmpty() ) { String message = I18n.err( I18n.ERR_12000_CANNOT_PROCESS_EMPTY_DN ); LOG.error( message ); throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, message ); } }
public void action( CertGenerationContainer container ) throws DecoderException { BerValue value = container.getCurrentTLV().getValue(); String issuerDN = Strings.utf8ToString( value.getData() ); if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_08207_ISSUER_DN, issuerDN ) ); } if ( ( issuerDN != null ) && ( issuerDN.trim().length() > 0 ) ) { if ( !Dn.isValid( issuerDN ) ) { String msg = I18n.err( I18n.ERR_08203_INVALID_ISSUER_DN, issuerDN ); LOG.error( msg ); throw new DecoderException( msg ); } container.getCertGenerationRequest().setIssuerDN( issuerDN ); } } } );
public void action( EndTransactionRequestContainer container ) throws DecoderException { BerValue value = container.getCurrentTLV().getValue(); try { container.getEndTransactionRequest().setCommit( BooleanDecoder.parse( value ) ); } catch ( BooleanDecoderException bde ) { LOG.error( I18n .err( I18n.ERR_08221_BAD_END_TRANSACTION_COMMIT, Strings.dumpBytes( value.getData() ), bde.getMessage() ) ); // This will generate a PROTOCOL_ERROR throw new DecoderException( bde.getMessage(), bde ); } } } );
public void action( ControlsContainer container ) throws DecoderException { TLV tlv = container.getCurrentTLV(); int expectedLength = tlv.getLength(); // The Length should be null if ( expectedLength == 0 ) { String msg = I18n.err( I18n.ERR_08213_NULL_CONTROL_LENGTH ); LOG.error( msg ); // This will generate a PROTOCOL_ERROR throw new DecoderException( msg ); } } } );
public void action( CertGenerationContainer container ) throws DecoderException { BerValue value = container.getCurrentTLV().getValue(); String subjectDN = Strings.utf8ToString( value.getData() ); if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_08219_SUBJECT_DN, subjectDN ) ); } if ( ( subjectDN != null ) && ( subjectDN.trim().length() > 0 ) ) { if ( !Dn.isValid( subjectDN ) ) { String msg = I18n.err( I18n.ERR_08204_INVALID_SUBJECT_DN, subjectDN ); LOG.error( msg ); throw new DecoderException( msg ); } container.getCertGenerationRequest().setSubjectDN( subjectDN ); } else { String msg = I18n.err( I18n.ERR_08202_NULL_TARGET_DN_DECODING_FAILED, Strings.dumpBytes( value.getData() ) ); LOG.error( msg ); throw new DecoderException( msg ); } } } );
public void action( EndTransactionRequestContainer container ) throws DecoderException { BerValue value = container.getCurrentTLV().getValue(); try { container.getEndTransactionRequest().setCommit( BooleanDecoder.parse( value ) ); } catch ( BooleanDecoderException bde ) { LOG.error( I18n .err( I18n.ERR_08221_BAD_END_TRANSACTION_COMMIT, Strings.dumpBytes( value.getData() ), bde.getMessage() ) ); // This will generate a PROTOCOL_ERROR throw new DecoderException( bde.getMessage(), bde ); } } } );
public void action( ControlsContainer container ) throws DecoderException { TLV tlv = container.getCurrentTLV(); int expectedLength = tlv.getLength(); // The Length should be null if ( expectedLength == 0 ) { String msg = I18n.err( I18n.ERR_08213_NULL_CONTROL_LENGTH ); LOG.error( msg ); // This will generate a PROTOCOL_ERROR throw new DecoderException( msg ); } } } );
/** * {@inheritDoc} */ @Override public void renameSchema( String originalSchemaName, String newSchemaName ) throws LdapException { throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_13704_CANNOT_MODIFY_DITSR_REGISTRY_COPY ) ); }
/** * {@inheritDoc} */ @Override public void setMaxLengthLength( int maxLengthLength ) throws DecoderException { if ( ( this.indefiniteLengthAllowed ) && ( maxLengthLength > 126 ) ) { throw new DecoderException( I18n.err( I18n.ERR_01006_LENGTH_TOO_LONG_FOR_DEFINITE_FORM ) ); } this.maxLengthLength = maxLengthLength; }
public void action( CertGenerationContainer container ) throws DecoderException { BerValue value = container.getCurrentTLV().getValue(); String targetDN = Strings.utf8ToString( value.getData() ); if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_08215_TARGET_DN, targetDN ) ); } if ( ( targetDN != null ) && ( targetDN.trim().length() > 0 ) ) { if ( !Dn.isValid( targetDN ) ) { String msg = I18n.err( I18n.ERR_08201_INVALID_TARGET_DN, targetDN ); LOG.error( msg ); throw new DecoderException( msg ); } container.getCertGenerationRequest().setTargetDN( targetDN ); } else { String msg = I18n.err( I18n.ERR_08202_NULL_TARGET_DN_DECODING_FAILED, Strings.dumpBytes( value.getData() ) ); LOG.error( msg ); throw new DecoderException( msg ); } } } );
/** * {@inheritDoc} */ @Override public DitContentRule unregister( String numericOid ) throws LdapException { throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_13703_CANNOT_MODIFY_DITCR_REGISTRY_COPY ) ); }
/** * Set the NotFilter * * @param notFilter The notFilter to set. * @throws DecoderException If the filter is invalid */ public void setNotFilter( Filter notFilter ) throws DecoderException { if ( filterSet != null ) { throw new DecoderException( I18n.err( I18n.ERR_05501_MORE_THAN_ONE_FILTER_FOR_NOT_FILTER ) ); } super.addFilter( notFilter ); }
public void action( CertGenerationContainer container ) throws DecoderException { BerValue value = container.getCurrentTLV().getValue(); String issuerDN = Strings.utf8ToString( value.getData() ); if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_08207_ISSUER_DN, issuerDN ) ); } if ( ( issuerDN != null ) && ( issuerDN.trim().length() > 0 ) ) { if ( !Dn.isValid( issuerDN ) ) { String msg = I18n.err( I18n.ERR_08203_INVALID_ISSUER_DN, issuerDN ); LOG.error( msg ); throw new DecoderException( msg ); } container.getCertGenerationRequest().setIssuerDN( issuerDN ); } } } );
/** * {@inheritDoc} */ @Override public AttributeType unregister( String numericOid ) throws LdapException { throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_13701_CANNOT_MODIFY_AT_REGISTRY_COPY ) ); }
/** * Set the NotFilter * * @param notFilter The notFilter to set. * @throws DecoderException If the NotFilter is already containing a filter */ public void setNotFilter( Filter notFilter ) throws DecoderException { if ( filterSet != null ) { throw new DecoderException( I18n.err( I18n.ERR_05501_MORE_THAN_ONE_FILTER_FOR_NOT_FILTER ) ); } super.addFilter( notFilter ); }
public void action( CertGenerationContainer container ) throws DecoderException { BerValue value = container.getCurrentTLV().getValue(); String targetDN = Strings.utf8ToString( value.getData() ); if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_08215_TARGET_DN, targetDN ) ); } if ( ( targetDN != null ) && ( targetDN.trim().length() > 0 ) ) { if ( !Dn.isValid( targetDN ) ) { String msg = I18n.err( I18n.ERR_08201_INVALID_TARGET_DN, targetDN ); LOG.error( msg ); throw new DecoderException( msg ); } container.getCertGenerationRequest().setTargetDN( targetDN ); } else { String msg = I18n.err( I18n.ERR_08202_NULL_TARGET_DN_DECODING_FAILED, Strings.dumpBytes( value.getData() ) ); LOG.error( msg ); throw new DecoderException( msg ); } } } );
/** * {@inheritDoc} */ @Override public void addMappingFor( AttributeType attributeType ) throws LdapException { throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_13701_CANNOT_MODIFY_AT_REGISTRY_COPY ) ); }
public void action( PersistentSearchContainer container ) throws DecoderException { BerValue value = container.getCurrentTLV().getValue(); try { boolean changesOnly = BooleanDecoder.parse( value ); if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_05305_CHANGES_ONLY, changesOnly ) ); } container.getPersistentSearchDecorator().setChangesOnly( changesOnly ); } catch ( BooleanDecoderException bde ) { String msg = I18n.err( I18n.ERR_05308_CHANGE_ONLY_DECODING_ERROR ); LOG.error( msg, bde ); throw new DecoderException( msg, bde ); } } } );