com.amos.server.webrtc

## Class SdpObserver

- java.lang.Object
- - com.amos.server.webrtc.SdpObserver

- All Implemented Interfaces:
    org.webrtc.SdpObserver

      public class SdpObserver
      extends java.lang.Object
      implements org.webrtc.SdpObserver

  # SdpObserver Class

  This class helps to track the possible states of the WebRTC Stream protocol. It proceed to handle failure and successfull states.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `LOCAL_SDP`
    `static int` | `REMOTE_SDP`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SdpObserver(java.lang.String nameObserver, android.app.Activity activity, int type)` Constructor for creating a new observer that track the WebRTC states protocol

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `onCreateFailure(java.lang.String s)` Callback to inform the failure at the moment of creating a new Session descriptor message.
    `void` | `onCreateSuccess(org.webrtc.SessionDescription sessionDescription)` Callback to inform the successfully creation of the Session descriptor message.
    `void` | `onSetFailure(java.lang.String s)` Callback to inform the failure at the moment of setting a new Session descriptor message.
    `void` | `onSetSuccess()` Callback to inform the successfully setting of the Session descriptor message.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### LOCAL_SDP

          public static final int LOCAL_SDP

      See Also:
        Constant Field Values

    - #### REMOTE_SDP

          public static final int REMOTE_SDP

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### SdpObserver

          public SdpObserver(java.lang.String nameObserver,
                             android.app.Activity activity,
                             int type)

      Constructor for creating a new observer that track the WebRTC states protocol
      Parameters:
        `nameObserver` - the observer name to recognize the ObserverObject in the logs
        `activity` - the activity to access the TextView
        `type` - the type of the Observer. Remote or Local. Please look at the constants at `SdpObserver`

  - ### Method Detail

    - #### onCreateSuccess

          public void onCreateSuccess(org.webrtc.SessionDescription sessionDescription)

      Callback to inform the successfully creation of the Session descriptor message. It also inform the UI over the UI thread to update the new successfully state on the State TextView description This method is going to be called when the descriptor was created locally or remote
      Specified by:
        `onCreateSuccess` in interface `org.webrtc.SdpObserver`
      Parameters:
        `sessionDescription` - the session descriptor created by the WebRTC library

    - #### onSetSuccess

          public void onSetSuccess()

      Callback to inform the successfully setting of the Session descriptor message. It also inform the UI over the UI thread to update the new successfully state on the State TextView description. This method is going to be called when the Session descriptor was setted in a remote or local form
      Specified by:
        `onSetSuccess` in interface `org.webrtc.SdpObserver`

    - #### onCreateFailure

          public void onCreateFailure(java.lang.String s)

      Callback to inform the failure at the moment of creating a new Session descriptor message. It also inform the UI over the UI thread to update the to the new failure state and to handle it on the State TextView description. This method is going to be called when the Session descriptor failed to be created in a remote or local form
      Specified by:
        `onCreateFailure` in interface `org.webrtc.SdpObserver`

    - #### onSetFailure

          public void onSetFailure(java.lang.String s)

      Callback to inform the failure at the moment of setting a new Session descriptor message. It also inform the UI over the UI thread to update the to the new failure state and to handle it on the State TextView description. This method is going to be called when the Session descriptor failed to be setted in a remote or local form
      Specified by:
        `onSetFailure` in interface `org.webrtc.SdpObserver`
      Parameters:
        `s` - the message description of the failure