/** * {@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; }
/** * Encode the Unbind protocolOp part */ @Override public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException { try { // The tag buffer.put( LdapCodecConstants.UNBIND_REQUEST_TAG ); // The length is always null. buffer.put( ( byte ) 0 ); } catch ( BufferOverflowException boe ) { String msg = I18n.err( I18n.ERR_08212_PDU_BUFFER_TOO_SMALL ); throw new EncoderException( msg, boe ); } return buffer; } }
/** * {@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; }
/** * {@inheritDoc} */ @Override public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException { if ( buffer == null ) { throw new EncoderException( I18n.err( I18n.ERR_08000_CANNOT_PUT_A_PDU_IN_NULL_BUFFER ) ); } if ( valueLength != 0 ) { buffer.put( getValue() ); } return buffer; } }
/** * Process state F * <pre> * (F) --['.']--> (G) * </pre> * * @param oid The OID to check * @param pos The position in the OID string * @return The next OID decoding state * @throws DecoderException If the OID is invalid */ private static OidFSAState processStateF( String oid, int pos ) throws DecoderException { if ( oid.charAt( pos ) != '.' ) { // Expecting a Dot here throw new DecoderException( I18n.err( I18n.ERR_00003_INVALID_OID, "a '.' is expected" ) ); } return OidFSAState.STATE_G; }
/** * {@inheritDoc} */ @Override public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException { if ( buffer == null ) { throw new EncoderException( I18n.err( I18n.ERR_08000_CANNOT_PUT_A_PDU_IN_NULL_BUFFER ) ); } if ( valueLength != 0 ) { buffer.put( getValue() ); } return buffer; } }
/** * Process state B * <pre> * (A) --['.']--> (B) * </pre> * * @param oid The OID to check * @param pos The position in the OID string * @return The next OID decoding state * @throws DecoderException If the OID is invalid */ private static OidFSAState processStateA( String oid, int pos ) throws DecoderException { if ( oid.charAt( pos ) != '.' ) { // Expecting a Dot here throw new DecoderException( I18n.err( I18n.ERR_00003_INVALID_OID, "a '.' is expected" ) ); } return OidFSAState.STATE_B; }
/** * Process state B * <pre> * (A) --['.']--> (B) * </pre> * * @param oid The OID to check * @param pos The position in the OID string * @return The next OID decoding state * @throws DecoderException If the OID is invalid */ private static OidFSAState processStateA( String oid, int pos ) throws DecoderException { if ( oid.charAt( pos ) != '.' ) { // Expecting a Dot here throw new DecoderException( I18n.err( I18n.ERR_00003_INVALID_OID, "a '.' is expected" ) ); } return OidFSAState.STATE_B; }
/** * Process state F * <pre> * (F) --['.']--> (G) * </pre> * * @param oid The OID to check * @param pos The position in the OID string * @return The next OID decoding state * @throws DecoderException If the OID is invalid */ private static OidFSAState processStateF( String oid, int pos ) throws DecoderException { if ( oid.charAt( pos ) != '.' ) { // Expecting a Dot here throw new DecoderException( I18n.err( I18n.ERR_00003_INVALID_OID, "a '.' is expected" ) ); } return OidFSAState.STATE_G; }
/** * Process state B * <pre> * (A) --['.']--> (B) * </pre> * * @param oid The OID to check * @param pos The position in the OID string * @return The next OID decoding state * @throws DecoderException If the OID is invalid */ private static OidFSAState processStateA( String oid, int pos ) throws DecoderException { if ( oid.charAt( pos ) != '.' ) { // Expecting a Dot here throw new DecoderException( I18n.err( I18n.ERR_00003_INVALID_OID, "a '.' is expected" ) ); } return OidFSAState.STATE_B; }
/** * Process state F * <pre> * (F) --['.']--> (G) * </pre> * * @param oid The OID to check * @param pos The position in the OID string * @return The next OID decoding state * @throws DecoderException If the OID is invalid */ private static OidFSAState processStateF( String oid, int pos ) throws DecoderException { if ( oid.charAt( pos ) != '.' ) { // Expecting a Dot here throw new DecoderException( I18n.err( I18n.ERR_00003_INVALID_OID, "a '.' is expected" ) ); } return OidFSAState.STATE_G; }
/** * Process state J * <pre> * (M) --['.']--> (K) * </pre> * * @param oid The OID to check * @param pos The position in the OID string * @return The next OID decoding state * @throws DecoderException If the OID is invalid */ private static OidFSAState processStateM( String oid, int pos ) throws DecoderException { char c = oid.charAt( pos ); if ( c == '.' ) { return OidFSAState.STATE_K; } else { // Expecting a '.' here throw new DecoderException( I18n.err( I18n.ERR_00003_INVALID_OID, "a '.' is expected" ) ); } }
/** * 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 ); }
/** * 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 ); }
/** * Subclass the addFilterMethod, as this is specific for a NotFilter (we * cannot have more than one elements). * * @param filter The Filter to add */ @Override public void addFilter( Filter filter ) throws DecoderException { if ( filterSet != null ) { throw new DecoderException( I18n.err( I18n.ERR_05501_MORE_THAN_ONE_FILTER_FOR_NOT_FILTER ) ); } super.addFilter( filter ); }
/** * 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 ); }
/** * 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 ); }
/** * Subclass the addFilterMethod, as this is specific for a NotFilter (we * cannot have more than one elements). * * @param filter The Filter to add */ @Override public void addFilter( Filter filter ) throws DecoderException { if ( filterSet != null ) { throw new DecoderException( I18n.err( I18n.ERR_05501_MORE_THAN_ONE_FILTER_FOR_NOT_FILTER ) ); } super.addFilter( filter ); }
/** * Subclass the addFilterMethod, as this is specific for a NotFilter (we * cannot have more than one elements). * * @param filter The Filter to add */ @Override public void addFilter( Filter filter ) throws DecoderException { if ( filterSet != null ) { throw new DecoderException( I18n.err( I18n.ERR_05501_MORE_THAN_ONE_FILTER_FOR_NOT_FILTER ) ); } super.addFilter( filter ); }
/** * Subclass the addFilterMethod, as this is specific for a NotFilter (we * cannot have more than one elements). * * @param filter The Filter to add */ @Override public void addFilter( Filter filter ) throws DecoderException { if ( filterSet != null ) { throw new DecoderException( I18n.err( I18n.ERR_05501_MORE_THAN_ONE_FILTER_FOR_NOT_FILTER ) ); } super.addFilter( filter ); }