@Override
    protected void printAttributes(StringBuilder xml) {
      // direction
      MediaDirection direction = getDirection();

      if ((direction != null) && (direction != MediaDirection.SENDRECV)) {
        xml.append(' ')
            .append(DIRECTION_ATTR_NAME)
            .append("='")
            .append(direction.toString())
            .append('\'');
      }

      // host
      String host = getHost();

      if (host != null) {
        xml.append(' ').append(HOST_ATTR_NAME).append("='").append(host).append('\'');
      }

      // id
      String id = getID();

      if (id != null) {
        xml.append(' ').append(ID_ATTR_NAME).append("='").append(id).append('\'');
      }

      // lastN
      Integer lastN = getLastN();

      if (lastN != null) {
        xml.append(' ').append(LAST_N_ATTR_NAME).append("='").append(lastN).append('\'');
      }

      // rtcpPort
      int rtcpPort = getRTCPPort();

      if (rtcpPort > 0) {
        xml.append(' ').append(RTCP_PORT_ATTR_NAME).append("='").append(rtcpPort).append('\'');
      }

      // rtpLevelRelayType
      RTPLevelRelayType rtpLevelRelayType = getRTPLevelRelayType();

      if (rtpLevelRelayType != null) {
        xml.append(' ')
            .append(RTP_LEVEL_RELAY_TYPE_ATTR_NAME)
            .append("='")
            .append(rtpLevelRelayType)
            .append('\'');
      }

      // rtpPort
      int rtpPort = getRTPPort();

      if (rtpPort > 0) {
        xml.append(' ').append(RTP_PORT_ATTR_NAME).append("='").append(rtpPort).append('\'');
      }
    }