public static BinaryResponse create ( BinaryCommand command , MemcachedServer server , ErrorCode errOk , ErrorCode errNotSupp ) { if ( ! server . isCccpEnabled ( ) ) { return new BinaryResponse ( command , errNotSupp ) ; } String config = server . getBucket ( ) . getJSON ( ) ; config = config . replaceAll ( Pattern . quote ( server . getHostname ( ) ) , Matcher . quoteReplacement ( "$HOST" ) ) ; byte [ ] jsBytes = config . getBytes ( ) ; ByteBuffer buf = create ( command , errOk , Datatype . RAW . value ( ) , 0 , 0 , jsBytes . length , 0 ) ; buf . put ( jsBytes ) ; buf . rewind ( ) ; return new BinaryResponse ( buf ) ; }
Create a new response which contains a cluster configuration if supported