org.nuxeo.runtime.services.streaming
Class StreamManagerServer
java.lang.Object
org.nuxeo.runtime.services.streaming.StreamManagerServer
- All Implemented Interfaces:
- StreamingServer, StreamManager
public class StreamManagerServer
- extends Object
- implements StreamingServer, StreamManager
- Author:
- Bogdan Stefanescu
StreamManagerServer
public StreamManagerServer(String host,
int port,
File tmpDir)
throws Exception
- Throws:
Exception
StreamManagerServer
public StreamManagerServer(String serverLocator,
File tmpDir)
throws Exception
- Throws:
Exception
StreamManagerServer
public StreamManagerServer(InvokerLocator locator,
File tmpDir)
throws Exception
- Throws:
Exception
StreamManagerServer
public StreamManagerServer(TransporterServer transporterServer,
File tmpDir)
throws Exception
- Throws:
Exception
start
public void start()
throws Exception
- Specified by:
start in interface StreamManager
- Throws:
Exception
stop
public void stop()
throws Exception
- Specified by:
stop in interface StreamManager
- Throws:
Exception
addStream
public String addStream(StreamSource src)
throws IOException
- Specified by:
addStream in interface StreamManager
- Throws:
IOException
addResource
public void addResource(String uri,
StreamSource src)
getStream
public StreamSource getStream(String uri)
- Specified by:
getStream in interface StreamManager
hasStream
public boolean hasStream(String uri)
- Specified by:
hasStream in interface StreamingServer- Specified by:
hasStream in interface StreamManager
removeStream
public void removeStream(String uri)
- Specified by:
removeStream in interface StreamingServer- Specified by:
removeStream in interface StreamManager
createDownloadSession
public DownloadInfo createDownloadSession(String uri)
throws IOException
- Specified by:
createDownloadSession in interface StreamingServer
- Throws:
IOException
downloadBytes
public byte[] downloadBytes(long sid,
int size)
throws IOException
- Description copied from interface:
StreamingServer
- Downloads the next 'size' bytes from the given download session.
- Specified by:
downloadBytes in interface StreamingServer
- Parameters:
sid - the download sessionsize - the number of bytes to download
- Returns:
- the downloaded byte array or null if no more bytes are available
- Throws:
IOException
closeDownloadSession
public void closeDownloadSession(long sid)
throws IOException
- Specified by:
closeDownloadSession in interface StreamingServer
- Throws:
IOException
createUploadSession
public String createUploadSession()
throws IOException
- Specified by:
createUploadSession in interface StreamingServer
- Throws:
IOException
uploadBytes
public void uploadBytes(String uri,
byte[] bytes)
throws IOException
- Description copied from interface:
StreamingServer
- Uploads the given bytes.
- Specified by:
uploadBytes in interface StreamingServer
- Parameters:
uri - the stream uribytes - the bytes to upload
- Throws:
IOException
closeUploadSession
public void closeUploadSession(String uri)
throws IOException
- Specified by:
closeUploadSession in interface StreamingServer
- Throws:
IOException
main
public static void main(String[] args)
Copyright © 2011 Nuxeo SAS. All Rights Reserved.