org.ogf.saga.stream
Interface StreamServer

All Superinterfaces:
Async, AsyncMonitorable<StreamServer>, Cloneable, Monitorable, Permissions<StreamServer>, SagaObject

public interface StreamServer
extends SagaObject, Async, AsyncMonitorable<StreamServer>, Permissions<StreamServer>

A StreamServer object represents an endpoint for a listening/server object that waits for client connections.


Field Summary
static String STREAMSERVER_CLIENTCONNECT
          Metric name, fires if a client connects.
 
Fields inherited from interface org.ogf.saga.SagaObject
NO_WAIT, WAIT_FOREVER
 
Method Summary
 void close()
          Closes a stream server.
 void close(float timeoutInSeconds)
          Closes a stream server.
 Task<StreamServer,Void> close(TaskMode mode)
          Obtains a task that closes a stream server.
 Task<StreamServer,Void> close(TaskMode mode, float timeoutInSeconds)
          Obtains a task that closes a stream server.
 Stream connect()
          Establishes a connection to the stream server.
 Stream connect(float timeoutInSeconds)
          Establishes a connection to the stream server.
 Task<StreamServer,Stream> connect(TaskMode mode)
          Returns a task that establishes a connection to the stream server.
 Task<StreamServer,Stream> connect(TaskMode mode, float timeoutInSeconds)
          Returns a task that establishes a connection to the stream server.
 URL getUrl()
          Obtains the URL to be used to connect to this server.
 Task<StreamServer,URL> getUrl(TaskMode mode)
          Obtains a task to obtain the URL to be used to connect to this server.
 Stream serve()
          Waits for incoming client connections (like an accept of a serversocket).
 Stream serve(float timeoutInSeconds)
          Waits for incoming client connections (like an accept of a serversocket).
 Task<StreamServer,Stream> serve(TaskMode mode)
          Obtains a task that waits for incoming client connections (like an accept of a serversocket).
 Task<StreamServer,Stream> serve(TaskMode mode, float timeoutInSeconds)
          Obtains a task that waits for incoming client connections (like an accept of a serversocket).
 
Methods inherited from interface org.ogf.saga.SagaObject
clone, getId, getSession
 
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
 
Methods inherited from interface org.ogf.saga.permissions.Permissions
getGroup, getGroup, getOwner, getOwner, permissionsAllow, permissionsAllow, permissionsCheck, permissionsCheck, permissionsDeny, permissionsDeny
 

Field Detail

STREAMSERVER_CLIENTCONNECT

static final String STREAMSERVER_CLIENTCONNECT
Metric name, fires if a client connects.

See Also:
Constant Field Values
Method Detail

getUrl

URL getUrl()
           throws NotImplementedException,
                  AuthenticationFailedException,
                  AuthorizationFailedException,
                  PermissionDeniedException,
                  IncorrectStateException,
                  TimeoutException,
                  NoSuccessException
Obtains the URL to be used to connect to this server.

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 server is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

serve

Stream serve()
             throws NotImplementedException,
                    AuthenticationFailedException,
                    AuthorizationFailedException,
                    PermissionDeniedException,
                    IncorrectStateException,
                    TimeoutException,
                    NoSuccessException
Waits for incoming client connections (like an accept of a serversocket). The returned stream is in OPEN state. This call may block indefinitely.

Returns:
the client connection.
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 server is already closed.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

connect

Stream connect()
               throws NotImplementedException,
                      AuthenticationFailedException,
                      AuthorizationFailedException,
                      PermissionDeniedException,
                      IncorrectStateException,
                      TimeoutException,
                      NoSuccessException
Establishes a connection to the stream server.

Returns:
the resulting 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

Stream connect(float timeoutInSeconds)
               throws NotImplementedException,
                      AuthenticationFailedException,
                      AuthorizationFailedException,
                      PermissionDeniedException,
                      IncorrectStateException,
                      TimeoutException,
                      NoSuccessException
Establishes a connection to the stream server.

Parameters:
timeoutInSeconds - the timeout in seconds.
Returns:
the resulting 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.

serve

Stream serve(float timeoutInSeconds)
             throws NotImplementedException,
                    AuthenticationFailedException,
                    AuthorizationFailedException,
                    PermissionDeniedException,
                    IncorrectStateException,
                    TimeoutException,
                    NoSuccessException
Waits for incoming client connections (like an accept of a serversocket). The returned stream is in OPEN state.

Parameters:
timeoutInSeconds - the timeout in seconds.
Returns:
the client connection, or null if the timeout expires before a client connects.
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 server 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 a stream server. This is a non-blocking call.

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 a stream server.

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.

getUrl

Task<StreamServer,URL> getUrl(TaskMode mode)
                              throws NotImplementedException
Obtains a task to obtain the URL to be used to connect to this server.

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

serve

Task<StreamServer,Stream> serve(TaskMode mode)
                                throws NotImplementedException
Obtains a task that waits for incoming client connections (like an accept of a serversocket). The returned stream is in OPEN state.

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

serve

Task<StreamServer,Stream> serve(TaskMode mode,
                                float timeoutInSeconds)
                                throws NotImplementedException
Obtains a task that waits for incoming client connections (like an accept of a serversocket). The returned stream is in OPEN state.

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.

connect

Task<StreamServer,Stream> connect(TaskMode mode)
                                  throws NotImplementedException
Returns a task that establishes a connection to the stream server.

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

connect

Task<StreamServer,Stream> connect(TaskMode mode,
                                  float timeoutInSeconds)
                                  throws NotImplementedException
Returns a task that establishes a connection to the stream server.

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.

close

Task<StreamServer,Void> close(TaskMode mode)
                              throws NotImplementedException
Obtains a task that closes a stream server.

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

close

Task<StreamServer,Void> close(TaskMode mode,
                              float timeoutInSeconds)
                              throws NotImplementedException
Obtains a task that closes a stream server.

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.


Copyright © 2014 Open Grid Forum. All rights reserved.