Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.runtime.services.streaming
Class StreamManagerServer

java.lang.Object
  extended by org.nuxeo.runtime.services.streaming.StreamManagerServer
All Implemented Interfaces:
StreamingServer, StreamManager

public class StreamManagerServer
extends Object
implements StreamingServer, StreamManager

Author:
Bogdan Stefanescu

Nested Class Summary
 class StreamManagerServer.DownloadSession
           
 class StreamManagerServer.UploadSession
           
 
Constructor Summary
StreamManagerServer(InvokerLocator locator, File tmpDir)
           
StreamManagerServer(String serverLocator, File tmpDir)
           
StreamManagerServer(String host, int port, File tmpDir)
           
StreamManagerServer(TransporterServer transporterServer, File tmpDir)
           
 
Method Summary
 void addResource(String uri, StreamSource src)
           
 String addStream(StreamSource src)
           
 void closeDownloadSession(long sid)
           
 void closeUploadSession(String uri)
           
 DownloadInfo createDownloadSession(String uri)
           
 String createUploadSession()
           
 byte[] downloadBytes(long sid, int size)
          Downloads the next 'size' bytes from the given download session.
 StreamSource getStream(String uri)
           
 boolean hasStream(String uri)
           
static void main(String[] args)
           
 void removeStream(String uri)
           
 void start()
           
 void stop()
           
 void uploadBytes(String uri, byte[] bytes)
          Uploads the given bytes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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
Method Detail

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 session
size - 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 uri
bytes - 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)

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.