Class TeaNetwork

java.lang.Object
nl.colorize.multimedialib.renderer.teavm.TeaNetwork
All Implemented Interfaces:
Network

public class TeaNetwork extends Object implements Network
Sends HTTP requests by delegating them to JavaScript and sending them as AJAX requests. This does mean that any requests sent from the application must be allowed by the CORS (Cross Origin Resource Sharing) headers returned by the server.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    nl.colorize.util.Subscribable<nl.colorize.util.http.URLResponse>
    get(String url, nl.colorize.util.http.Headers headers)
     
    boolean
    Returns true if this renderer supports peer-to-peer connectios on the current platform.
    nl.colorize.util.Subscribable<PeerConnection>
    Uses WebRTC to open a peer-to-peer connection.
    nl.colorize.util.Subscribable<nl.colorize.util.http.URLResponse>
    post(String url, nl.colorize.util.http.Headers headers, nl.colorize.util.http.PostData data)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TeaNetwork

      public TeaNetwork()
  • Method Details

    • get

      public nl.colorize.util.Subscribable<nl.colorize.util.http.URLResponse> get(String url, nl.colorize.util.http.Headers headers)
      Specified by:
      get in interface Network
    • post

      public nl.colorize.util.Subscribable<nl.colorize.util.http.URLResponse> post(String url, nl.colorize.util.http.Headers headers, nl.colorize.util.http.PostData data)
      Specified by:
      post in interface Network
    • openPeerConnection

      public nl.colorize.util.Subscribable<PeerConnection> openPeerConnection()
      Uses WebRTC to open a peer-to-peer connection. This is implemented in JavaScript using the PeerJS library.
      Specified by:
      openPeerConnection in interface Network
    • isPeerToPeerSupported

      public boolean isPeerToPeerSupported()
      Description copied from interface: Network
      Returns true if this renderer supports peer-to-peer connectios on the current platform. See Network.openPeerConnection().
      Specified by:
      isPeerToPeerSupported in interface Network