@Override public String serializeResponseAsString(final ResponseMessage responseMessage) throws SerializationException { try { return mapper.writeValueAsString(responseMessage); } catch (Exception ex) { logger.warn("Response [{}] could not be serialized by {}.", responseMessage.toString(), AbstractGraphSONMessageSerializerV1d0.class.getName()); throw new SerializationException(ex); } }
@Override public String serializeResponseAsString(final ResponseMessage responseMessage) throws SerializationException { try { return mapper.writeValueAsString(responseMessage); } catch (Exception ex) { logger.warn(String.format("Response [%s] could not be serialized by %s.", responseMessage.toString(), GraphSONMessageSerializerV3d0.class.getName()), ex); throw new SerializationException(ex); } }
@Override public ByteBuf serializeResponseAsBinary(final ResponseMessage responseMessage, final ByteBufAllocator allocator) throws SerializationException { ByteBuf encodedMessage = null; try { final byte[] payload = mapper.writeValueAsBytes(responseMessage); encodedMessage = allocator.buffer(payload.length); encodedMessage.writeBytes(payload); return encodedMessage; } catch (Exception ex) { if (encodedMessage != null) ReferenceCountUtil.release(encodedMessage); logger.warn("Response [{}] could not be serialized by {}.", responseMessage.toString(), AbstractGraphSONMessageSerializerV1d0.class.getName()); throw new SerializationException(ex); } }
@Override public String serializeResponseAsString(final ResponseMessage responseMessage) throws SerializationException { try { return mapper.writeValueAsString(responseMessage); } catch (Exception ex) { logger.warn("Response [{}] could not be serialized by {}.", responseMessage.toString(), AbstractGraphSONMessageSerializerV2d0.class.getName()); throw new SerializationException(ex); } }
@Override public String serializeResponseAsString(final ResponseMessage responseMessage) throws SerializationException { try { return mapper.writeValueAsString(responseMessage); } catch (Exception ex) { logger.warn(String.format("Response [%s] could not be serialized by %s.", responseMessage.toString(), GraphSONMessageSerializerV3d0.class.getName()), ex); throw new SerializationException(ex); } }
@Override public String serializeResponseAsString(final ResponseMessage responseMessage) throws SerializationException { try { return mapper.writeValueAsString(responseMessage); } catch (Exception ex) { logger.warn("Response [{}] could not be serialized by {}.", responseMessage.toString(), AbstractGraphSONMessageSerializerV1d0.class.getName()); throw new SerializationException(ex); } }
@Override public ByteBuf serializeResponseAsBinary(final ResponseMessage responseMessage, final ByteBufAllocator allocator) throws SerializationException { ByteBuf encodedMessage = null; try { final byte[] payload = mapper.writeValueAsBytes(responseMessage); encodedMessage = allocator.buffer(payload.length); encodedMessage.writeBytes(payload); return encodedMessage; } catch (Exception ex) { if (encodedMessage != null) ReferenceCountUtil.release(encodedMessage); logger.warn("Response [{}] could not be serialized by {}.", responseMessage.toString(), AbstractGraphSONMessageSerializerV1d0.class.getName()); throw new SerializationException(ex); } }
@Override public String serializeResponseAsString(final ResponseMessage responseMessage) throws SerializationException { try { return mapper.writeValueAsString(responseMessage); } catch (Exception ex) { logger.warn("Response [{}] could not be serialized by {}.", responseMessage.toString(), AbstractGraphSONMessageSerializerV2d0.class.getName()); throw new SerializationException(ex); } }