public abstract class AbstractRepositoryItem extends java.lang.Object implements RepositoryItem
RepositoryItem.State
Modifier and Type | Field and Description |
---|---|
protected RepositoryItemAttributes |
attributes |
protected java.lang.String |
id |
protected java.util.Map<java.lang.String,java.lang.String> |
metadata |
protected RepositoryWithHttp |
repository |
protected RepositoryItem.State |
state |
Constructor and Description |
---|
AbstractRepositoryItem(java.lang.String id,
RepositoryItem.State state,
RepositoryItemAttributes attributes,
RepositoryWithHttp repository) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkState(RepositoryItem.State desiredState) |
RepositoryHttpPlayer |
createRepositoryHttpPlayer()
Returns the
RepositoryHttpPlayer to download the contents of the item using http
protocol. |
RepositoryHttpPlayer |
createRepositoryHttpPlayer(java.lang.String sessionIdInUrl)
Returns the
RepositoryHttpPlayer to download the contents of the item using http
protocol. |
RepositoryHttpRecorder |
createRepositoryHttpRecorder()
Returns the
RepositoryHttpRecorder to upload the contents of the item using http
protocol. |
RepositoryHttpRecorder |
createRepositoryHttpRecorder(java.lang.String sessionIdInUrl)
Returns the
RepositoryHttpRecorder to upload the contents of the item using http
protocol. |
RepositoryItemAttributes |
getAttributes()
Returns the attributes associated with this
RepositoryItem . |
java.lang.String |
getId() |
java.util.Map<java.lang.String,java.lang.String> |
getMetadata() |
RepositoryItem.State |
getState()
Returns the state of the RepositoryItem.
|
void |
putMetadataEntry(java.lang.String key,
java.lang.String value) |
void |
setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createInputStreamToRead, createOutputStreamToWrite
protected RepositoryWithHttp repository
protected java.lang.String id
protected volatile RepositoryItem.State state
protected RepositoryItemAttributes attributes
protected java.util.Map<java.lang.String,java.lang.String> metadata
public AbstractRepositoryItem(java.lang.String id, RepositoryItem.State state, RepositoryItemAttributes attributes, RepositoryWithHttp repository)
public java.lang.String getId()
getId
in interface RepositoryItem
public RepositoryItem.State getState()
RepositoryItem
getState
in interface RepositoryItem
protected void checkState(RepositoryItem.State desiredState)
public RepositoryHttpPlayer createRepositoryHttpPlayer()
RepositoryItem
RepositoryHttpPlayer
to download the contents of the item using http
protocol. This operation is only valid when the item is in STORED
state.createRepositoryHttpPlayer
in interface RepositoryItem
public RepositoryHttpPlayer createRepositoryHttpPlayer(java.lang.String sessionIdInUrl)
RepositoryItem
RepositoryHttpPlayer
to download the contents of the item using http
protocol. This operation is only valid when the item is in STORED
state. The parameter sessionIdInURL
allows to specify the sessionId of this player used to construct the URL. The
complete URL of the player can be obtained using the RepositoryHttpEndpoint.getURL()
in
the returned object.createRepositoryHttpPlayer
in interface RepositoryItem
sessionIdInUrl
- The sessionId of this player used to construct the URL.public RepositoryHttpRecorder createRepositoryHttpRecorder()
RepositoryItem
RepositoryHttpRecorder
to upload the contents of the item using http
protocol. This operation is only valid when the item is in NEW state. When the element is used
using the provided URL, the state of the item is changed to STORING
.createRepositoryHttpRecorder
in interface RepositoryItem
public RepositoryHttpRecorder createRepositoryHttpRecorder(java.lang.String sessionIdInUrl)
RepositoryItem
RepositoryHttpRecorder
to upload the contents of the item using http
protocol. This operation is only valid when the item is in NEW state. When the element is used
using the provided URL, the state of the item is changed to STORING
. The parameter sessionIdInURL
allows to specify the sessionId of this recorder
used to construct the URL. The complete URL of the recorder can be obtained using the
RepositoryHttpEndpoint.getURL()
in the returned object.createRepositoryHttpRecorder
in interface RepositoryItem
sessionIdInUrl
- The sessionId of this player used to construct the URL.public RepositoryItemAttributes getAttributes()
RepositoryItem
RepositoryItem
. This attributes are used
mainly when serving this item by means of http endpoint.getAttributes
in interface RepositoryItem
public java.util.Map<java.lang.String,java.lang.String> getMetadata()
getMetadata
in interface RepositoryItem
public void setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
setMetadata
in interface RepositoryItem
public void putMetadataEntry(java.lang.String key, java.lang.String value)
putMetadataEntry
in interface RepositoryItem