| java.lang.Object com.flexive.shared.stream.FxStreamUtils
FxStreamUtils | public class FxStreamUtils (Code) | | Utitlity class to access the StreamServer
author: Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at) |
Method Summary | |
public static void | downloadBinary(BinaryDownloadCallback callback, List<ServerLocation> server, OutputStream stream, long binaryId, int binarySize) | public static void | downloadBinary(List<ServerLocation> server, OutputStream stream, BinaryDescriptor descriptor) | public static StreamClient | getClient() | public static InetAddress | probeNetworkInterfaces() Probe all network interfaces and return the most suited to run a StreamServer on. | public static BinaryUploadPayload | uploadBinary(long length, InputStream stream) | public static BinaryUploadPayload | uploadBinary(long length, InputStream stream, long timeToLive) Upload a binary (using an OutputStream) to the StreamServer with a given time to live.
Warning: if using a remote connection, this method will return a few miliseconds before
all binary data is stored in the DB! Local connected clients will return *after* all
data is stored. |
DEFAULT_TTL | final public static long DEFAULT_TTL(Code) | | 5 minutes default time to live
|
getClient | public static StreamClient getClient() throws FxStreamException(Code) | | Retrieve a StreamClient, local servers are preferred, remote only as fallback
StreamClient throws: FxStreamException - on errors |
probeNetworkInterfaces | public static InetAddress probeNetworkInterfaces() throws UnknownHostException(Code) | | Probe all network interfaces and return the most suited to run a StreamServer on.
Preferred are interfaces that are not site local.
best suited host to run a StreamServer throws: UnknownHostException - on errors |
uploadBinary | public static BinaryUploadPayload uploadBinary(long length, InputStream stream, long timeToLive) throws FxStreamException(Code) | | Upload a binary (using an OutputStream) to the StreamServer with a given time to live.
Warning: if using a remote connection, this method will return a few miliseconds before
all binary data is stored in the DB! Local connected clients will return *after* all
data is stored. This is currently a 'feature' that might be fixed sometime.
Parameters: length - expected length of the stream/binary Parameters: stream - the Stream containing the binary Parameters: timeToLive - time in miliseconds the binary is guaranteed to exist server side (will be removed once expired) payload containing server side handle of the binary, mimeType and meta data throws: FxStreamException - on errors |
|
|