net.rim.device.api.io.messaging
Class BasicSubscriptionMessageBuilder

java.lang.Object
  extended by net.rim.device.api.io.messaging.BasicSubscriptionMessageBuilder

public class BasicSubscriptionMessageBuilder
extends Object

This class helps build a subscription message that contains the information required for a server-side application to contact the subscribing device. The subscription parameters are included as HTTP headers, and the body of the message describes the particulars of the subscription. The following headers are automatically populated:

Since:
BlackBerry API 6.0.0

Method Summary
static ByteMessage createByteSubscriptionMessage(SenderDestination subscribeDestination, ReceiverDestination listenDestination)
          Creates a ByteMessage containing the information required to generate a subscription that is delivered to listenDestination and sent to subscribeDestination.
static StreamMessage createStreamSubscriptionMessage(SenderDestination subscribeDestination, ReceiverDestination listenDestination)
          Creates a StreamMessage containing the information required to generate a subscription that is delivered to listenDestination and sent to subscribeDestination.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Method Detail

createByteSubscriptionMessage

public static ByteMessage createByteSubscriptionMessage(SenderDestination subscribeDestination,
                                                        ReceiverDestination listenDestination)
                                                 throws SubscriptionException
Creates a ByteMessage containing the information required to generate a subscription that is delivered to listenDestination and sent to subscribeDestination.

Parameters:
subscribeDestination - The Destination where the subscription message will be sent.
listenDestination - The Destination that will receive messages from the subscription source.
Returns:
A ByteMessage with headers populated to subscribe to a local URI corresponding to the localDestination.
Throws:
SubscriptionException
Since:
BlackBerry API 6.0.0

createStreamSubscriptionMessage

public static StreamMessage createStreamSubscriptionMessage(SenderDestination subscribeDestination,
                                                            ReceiverDestination listenDestination)
                                                     throws SubscriptionException
Creates a StreamMessage containing the information required to generate a subscription that is delivered to listenDestination and sent to subscribeDestination.

Parameters:
subscribeDestination - The Destination where the subscription message will be sent.
listenDestination - The Destination that will receive messages from the subscription source.
Returns:
A StreamMessage with headers populated to subscribe to a local URI corresponding to the localDestination.
Throws:
SubscriptionException
Since:
BlackBerry API 6.0.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.