com.sun.im.service
Interface ContentStream


public interface ContentStream

Author:
Rahul

Field Summary
static java.lang.String BAD_REQUEST
          It should be used for rejecting the stream if the stream information is not statisfactory.
static java.lang.String METHOD_NOT_SUPPORTED
          It should be used for rejecting the stream if the Available methods are not supported.
 
Method Summary
 void abort()
          This method should be used to abort the ContentStream.
 void accept(java.lang.String preferredMethod, ReceiverStreamingProfile profile, ContentStreamListener listener)
          This method should be used to accept the ContentStream.
 java.lang.String[] getSupportedMethods()
          Lists the supported methods for streaming the data
 long getTransferredBytes()
          This method returns the number of bytes transferred through the stream.
 void reject(java.lang.String reason)
          This method should be used to reject the ContentStream.
 

Field Detail

METHOD_NOT_SUPPORTED

public static final java.lang.String METHOD_NOT_SUPPORTED
It should be used for rejecting the stream if the Available methods are not supported.

See Also:
Constant Field Values

BAD_REQUEST

public static final java.lang.String BAD_REQUEST
It should be used for rejecting the stream if the stream information is not statisfactory.

See Also:
Constant Field Values
Method Detail

getSupportedMethods

public java.lang.String[] getSupportedMethods()
Lists the supported methods for streaming the data

Returns:
An array of string as defined in StreamingService

accept

public void accept(java.lang.String preferredMethod,
                   ReceiverStreamingProfile profile,
                   ContentStreamListener listener)
            throws CollaborationException
This method should be used to accept the ContentStream.

Parameters:
preferredMethod - The preferred method as defined in StreamingService
profile - The updated ReceiverStreamingProfile.
listener - The ContentStreamListener for getting notifications
Throws:
java.lang.IllegalStateException - if the stream was already accepted or rejected
java.lang.IllegalArgumentException - if the preferred method is not one of the supported methods
CollaborationException

reject

public void reject(java.lang.String reason)
            throws CollaborationException
This method should be used to reject the ContentStream.

Parameters:
reason - The reason for rejecting the stream as defined in ContentStream. If the reason is not specified in ContentStream then a custom message should be used.
Throws:
java.lang.IllegalStateException - if the stream was already accepted or rejected
CollaborationException

abort

public void abort()
           throws CollaborationException
This method should be used to abort the ContentStream.

Throws:
java.lang.IllegalStateException - if the stream was already closed
CollaborationException

getTransferredBytes

public long getTransferredBytes()
This method returns the number of bytes transferred through the stream. This method can be used to monitor the progress of the content transfer

Returns:
The number of bytes transferred