@Override public UnregisterResponseImpl deserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException { final ObjectCodec oc = jp.getCodec(); final JsonNode node = oc.readTree(jp); final JsonNode channelIdNode = node.get(RegisterResponse.CHANNEL_ID_FIELD); return new UnregisterResponseImpl(channelIdNode.asText(), new StatusImpl(node.get(UnregisterResponse.STATUS_FIELD).asInt(), "N/A")); } }
@Override public String toString() { return new StringBuilder("RegisterResponseImpl[") .append("messageType=").append(getMessageType()) .append(", channelId=").append(getChannelId()) .append(", status=").append(status) .append("]").toString(); }
@Override public UnregisterResponseImpl deserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException { final ObjectCodec oc = jp.getCodec(); final JsonNode node = oc.readTree(jp); final JsonNode channelIdNode = node.get(RegisterResponse.CHANNEL_ID_FIELD); return new UnregisterResponseImpl(channelIdNode.asText(), new StatusImpl(node.get(UnregisterResponse.STATUS_FIELD).asInt(), "N/A")); } }
@Override public String toString() { return new StringBuilder("RegisterResponseImpl[") .append("messageType=").append(getMessageType()) .append(", channelId=").append(getChannelId()) .append(", status=").append(status) .append("]").toString(); }
@Override public UnregisterResponse handleUnregister(final UnregisterMessage unregister, final String uaid) { final String channelId = unregister.getChannelId(); try { removeChannel(channelId, uaid); return new UnregisterResponseImpl(channelId, new StatusImpl(200, "OK")); } catch (final Exception e) { return new UnregisterResponseImpl(channelId, new StatusImpl(500, "Could not remove the channel")); } }
@Override public UnregisterResponse handleUnregister(final UnregisterMessage unregister, final String uaid) { final String channelId = unregister.getChannelId(); try { removeChannel(channelId, uaid); return new UnregisterResponseImpl(channelId, new StatusImpl(200, "OK")); } catch (final Exception e) { return new UnregisterResponseImpl(channelId, new StatusImpl(500, "Could not remove the channel")); } }