App Engine Java SDK version 1.9.8
[gae.git] / java / src / main / com / google / appengine / api / channel / ChannelMessage.java
blob239b17a0411cdb509012caa27a1b3d46db004d26
1 // Copyright 2010 Google Inc. All rights reserved.
3 package com.google.appengine.api.channel;
5 /**
6 * Class that represents a channel message. {@code ChannelMessages} can be
7 * sent as outgoing messages or can be parsed as incoming messages by
8 * {@link ChannelService#parseMessage}.
11 public final class ChannelMessage {
13 private final String clientId;
14 private final String message;
16 /**
17 * Constructor for a channel message.
19 * @param clientId identifies the client that will receive this message. The
20 * client should be connected to the channel using a token created by
21 * ChannelService.CreateChannel, using the same client id. The client id
22 * must be fewer than 64 bytes when encoded to UTF-8.
23 * @param message the message payload. The payload must be smaller than 32K
24 * when encoded to UTF-8.
26 public ChannelMessage(String clientId, String message) {
27 this.clientId = clientId;
28 this.message = message;
31 public String getClientId() {
32 return clientId;
35 public String getMessage() {
36 return message;