Class ServiceOutputConnection

  • All Implemented Interfaces:
    IConnection, IOutputConnection

    public class ServiceOutputConnection
    extends java.lang.Object
    implements IOutputConnection
    A service output connection can be used to write data to a remote input connection. For this purpose getInputConnection() has to be called and transferred to the remote side.
    • Field Detail

      • closed

        protected boolean closed
        The closed flag.
      • flushed

        protected boolean flushed
        Flushed flag.
      • buffer

        protected java.util.List<byte[]> buffer
        The buffer.
      • readyfuture

        protected Future<java.lang.Integer> readyfuture
        The ready future.
      • transfercommand

        protected ICommand transfercommand
        The transfer future.
    • Constructor Detail

      • ServiceOutputConnection

        public ServiceOutputConnection()
        Create a new connection.
    • Method Detail

      • write

        public IFuture<java.lang.Void> write​(byte[] data)
        Write the content to the stream.
        Specified by:
        write in interface IOutputConnection
        Parameters:
        data - The data.
      • waitForReady

        public IFuture<java.lang.Integer> waitForReady()
        Wait until the connection is ready for the next write.
        Specified by:
        waitForReady in interface IOutputConnection
        Returns:
        Calls future when next data can be written.
      • close

        public void close()
        Close the connection.
        Specified by:
        close in interface IConnection
      • getConnectionId

        public int getConnectionId()
        Description copied from interface: IConnection
        Get the connection id.
        Specified by:
        getConnectionId in interface IConnection
        Returns:
        The connection id.
      • getNonFunctionalProperties

        public java.util.Map<java.lang.String,​java.lang.Object> getNonFunctionalProperties()
        Get the non-functional properties of the connection.
        Specified by:
        getNonFunctionalProperties in interface IConnection
      • setOutputConnection

        protected void setOutputConnection​(IOutputConnection ocon)
        Set the real output connection to the other side.
      • writeFromInputStream

        public ISubscriptionIntermediateFuture<java.lang.Long> writeFromInputStream​(java.io.InputStream is,
                                                                                    IExternalAccess component)
        Write all data from input stream to the connection. The result is an intermediate future that reports back the size that was written. It can also be used to terminate sending.
        Specified by:
        writeFromInputStream in interface IOutputConnection
        Parameters:
        is - The input stream.
        agen -