org.ogf.saga.stream
Interface Stream

All Superinterfaces:
Async, AsyncAttributes<Stream>, AsyncMonitorable<Stream>, Attributes, Cloneable, Monitorable, SagaObject

public interface Stream
extends SagaObject, Async, AsyncAttributes<Stream>, AsyncMonitorable<Stream>

A client stream object.


Field Summary
static String BLOCKING
          Attribute name, determines if read/writes are blocking or not.
static String BUFSIZE
          Attribute name, determines size of send buffer.
static String COMPRESSION
          Attribute name, determines if data are compressed before/after transfer.
static String NODELAY
          Attribute name, determines if packets are sent without delay.
static String RELIABLE
          Attribute name, determines if all sent data MUST arrive.
static String STREAM_DROPPED
          Metric name, fires if the stream gets dropped by the remote party.
static String STREAM_EXCEPTION
          Metric name, fires if the stream has an error condition.
static String STREAM_READ
          Metric name, fires if the stream gets readable (which means that a subsequent read() can successfully read one or more bytes of data).
static String STREAM_STATE
          Metric name, fires if the state of the stream changes, and has the value of the new state.
static String STREAM_WRITE
          Metric name, fires if the stream gets writable (which means that a subsequent write() can successfully write one or more bytes of data).
static String TIMEOUT
          Attribute name, determines the amount of idle time before dropping the connection, in seconds.
 
Fields inherited from interface org.ogf.saga.SagaObject
NO_WAIT, WAIT_FOREVER
 
Fields inherited from interface org.ogf.saga.attributes.Attributes
BOOL, ENUM, FALSE, FLOAT, INT, STRING, TIME, TRIGGER, TRUE
 
Method Summary
 void close()
          Closes an active connection.
 void close(float timeoutInSeconds)
          Closes an active connection.
 Task<Stream,Void> close(TaskMode mode)
          Returns a task that closes an active connection.
 Task<Stream,Void> close(TaskMode mode, float timeoutInSeconds)
          Returns a task that closes an active connection.
 void connect()
          Establishes a connection to the target defined during the construction of the stream.
 void connect(float timeoutInSeconds)
          Establishes a connection to the target defined during the construction of the stream.
 Task<Stream,Void> connect(TaskMode mode)
          Returns a task that establishes a connection to the target defined during the construction of the stream.
 Task<Stream,Void> connect(TaskMode mode, float timeoutInSeconds)
          Returns a task that establishes a connection to the target defined during the construction of the stream.
 Context getContext()
          Returns the remote authorization info.
 Task<Stream,Context> getContext(TaskMode mode)
          Creates a task that obtains the remote authorization info.
 StreamInputStream getInputStream()
          Obtains an InputStream from the stream.
 Task<Stream,StreamInputStream> getInputStream(TaskMode mode)
          Creates a task that obtains an OutputStream from the stream.
 StreamOutputStream getOutputStream()
          Obtains an OutputStream from the stream.
 Task<Stream,StreamOutputStream> getOutputStream(TaskMode mode)
          Creates a task that obtains an OutputStream from the stream.
 URL getUrl()
          Obtains the URL that was used to create the stream.
 Task<Stream,URL> getUrl(TaskMode mode)
          Creates a task that obtains the URL that was used to create the stream.
 int read(Buffer buffer)
          Reads a raw buffer from the stream.
 int read(Buffer buffer, int len)
          Reads a raw buffer from the stream.
 Task<Stream,Integer> read(TaskMode mode, Buffer buffer)
          Creates a task that reads a raw buffer from the stream.
 Task<Stream,Integer> read(TaskMode mode, Buffer buffer, int len)
          Creates a task that reads a raw buffer from the stream.
 int waitFor(int what)
          Checks if the stream is ready for I/O, or if it has entered the ERROR state.
 int waitFor(int what, float timeoutInSeconds)
          Checks if the stream is ready for I/O, or if it has entered the ERROR state.
 Task<Stream,Integer> waitFor(TaskMode mode, int what)
          Returns a task that checks if the stream is ready for I/O, or if it has entered the ERROR state.
 Task<Stream,Integer> waitFor(TaskMode mode, int what, float timeoutInSeconds)
          Returns a task that checks if the stream is ready for I/O, or if it has entered the ERROR state.
 int write(Buffer buffer)
          Writes a raw buffer to the stream.
 int write(Buffer buffer, int len)
          Writes a raw buffer to the stream.
 Task<Stream,Integer> write(TaskMode mode, Buffer buffer)
          Creates a task that writes a raw buffer to the stream.
 Task<Stream,Integer> write(TaskMode mode, Buffer buffer, int len)
          Creates a task that writes a raw buffer to the stream.
 
Methods inherited from interface org.ogf.saga.SagaObject
clone, getId, getSession
 
Methods inherited from interface org.ogf.saga.attributes.AsyncAttributes
existsAttribute, findAttributes, getAttribute, getVectorAttribute, isReadOnlyAttribute, isRemovableAttribute, isVectorAttribute, isWritableAttribute, listAttributes, removeAttribute, setAttribute, setVectorAttribute
 
Methods inherited from interface org.ogf.saga.attributes.Attributes
existsAttribute, findAttributes, getAttribute, getVectorAttribute, isReadOnlyAttribute, isRemovableAttribute, isVectorAttribute, isWritableAttribute, listAttributes, removeAttribute, setAttribute, setVectorAttribute
 
Methods inherited from interface org.ogf.saga.monitoring.AsyncMonitorable
addCallback, getMetric, listMetrics, removeCallback
 
Methods inherited from interface org.ogf.saga.monitoring.Monitorable
addCallback, getMetric, listMetrics, removeCallback
 

Field Detail

BUFSIZE

static final String BUFSIZE
Attribute name, determines size of send buffer.

See Also:
Constant Field Values

TIMEOUT

static final String TIMEOUT
Attribute name, determines the amount of idle time before dropping the connection, in seconds.

See Also:
Constant Field Values

BLOCKING

static final String BLOCKING
Attribute name, determines if read/writes are blocking or not. If this attribute is not supported, implementation must do blocking.

See Also:
Constant Field Values

COMPRESSION

static final String COMPRESSION
Attribute name, determines if data are compressed before/after transfer.

See Also:
Constant Field Values

NODELAY

static final String NODELAY
Attribute name, determines if packets are sent without delay.

See Also:
Constant Field Values

RELIABLE

static final String RELIABLE
Attribute name, determines if all sent data MUST arrive.

See Also:
Constant Field Values

STREAM_STATE

static final String STREAM_STATE
Metric name, fires if the state of the stream changes, and has the value of the new state.

See Also:
Constant Field Values

STREAM_READ

static final String STREAM_READ
Metric name, fires if the stream gets readable (which means that a subsequent read() can successfully read one or more bytes of data).

See Also:
Constant Field Values

STREAM_WRITE

static final String STREAM_WRITE
Metric name, fires if the stream gets writable (which means that a subsequent write() can successfully write one or more bytes of data).

See Also:
Constant Field Values

STREAM_EXCEPTION

static final String STREAM_EXCEPTION
Metric name, fires if the stream has an error condition.

See Also:
Constant Field Values

STREAM_DROPPED

static final String STREAM_DROPPED
Metric name, fires if the stream gets dropped by the remote party.

See Also:
Constant Field Values
Method Detail

getUrl

URL getUrl()
           throws NotImplementedException,
                  AuthenticationFailedException,
                  AuthorizationFailedException,
                  PermissionDeniedException,
                  IncorrectStateException,
                  TimeoutException,
                  NoSuccessException
Obtains the URL that was used to create the stream. When this stream is the result of a StreamServer.serve() call, null is returned.

Returns:
the URL.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
IncorrectStateException - is thrown when the stream is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

getContext

Context getContext()
                   throws NotImplementedException,
                          AuthenticationFailedException,
                          AuthorizationFailedException,
                          PermissionDeniedException,
                          IncorrectStateException,
                          TimeoutException,
                          NoSuccessException
Returns the remote authorization info. The returned context is deep-copied.

Returns:
the remote context.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
IncorrectStateException - is thrown when the stream is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

connect

void connect()
             throws NotImplementedException,
                    AuthenticationFailedException,
                    AuthorizationFailedException,
                    PermissionDeniedException,
                    IncorrectStateException,
                    TimeoutException,
                    NoSuccessException
Establishes a connection to the target defined during the construction of the stream.

Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
IncorrectStateException - is thrown when the stream is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

connect

void connect(float timeoutInSeconds)
             throws NotImplementedException,
                    AuthenticationFailedException,
                    AuthorizationFailedException,
                    PermissionDeniedException,
                    IncorrectStateException,
                    TimeoutException,
                    NoSuccessException
Establishes a connection to the target defined during the construction of the stream.

Parameters:
timeoutInSeconds - the timeout in seconds.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
IncorrectStateException - is thrown when the stream is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

waitFor

int waitFor(int what)
            throws NotImplementedException,
                   AuthenticationFailedException,
                   AuthorizationFailedException,
                   PermissionDeniedException,
                   IncorrectStateException,
                   NoSuccessException
Checks if the stream is ready for I/O, or if it has entered the ERROR state. It will only check for the specified activities. This method blocks until one or more of the specified activities apply.

Parameters:
what - the activities to wait for.
Returns:
the activities that apply.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
IncorrectStateException - is thrown when the stream is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

waitFor

int waitFor(int what,
            float timeoutInSeconds)
            throws NotImplementedException,
                   AuthenticationFailedException,
                   AuthorizationFailedException,
                   PermissionDeniedException,
                   IncorrectStateException,
                   NoSuccessException
Checks if the stream is ready for I/O, or if it has entered the ERROR state. It will only check for the specified activities. If the timeout expires, an empty list is returned.

Parameters:
what - the activities to wait for.
timeoutInSeconds - the timeout in seconds.
Returns:
the activities that apply.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
IncorrectStateException - is thrown when the stream is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

close

void close()
           throws NotImplementedException,
                  NoSuccessException
Closes an active connection. This method performs a non-blocking close. I/O is no longer possible. The stream is put in state CLOSED.

Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

close

void close(float timeoutInSeconds)
           throws NotImplementedException,
                  NoSuccessException
Closes an active connection. I/O is no longer possible. The stream is put in state CLOSED.

Parameters:
timeoutInSeconds - the timeout in seconds.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

read

int read(Buffer buffer,
         int len)
         throws NotImplementedException,
                AuthenticationFailedException,
                AuthorizationFailedException,
                PermissionDeniedException,
                BadParameterException,
                IncorrectStateException,
                TimeoutException,
                NoSuccessException,
                SagaIOException
Reads a raw buffer from the stream.

Parameters:
len - the maximum number of bytes to be read.
buffer - the buffer to store into.
Returns:
the number of bytes read.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully, or if the file was opened WriteOnly.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
BadParameterException - is thrown if the provided buffer is not large enough to hold the required length.
IncorrectStateException - is thrown when the Stream is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
SagaIOException - is thrown on read failures when the SAGA specifications say that a POSIX error number should be returned (which does not really make sense for Java).

read

int read(Buffer buffer)
         throws NotImplementedException,
                AuthenticationFailedException,
                AuthorizationFailedException,
                PermissionDeniedException,
                BadParameterException,
                IncorrectStateException,
                TimeoutException,
                NoSuccessException,
                SagaIOException
Reads a raw buffer from the stream.

Parameters:
buffer - the buffer to store into.
Returns:
the number of bytes read.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully, or if the file was opened WriteOnly.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
BadParameterException - is thrown if the provided buffer is not large enough to hold the required length.
IncorrectStateException - is thrown when the Stream is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
SagaIOException - is thrown on read failures when the SAGA specifications say that a POSIX error number should be returned (which does not really make sense for Java).

getInputStream

StreamInputStream getInputStream()
                                 throws NotImplementedException,
                                        AuthenticationFailedException,
                                        AuthorizationFailedException,
                                        PermissionDeniedException,
                                        IncorrectStateException,
                                        TimeoutException,
                                        NoSuccessException,
                                        SagaIOException
Obtains an InputStream from the stream.

Returns:
the input stream.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully, or if the file was opened WriteOnly.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
IncorrectStateException - is thrown when the Stream is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
SagaIOException - is thrown on read failures when the SAGA specifications say that a POSIX error number should be returned (which does not really make sense for Java).

write

int write(Buffer buffer,
          int len)
          throws NotImplementedException,
                 AuthenticationFailedException,
                 AuthorizationFailedException,
                 PermissionDeniedException,
                 BadParameterException,
                 IncorrectStateException,
                 TimeoutException,
                 NoSuccessException,
                 SagaIOException
Writes a raw buffer to the stream. Note: if the buffer contains less data than the specified len, only the data in the buffer are written.

Parameters:
len - the number of bytes of data in the buffer.
buffer - the data to be sent.
Returns:
the number of bytes written.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully, or if the file was opened WriteOnly.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
BadParameterException - is thrown if the provided buffer is not large enough to hold the required (specified) length, or no buffer size is available.
IncorrectStateException - is thrown when the Stream is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
SagaIOException - is thrown on read failures when the SAGA specifications say that a POSIX error number should be returned (which does not really make sense for Java).

write

int write(Buffer buffer)
          throws NotImplementedException,
                 AuthenticationFailedException,
                 AuthorizationFailedException,
                 PermissionDeniedException,
                 BadParameterException,
                 IncorrectStateException,
                 TimeoutException,
                 NoSuccessException,
                 SagaIOException
Writes a raw buffer to the stream.

Parameters:
buffer - the data to be sent.
Returns:
the number of bytes written.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully, or if the file was opened WriteOnly.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
BadParameterException - is thrown if the provided buffer is not large enough to hold the required length, or bo buffer size is available.
IncorrectStateException - is thrown when the Stream is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
SagaIOException - is thrown on read failures when the SAGA specifications say that a POSIX error number should be returned (which does not really make sense for Java).

getOutputStream

StreamOutputStream getOutputStream()
                                   throws NotImplementedException,
                                          AuthenticationFailedException,
                                          AuthorizationFailedException,
                                          PermissionDeniedException,
                                          IncorrectStateException,
                                          TimeoutException,
                                          NoSuccessException,
                                          SagaIOException
Obtains an OutputStream from the stream.

Returns:
the output stream.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully, or if the file was opened WriteOnly.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
IncorrectStateException - is thrown when the Stream is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
SagaIOException - is thrown on read failures when the SAGA specifications say that a POSIX error number should be returned (which does not really make sense for Java).

getUrl

Task<Stream,URL> getUrl(TaskMode mode)
                        throws NotImplementedException
Creates a task that obtains the URL that was used to create the stream. When this stream is the result of a StreamServer.serve() call, the URL will be null.

Parameters:
mode - the task mode.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

getContext

Task<Stream,Context> getContext(TaskMode mode)
                                throws NotImplementedException
Creates a task that obtains the remote authorization info. The returned context is deep-copied.

Parameters:
mode - the task mode.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

connect

Task<Stream,Void> connect(TaskMode mode)
                          throws NotImplementedException
Returns a task that establishes a connection to the target defined during the construction of the stream.

Parameters:
mode - the task mode.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

connect

Task<Stream,Void> connect(TaskMode mode,
                          float timeoutInSeconds)
                          throws NotImplementedException
Returns a task that establishes a connection to the target defined during the construction of the stream.

Parameters:
mode - the task mode.
timeoutInSeconds - the timeout in seconds.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

waitFor

Task<Stream,Integer> waitFor(TaskMode mode,
                             int what)
                             throws NotImplementedException
Returns a task that checks if the stream is ready for I/O, or if it has entered the ERROR state. It will only check for the specified activities.

Parameters:
mode - the task mode.
what - the activities to wait for.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

waitFor

Task<Stream,Integer> waitFor(TaskMode mode,
                             int what,
                             float timeoutInSeconds)
                             throws NotImplementedException
Returns a task that checks if the stream is ready for I/O, or if it has entered the ERROR state. It will only check for the specified activities. If the timeout expires, the task will return an empty list.

Parameters:
mode - the task mode.
what - the activities to wait for.
timeoutInSeconds - the timout in seconds.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

close

Task<Stream,Void> close(TaskMode mode)
                        throws NotImplementedException
Returns a task that closes an active connection.

Parameters:
mode - the task mode.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

close

Task<Stream,Void> close(TaskMode mode,
                        float timeoutInSeconds)
                        throws NotImplementedException
Returns a task that closes an active connection.

Parameters:
mode - the task mode.
timeoutInSeconds - the timeout in seconds.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

read

Task<Stream,Integer> read(TaskMode mode,
                          Buffer buffer,
                          int len)
                          throws NotImplementedException
Creates a task that reads a raw buffer from the stream.

Parameters:
mode - the task mode.
len - the maximum number of bytes to be read.
buffer - the buffer to store into.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

read

Task<Stream,Integer> read(TaskMode mode,
                          Buffer buffer)
                          throws NotImplementedException
Creates a task that reads a raw buffer from the stream.

Parameters:
mode - the task mode.
buffer - the buffer to store into.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

getInputStream

Task<Stream,StreamInputStream> getInputStream(TaskMode mode)
                                              throws NotImplementedException
Creates a task that obtains an OutputStream from the stream.

Parameters:
mode - the task mode.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

write

Task<Stream,Integer> write(TaskMode mode,
                           Buffer buffer,
                           int len)
                           throws NotImplementedException
Creates a task that writes a raw buffer to the stream. Note: if the buffer contains less data than the specified len, only the data in the buffer are written.

Parameters:
mode - the task mode.
len - the number of bytes of data in the buffer.
buffer - the data to be sent.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

write

Task<Stream,Integer> write(TaskMode mode,
                           Buffer buffer)
                           throws NotImplementedException
Creates a task that writes a raw buffer to the stream.

Parameters:
mode - the task mode.
buffer - the data to be sent.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

getOutputStream

Task<Stream,StreamOutputStream> getOutputStream(TaskMode mode)
                                                throws NotImplementedException
Creates a task that obtains an OutputStream from the stream.

Parameters:
mode - the task mode.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.


Copyright © 2014 Open Grid Forum. All rights reserved.