Class StandardNetwork
java.lang.Object
nl.colorize.multimedialib.renderer.java2d.StandardNetwork
- All Implemented Interfaces:
Network
Sends HTTP requests using the HTTP client included as part of the Java
standard library. It also provides web socket support through the
Java-WebSocket library.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnl.colorize.util.Subject<nl.colorize.util.http.URLResponse> Sends a HTTP GET request to the specified URL.booleanReturns true if this renderer supports peer-to-peer connections on the current platform.Opens a peer-to-peer connection.nl.colorize.util.Subject<nl.colorize.util.http.URLResponse> Sends a HTTP POST request to the specified URL.
-
Constructor Details
-
StandardNetwork
public StandardNetwork()
-
-
Method Details
-
get
public nl.colorize.util.Subject<nl.colorize.util.http.URLResponse> get(String url, nl.colorize.util.http.Headers headers) Description copied from interface:NetworkSends a HTTP GET request to the specified URL. The request will be performed asyncrhonously, the returnedSubjectcan be used to subscribe to the response. -
post
public nl.colorize.util.Subject<nl.colorize.util.http.URLResponse> post(String url, nl.colorize.util.http.Headers headers, nl.colorize.util.http.PostData body) Description copied from interface:NetworkSends a HTTP POST request to the specified URL. The request will be performed asyncrhonously, the returnedSubjectcan be used to subscribe to the response. -
openPeerConnection
Description copied from interface:NetworkOpens a peer-to-peer connection. The protocol used for the connection depends on both the renderer and the current platform.- Specified by:
openPeerConnectionin interfaceNetwork
-
isPeerToPeerSupported
public boolean isPeerToPeerSupported()Description copied from interface:NetworkReturns true if this renderer supports peer-to-peer connections on the current platform. If this method returns false, trying to open peer-to-peer connections usingNetwork.openPeerConnection()will result in an exception.- Specified by:
isPeerToPeerSupportedin interfaceNetwork
-