Package com.levigo.jadice.server.core
Interface StreamResolver
-
- All Known Implementing Classes:
HierarchyResolver
public interface StreamResolver
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Stream
getStream(String cid)
Retrieve the correspondingStream
by its stream identifier - here the cid (Content-ID).List<Stream>
getUnusedStreams()
Retrieve all streams that were not used so far.boolean
markUnused(String cid)
Mark aStream
as being unused and reset it to an unused state.
-
-
-
Method Detail
-
getStream
Stream getStream(String cid) throws IOException
Retrieve the correspondingStream
by its stream identifier - here the cid (Content-ID).- Parameters:
cid
- the Content-ID that identifies theStream
that shall be retrieved.- Returns:
- the correspondig
Stream
. - Throws:
IOException
- if reading a stream failed.
-
getUnusedStreams
List<Stream> getUnusedStreams() throws IOException
Retrieve all streams that were not used so far. Per definition, these streams are regarded when this method was called- Returns:
- unused streams
- Throws:
IOException
- in case of I/O errors
-
markUnused
boolean markUnused(String cid)
Mark aStream
as being unused and reset it to an unused state. This method can only be used once to add theStream
to the unused streams collection. In subsequent invocations it will only return if marking theStream
as unused succeeded once but will not add it to the collection of unused streams again.
-
-