import java.io.Serializable; /** * This class is a wrapper for ContentSlide objects and is used to construct an MMS * push message. All of the set methods are used by the server during message * construction. All of the get methods can be used by an implementation of a push * message. * * @version 1.0 * @see ContentSlide */ public class MMSSlide implements Serializable { private ContentSlide textContent = null; private ContentSlide imageContent = null; private ContentSlide audioContent = null; private ContentSlide videoContent = null; /** * Returns the audio content of an MMSSlide object. * @return the binary audio data as a ConstantSlide object */ public ContentSlide getAudioContent() { return audioContent; } /** * Returns the image content of an MMSSlide object. * @return the binary image data as a ConstantSlide object */ public ContentSlide getImageContent() { return imageContent; } /** * Returns the text content of an MMSSlide object. * @return the text data as a ConstantSlide object */ public ContentSlide getTextContent() { return textContent; } /** * Returns the video content of an MMSSlide object. * @return the binary video data as a ConstantSlide object */ public ContentSlide getVideoContent() { return videoContent; } /** * Sets the audio content of an MMSSlide object. * @param contentId the unique ID associated with the audio content * @param contentMimeType MIME type of the audio content * @param contentData the binary audio data as a byte array */ public void setAudioContent(String contentId, String contentMimeType, byte[] contentData) { this.audioContent = getContentSlide(contentId, contentMimeType, contentData); } /** * Sets the image content of an MMSSlide object. * @param contentId unique ID associated with the image content * @param contentMimeType MIME type of the image content * @param contentData the binary image data as a byte array */ public void setImageContent(String contentId, String contentMimeType, byte[] contentData) { this.imageContent = getContentSlide(contentId, contentMimeType, contentData); } /** * Sets the text content of an MMSSlide object. * @param contentId unique ID associated with the text content * @param contentMimeType MIME type of the text content * @param contentData the text data as a byte array */ public void setTextContent(String contentId, String contentMimeType, byte[] contentData) { this.textContent = getContentSlide(contentId, contentMimeType, contentData); } /** * Sets the video content of an MMSSlide object. * @param contentId unique ID associated with the video content * @param contentMimeType MIME type of the video content * @param contentData the binary video data as a byte array */ public void setVideoContent(String contentId, String contentMimeType, byte[] contentData) { this.videoContent = getContentSlide(contentId, contentMimeType, contentData); } /** * Creates a new ContentSlide object with the passed data. * @param contentId the unique ID associated with the content * @param contentMimeType MIME type of the content * @param contentData the binary data * @return contentSlide object */ private ContentSlide getContentSlide(String contentId, String contentMimeType, byte[] contentData) { ContentSlide cs = new ContentSlide(); cs.setContentId(contentId); cs.setContentMimeType(contentMimeType); cs.setContentData(contentData); return cs; } }