void setSupportedFeatures ( boolean [ ] input ) { if ( input . length != supportedFeatures . length ) { throw new IllegalArgumentException ( "Bad features length!" ) ; } // Scan through all other features and disable them unless they are supported for ( int i = 0 ; i < input . length ; i ++ ) { BinaryHelloCommand . Feature feature = BinaryHelloCommand . Feature . valueOf ( i ) ; if ( feature == null ) { supportedFeatures [ i ] = false ; continue ; } switch ( feature ) { case MUTATION_SEQNO : case XERROR : case XATTR : case SELECT_BUCKET : case TRACING : supportedFeatures [ i ] = input [ i ] ; break ; case SNAPPY : supportedFeatures [ i ] = input [ i ] && server . getCompression ( ) != CompressionMode . DISABLED ; break ; default : supportedFeatures [ i ] = false ; break ; } } // Post-processing if ( supportedFeatures [ BinaryHelloCommand . Feature . MUTATION_SEQNO . getValue ( ) ] ) { miw . setEnabled ( true ) ; } else { miw . setEnabled ( false ) ; } }
Sets the supported features from a HELLO command .