|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface 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 |
---|
static final String BUFSIZE
static final String TIMEOUT
static final String BLOCKING
static final String COMPRESSION
static final String NODELAY
static final String RELIABLE
static final String STREAM_STATE
static final String STREAM_READ
static final String STREAM_WRITE
static final String STREAM_EXCEPTION
static final String STREAM_DROPPED
Method Detail |
---|
URL getUrl() throws NotImplementedException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, IncorrectStateException, TimeoutException, NoSuccessException
StreamServer.serve()
call, null
is returned.
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.Context getContext() throws NotImplementedException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, IncorrectStateException, TimeoutException, NoSuccessException
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.void connect() throws NotImplementedException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, IncorrectStateException, TimeoutException, NoSuccessException
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.void connect(float timeoutInSeconds) throws NotImplementedException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, IncorrectStateException, TimeoutException, NoSuccessException
timeoutInSeconds
- the timeout in seconds.
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.int waitFor(int what) throws NotImplementedException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, IncorrectStateException, NoSuccessException
what
- the activities to wait for.
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.int waitFor(int what, float timeoutInSeconds) throws NotImplementedException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, IncorrectStateException, NoSuccessException
what
- the activities to wait for.timeoutInSeconds
- the timeout in seconds.
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.void close() throws NotImplementedException, NoSuccessException
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.void close(float timeoutInSeconds) throws NotImplementedException, NoSuccessException
timeoutInSeconds
- the timeout in seconds.
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.int read(Buffer buffer, int len) throws NotImplementedException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, TimeoutException, NoSuccessException, SagaIOException
len
- the maximum number of bytes to be read.buffer
- the buffer to store into.
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).int read(Buffer buffer) throws NotImplementedException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, TimeoutException, NoSuccessException, SagaIOException
buffer
- the buffer to store into.
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).StreamInputStream getInputStream() throws NotImplementedException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, IncorrectStateException, TimeoutException, NoSuccessException, SagaIOException
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).int write(Buffer buffer, int len) throws NotImplementedException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, TimeoutException, NoSuccessException, SagaIOException
len
- the number of bytes of data in the buffer.buffer
- the data to be sent.
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).int write(Buffer buffer) throws NotImplementedException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, TimeoutException, NoSuccessException, SagaIOException
buffer
- the data to be sent.
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).StreamOutputStream getOutputStream() throws NotImplementedException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, IncorrectStateException, TimeoutException, NoSuccessException, SagaIOException
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).Task<Stream,URL> getUrl(TaskMode mode) throws NotImplementedException
StreamServer.serve()
call,
the URL will be null
.
mode
- the task mode.
NotImplementedException
- is thrown when the task version of this method is not
implemented.Task<Stream,Context> getContext(TaskMode mode) throws NotImplementedException
mode
- the task mode.
NotImplementedException
- is thrown when the task version of this method is not
implemented.Task<Stream,Void> connect(TaskMode mode) throws NotImplementedException
mode
- the task mode.
NotImplementedException
- is thrown when the task version of this method is not
implemented.Task<Stream,Void> connect(TaskMode mode, float timeoutInSeconds) throws NotImplementedException
mode
- the task mode.timeoutInSeconds
- the timeout in seconds.
NotImplementedException
- is thrown when the task version of this method is not
implemented.Task<Stream,Integer> waitFor(TaskMode mode, int what) throws NotImplementedException
mode
- the task mode.what
- the activities to wait for.
NotImplementedException
- is thrown when the task version of this method is not
implemented.Task<Stream,Integer> waitFor(TaskMode mode, int what, float timeoutInSeconds) throws NotImplementedException
mode
- the task mode.what
- the activities to wait for.timeoutInSeconds
- the timout in seconds.
NotImplementedException
- is thrown when the task version of this method is not
implemented.Task<Stream,Void> close(TaskMode mode) throws NotImplementedException
mode
- the task mode.
NotImplementedException
- is thrown when the task version of this method is not
implemented.Task<Stream,Void> close(TaskMode mode, float timeoutInSeconds) throws NotImplementedException
mode
- the task mode.timeoutInSeconds
- the timeout in seconds.
NotImplementedException
- is thrown when the task version of this method is not
implemented.Task<Stream,Integer> read(TaskMode mode, Buffer buffer, int len) throws NotImplementedException
mode
- the task mode.len
- the maximum number of bytes to be read.buffer
- the buffer to store into.
NotImplementedException
- is thrown when the task version of this method is not
implemented.Task<Stream,Integer> read(TaskMode mode, Buffer buffer) throws NotImplementedException
mode
- the task mode.buffer
- the buffer to store into.
NotImplementedException
- is thrown when the task version of this method is not
implemented.Task<Stream,StreamInputStream> getInputStream(TaskMode mode) throws NotImplementedException
mode
- the task mode.
NotImplementedException
- is thrown when the task version of this method is not
implemented.Task<Stream,Integer> write(TaskMode mode, Buffer buffer, int len) throws NotImplementedException
mode
- the task mode.len
- the number of bytes of data in the buffer.buffer
- the data to be sent.
NotImplementedException
- is thrown when the task version of this method is not
implemented.Task<Stream,Integer> write(TaskMode mode, Buffer buffer) throws NotImplementedException
mode
- the task mode.buffer
- the data to be sent.
NotImplementedException
- is thrown when the task version of this method is not
implemented.Task<Stream,StreamOutputStream> getOutputStream(TaskMode mode) throws NotImplementedException
mode
- the task mode.
NotImplementedException
- is thrown when the task version of this method is not
implemented.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |