@Override public Result<RegionAPI.PutIfAbsentResponse> process( ProtobufSerializationService serializationService, RegionAPI.PutIfAbsentRequest request, MessageExecutionContext messageExecutionContext) throws InvalidExecutionContextException, ConnectionStateException, EncodingException, DecodingException { final String regionName = request.getRegionName(); final BasicTypes.Entry entry = request.getEntry(); Object decodedValue = serializationService.decode(entry.getValue()); Object decodedKey = serializationService.decode(entry.getKey()); final Object oldValue = messageExecutionContext.getSecureCache().putIfAbsent(regionName, decodedKey, decodedValue); return Success.of(RegionAPI.PutIfAbsentResponse.newBuilder() .setOldValue(serializationService.encode(oldValue)).build()); } }