public void action( PersistentSearchContainer container ) throws DecoderException { Value value = container.getCurrentTLV().getValue(); try { // Check that the value is into the allowed interval int changeTypes = IntegerDecoder.parse( value, PersistentSearch.CHANGE_TYPES_MIN, PersistentSearch.CHANGE_TYPES_MAX ); if ( IS_DEBUG ) { LOG.debug( "changeTypes = " + changeTypes ); } container.getPersistentSearchDecorator().setChangeTypes( changeTypes ); } catch ( IntegerDecoderException e ) { String msg = I18n.err( I18n.ERR_04051 ); LOG.error( msg, e ); throw new DecoderException( msg ); } } } );
public void action( PagedResultsContainer container ) throws DecoderException { Value value = container.getCurrentTLV().getValue(); try { // Check that the value is into the allowed interval int size = IntegerDecoder.parse( value, Integer.MIN_VALUE, Integer.MAX_VALUE ); // We allow negative value to absorb a bug in some M$ client. // Those negative values will be transformed to Integer.MAX_VALUE. if ( size < 0 ) { size = Integer.MAX_VALUE; } if ( IS_DEBUG ) { LOG.debug( "size = " + size ); } container.getDecorator().setSize( size ); } catch ( IntegerDecoderException e ) { String msg = I18n.err( I18n.ERR_04050 ); LOG.error( msg, e ); throw new DecoderException( msg ); } } } );
public void action( LdapMessageContainer<SearchRequestDecorator> container ) throws DecoderException { SearchRequest searchRequest = container.getMessage().getDecorated(); TLV tlv = container.getCurrentTLV(); // The current TLV should be a integer // We get it and store it in timeLimit Value value = tlv.getValue(); int timeLimit = 0; try { timeLimit = IntegerDecoder.parse( value, 0, Integer.MAX_VALUE ); } catch ( IntegerDecoderException ide ) { String msg = I18n.err( I18n.ERR_04104, value.toString() ); LOG.error( msg ); throw new DecoderException( msg ); } searchRequest.setTimeLimit( timeLimit ); if ( IS_DEBUG ) { LOG.debug( "The timeLimit value is set to {} seconds", Integer.valueOf( timeLimit ) ); } } } );
derefAliases = IntegerDecoder.parse(value, LdapConstants.NEVER_DEREF_ALIASES, LdapConstants.DEREF_ALWAYS);
public void action( LdapMessageContainer<BindRequestDecorator> container ) throws DecoderException { BindRequest bindRequestMessage = container.getMessage(); // The current TLV should be a integer between 1 and 127 // We get it and store it in Version TLV tlv = container.getCurrentTLV(); Value value = tlv.getValue(); try { int version = IntegerDecoder.parse( value, 1, 127 ); if ( IS_DEBUG ) { LOG.debug( "Ldap version ", Integer.valueOf( version ) ); } bindRequestMessage.setVersion3( version == 3 ); } catch ( IntegerDecoderException ide ) { LOG.error( I18n .err( I18n.ERR_04078, Strings.dumpBytes(value.getData()), ide.getMessage() ) ); // This will generate a PROTOCOL_ERROR throw new DecoderException( ide.getMessage() ); } } } );
scope = IntegerDecoder.parse( value, LdapConstants.SCOPE_BASE_OBJECT, LdapConstants.SCOPE_WHOLE_SUBTREE );
operation = IntegerDecoder.parse( tlv.getValue(), 0, 2 );
public void action( Asn1Container container ) throws DecoderException { CancelContainer cancelContainer = ( CancelContainer ) container; Value value = cancelContainer.getCurrentTLV().getValue(); try { int cancelId = IntegerDecoder.parse( value, 0, Integer.MAX_VALUE ); if ( IS_DEBUG ) { LOG.debug( "CancelId = " + cancelId ); } cancelContainer.getCancel().setCancelId( cancelId ); cancelContainer.setGrammarEndAllowed( true ); } catch ( IntegerDecoderException e ) { String msg = I18n.err( I18n.ERR_04031, Strings.dumpBytes(value.getData()) ); LOG.error( msg ); throw new DecoderException( msg ); } } });
public void action( Asn1Container container ) throws DecoderException { GracefulDisconnectContainer gracefulDisconnectContainer = ( GracefulDisconnectContainer ) container; Value value = gracefulDisconnectContainer.getCurrentTLV().getValue(); try { int timeOffline = IntegerDecoder.parse( value, 0, 720 ); if ( IS_DEBUG ) { LOG.debug( "Time Offline = " + timeOffline ); } gracefulDisconnectContainer.getGracefulDisconnect().setTimeOffline( timeOffline ); gracefulDisconnectContainer.setGrammarEndAllowed( true ); } catch ( IntegerDecoderException e ) { String msg = I18n.err( I18n.ERR_04037, Strings.dumpBytes(value.getData()) ); LOG.error( msg ); throw new DecoderException( msg ); } } };
public void action( Asn1Container container ) throws DecoderException { GracefulShutdownContainer gracefulShutdownContainer = ( GracefulShutdownContainer ) container; Value value = gracefulShutdownContainer.getCurrentTLV().getValue(); try { int timeOffline = IntegerDecoder.parse( value, 0, 720 ); if ( IS_DEBUG ) { LOG.debug( "Time Offline = " + timeOffline ); } gracefulShutdownContainer.getGracefulShutdown().setTimeOffline( timeOffline ); gracefulShutdownContainer.setGrammarEndAllowed( true ); } catch ( IntegerDecoderException e ) { String msg = I18n.err( I18n.ERR_04037, Strings.dumpBytes(value.getData()) ); LOG.error( msg ); throw new DecoderException( msg ); } } } );
public void action( Asn1Container container ) throws DecoderException { GracefulShutdownContainer gracefulShutdownContainer = ( GracefulShutdownContainer ) container; Value value = gracefulShutdownContainer.getCurrentTLV().getValue(); try { int delay = IntegerDecoder.parse( value, 0, 86400 ); if ( IS_DEBUG ) { LOG.debug( "Delay = " + delay ); } gracefulShutdownContainer.getGracefulShutdown().setDelay( delay ); gracefulShutdownContainer.setGrammarEndAllowed( true ); } catch ( IntegerDecoderException e ) { String msg = I18n.err( I18n.ERR_04036, Strings.dumpBytes(value.getData()) ); LOG.error( msg ); throw new DecoderException( msg ); } } } );
public void action( Asn1Container container ) throws DecoderException { GracefulShutdownContainer gracefulShutdownContainer = ( GracefulShutdownContainer ) container; Value value = gracefulShutdownContainer.getCurrentTLV().getValue(); try { int delay = IntegerDecoder.parse( value, 0, 86400 ); if ( IS_DEBUG ) { LOG.debug( "Delay = " + delay ); } gracefulShutdownContainer.getGracefulShutdown().setDelay( delay ); gracefulShutdownContainer.setGrammarEndAllowed( true ); } catch ( IntegerDecoderException e ) { String msg = I18n.err( I18n.ERR_04036, Strings.dumpBytes(value.getData()) ); LOG.error( msg ); throw new DecoderException( msg ); } } } );
public void action( Asn1Container container ) throws DecoderException { GracefulDisconnectContainer gracefulDisconnectContainer = ( GracefulDisconnectContainer ) container; Value value = gracefulDisconnectContainer.getCurrentTLV().getValue(); try { int delay = IntegerDecoder.parse( value, 0, 86400 ); if ( IS_DEBUG ) { LOG.debug( "Delay = " + delay ); } gracefulDisconnectContainer.getGracefulDisconnect().setDelay( delay ); gracefulDisconnectContainer.setGrammarEndAllowed( true ); } catch ( IntegerDecoderException e ) { String msg = I18n.err( I18n.ERR_04036, Strings.dumpBytes(value.getData()) ); LOG.error( msg ); throw new DecoderException( msg ); } } };
int change = IntegerDecoder.parse( value, 1, 8 );
public void action( SyncStateValueContainer container ) throws DecoderException { Value value = container.getCurrentTLV().getValue(); try { // Check that the value is into the allowed interval int syncStateType = IntegerDecoder.parse(value, SyncStateTypeEnum.PRESENT.getValue(), SyncStateTypeEnum.MODDN.getValue()); SyncStateTypeEnum syncStateTypeEnum = SyncStateTypeEnum.getSyncStateType( syncStateType ); if ( IS_DEBUG ) { LOG.debug( "SyncStateType = {}", syncStateTypeEnum ); } container.getSyncStateValueControl().setSyncStateType( syncStateTypeEnum ); // move on to the entryUUID transition container.setGrammarEndAllowed( false ); } catch ( IntegerDecoderException e ) { String msg = I18n.err( I18n.ERR_04030 ); LOG.error( msg, e ); throw new DecoderException( msg ); } } } );
public void action( SyncRequestValueContainer container ) throws DecoderException { Value value = container.getCurrentTLV().getValue(); try { // Check that the value is into the allowed interval int mode = IntegerDecoder.parse( value, SynchronizationModeEnum.UNUSED.getValue(), SynchronizationModeEnum.REFRESH_AND_PERSIST.getValue() ); SynchronizationModeEnum modeEnum = SynchronizationModeEnum.getSyncMode( mode ); if ( IS_DEBUG ) { LOG.debug( "Mode = " + modeEnum ); } container.getSyncRequestValueControl().setMode( modeEnum ); // We can have an END transition container.setGrammarEndAllowed( true ); } catch ( IntegerDecoderException e ) { String msg = I18n.err( I18n.ERR_04028 ); LOG.error( msg, e ); throw new DecoderException( msg ); } } } );
int messageId = IntegerDecoder.parse( value, 0, Integer.MAX_VALUE );
int abandonnedMessageId = IntegerDecoder.parse( value, 0, Integer.MAX_VALUE );
resultCode = ResultCodeEnum.getResultCode( IntegerDecoder.parse(value, 0, ResultCodeEnum.UNKNOWN .getResultCode()) );