public interface RepositoryHttpEndpoint
RepositoryItem.createRepositoryHttpPlayer()
or RepositoryItem.createRepositoryHttpRecorder()
within the repository item that want to
be played or recorded.Modifier and Type | Method and Description |
---|---|
void |
addSessionErrorListener(RepositoryHttpEventListener<HttpSessionErrorEvent> listener)
|
void |
addSessionStartedListener(RepositoryHttpEventListener<HttpSessionStartedEvent> listener)
|
void |
addSessionTerminatedListener(RepositoryHttpEventListener<HttpSessionTerminatedEvent> listener)
|
java.io.InputStream |
createRepoItemInputStream()
Returns a new
InputStream on each invocation. |
long |
getAutoTerminationTimeout()
Gets the current auto-termination timeout.
|
java.lang.String |
getDispatchURL()
Returns the URL to play (download) or record (upload) the content for the
RepositoryItem . |
java.io.OutputStream |
getRepoItemOutputStream()
Returns the
OutputStream associated with this RepositoryHttpEndpoint . |
RepositoryItem |
getRepositoryItem()
Returns the associated repository item of this
RepositoryHttpEndpoint . |
java.lang.String |
getURL()
Returns the URL to play (download) or record (upload) the content for the
RepositoryItem . |
void |
setAutoTerminationTimeout(long timeoutInMillis)
Sets the time of inactivity to auto-terminate this element.
|
void |
stop()
This method is called to finish the current session.
|
java.lang.String getURL()
RepositoryItem
. When the first client connect to this URL, the
HttpSessionStartedEvent
will be fired to registered listeners.java.lang.String getDispatchURL()
RepositoryItem
. This URL is relative to the context URL of this app. The URL can be
used to dispatch a request with
getRequestDispatcher
. When the first client connect to this URL, the
HttpSessionStartedEvent
will be fired to registered listeners.void addSessionStartedListener(RepositoryHttpEventListener<HttpSessionStartedEvent> listener)
RepositoryHttpEventListener
< HttpSessionStartedEvent
> to this
RepositoryHttpEndpoint
. When the media is requested, a HttpSessionStartedEvent
will be fired to all registered listeners and the method
onEvent
will be
invoked.listener
- the listenervoid addSessionTerminatedListener(RepositoryHttpEventListener<HttpSessionTerminatedEvent> listener)
RepositoryHttpEventListener
< HttpSessionTerminatedEvent
> to this
RepositoryHttpEndpoint
. When the stop()
method is
invoked or a configurable inactivity time is reached (configurable using
setAutoTerminationTimeout(long)
) a HttpSessionTerminatedEvent
will be fired to
all registered listeners and the method
onEvent
will be
invoked.listener
- the listenervoid addSessionErrorListener(RepositoryHttpEventListener<HttpSessionErrorEvent> listener)
RepositoryHttpEventListener
< HttpSessionErrorEvent
> to this
RepositoryHttpEndpoint
. When an error is produced reading or writing the media from/to
repository a HttpSessionErrorEvent
will be fired to all registered listeners and the
method onEvent
will be
invoked.listener
- the listenervoid stop()
HttpSessionTerminatedEvent
is fired to registered listeners.RepositoryItem getRepositoryItem()
RepositoryHttpEndpoint
.java.io.InputStream createRepoItemInputStream()
InputStream
on each invocation. It is legal to read from multiple threads
to the same repositoryItem. The returned InputStream
fully supports skip. The receiver
of the InputStream
is responsible for closing it after its use.java.io.OutputStream getRepoItemOutputStream()
OutputStream
associated with this RepositoryHttpEndpoint
. The first
time, the OutputStream
is created and the next times the same OutputStream
is
returned. The returned OutputStream
is not designed to be used concurrently from
several threads. The OutputStream
is closed when the
stop()
is invoked or the timeout
getAutoTerminationTimeout()
is reached.void setAutoTerminationTimeout(long timeoutInMillis)
long getAutoTerminationTimeout()
setAutoTerminationTimeout(long)