Class ResponseFunction


  • public class ResponseFunction
    extends Object

    ResponseFunction: class for sending status messages to the client.

    • Field Detail

      • doBreak

        public boolean doBreak
    • Constructor Detail

      • ResponseFunction

        public ResponseFunction​(IClient client)
        Create an empty ResponseFunction
        Parameters:
        client - client
      • ResponseFunction

        public ResponseFunction​(INetConnection netConnection)
        Create an empty ResponseFunction
        Parameters:
        netConnection - net connection
      • ResponseFunction

        public ResponseFunction​(INetConnection netConnection,
                                AMFObj amfObj)
        Create an empty ResponseFunction
        Parameters:
        netConnection - net connection
        amfObj - amf object
      • ResponseFunction

        public ResponseFunction​(IClient client,
                                AMFObj amfObj)
        Create an empty ResponseFunction
        Parameters:
        client - client object
        amfObj - amf object
      • ResponseFunction

        public ResponseFunction​(IMediaStream stream,
                                AMFObj amfObj)
        Create an empty ResponseFunction
        Parameters:
        stream - media stream object
        amfObj - amf object
    • Method Detail

      • setSrc

        public void setSrc​(int src)
        Set the src (stream id) for the message.
        Parameters:
        src - src (stream id)
      • createDefaultMessage

        public void createDefaultMessage​(String inName,
                                         double inResultNum)
        Create a default message (onStatus type messages).
        Parameters:
        inName - handler name (example: onStatus)
        inResultNum - result number of 0 if not result
      • createConnectMessage

        public void createConnectMessage​(String inName,
                                         double inResultNum)
        Create net connection connect message.
        Parameters:
        inName - handler name (example: connection)
        inResultNum - result number if 0 not a result
      • createSeekMessage

        public void createSeekMessage​(String inName)
        Create a seek result message.
        Parameters:
        inName - handler name (example: onStatus)
      • createPlayStatusMessage

        public void createPlayStatusMessage​(String inName)
        Create onPlayStatus message.
        Parameters:
        inName - handler name (example: onPlayStatus)
      • setMessageBytes

        public void setMessageBytes​(byte[] messageBytes)
      • createBroadcastMessage

        public void createBroadcastMessage​(java.nio.ByteBuffer messageBytes)
        Create broadcast message. Used for ByteBuffer handler calls.
        Parameters:
        messageBytes - ByteBuffer with raw AMFData bytes to be sent to client
      • createSOMessage

        public void createSOMessage​(byte[] messageBuffer,
                                    int objectEncoding)
        Create shared object message. Used for ByteBuffer handler calls.
        Parameters:
        messageBuffer -
      • createEnhancedSeekMessage

        public void createEnhancedSeekMessage​(byte[] messageBuffer,
                                              int src,
                                              int tc)
      • addBody

        public void addBody​(AMFData body)
        Add AMFData to the body of the message.
        Parameters:
        body - AMFData message
      • setBody

        public void setBody​(int index,
                            AMFData body)
        Add AMFData to the body of the message.
        Parameters:
        index - index in body list
        body - AMFData message
      • addBytes

        public void addBytes​(byte[] inbytes)
        Add raw AMFData bytes[] to message body
        Parameters:
        inbytes - raw AMFData bytes[]
      • setRetAMFNumber

        public void setRetAMFNumber​(int innum)
        Set the return channel id
        Parameters:
        innum - return channel id
      • getTimecode

        public long getTimecode()
        Get function timecode (milliseconds).
        Returns:
        function timecode (milliseconds)
      • setTimecode

        public void setTimecode​(long timecode)
        Set function timecode (milliseconds).
        Parameters:
        timecode - function timecode (milliseconds)
      • setType

        public void setType​(int type)
        Set message type. See IVHost.CONTENTTYPE_*
        Parameters:
        type - message type
      • getType

        public int getType()
        Get message type. See IVHost.CONTENTTYPE_*
        Returns:
        message type
      • write

        public int write​(java.io.OutputStream out,
                         int chunkSize)
        Write message directly to OutputStream.
        Parameters:
        out - OutputStream
        Returns:
        number of bytes written
      • isForceAMF0

        public boolean isForceAMF0()
      • setForceAMF0

        public void setForceAMF0​(boolean forceAMF0)
      • write

        public int write​(java.io.OutputStream out,
                         boolean isAbsTimecode,
                         int chunkSize)
        Write message directly to OutputStream
        Parameters:
        out - OutputStream
        isAbsTimecode - is timecode absolute
        Returns:
        number of bytes written