|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gzz.mediaserver.MultiplexingMediaserver
A mediaserver channeling all requests through to other mediaservers. One of the servers is a fallback, others are either read-only or read-write. Fallback is used to write all data that isn't written elsewhere, eg. new slices and pointers to nonexistent blocks. Otherwise data is written to all the servers that contain an associated block.
Nested Class Summary |
Nested classes inherited from class gzz.mediaserver.Mediaserver |
Mediaserver.Id, Mediaserver.InvalidID |
Constructor Summary | |
MultiplexingMediaserver(Mediaserver fb,
Mediaserver ro)
|
|
MultiplexingMediaserver(Mediaserver fb,
Mediaserver[] ro,
Mediaserver[] rw)
|
Method Summary | |
Mediaserver.Id |
addDatum(byte[] data,
java.util.Collection headerLines,
Mediaserver.Id assocId,
boolean addDefaultHeaders)
Add a new datum, explicitly giving a collection of header lines. |
Mediaserver.Id |
addDatum(byte[] data,
java.lang.String contentType)
Creates a new block (to the fallback pool) |
Mediaserver.Id |
addDatum(byte[] data,
java.lang.String contentType,
Mediaserver.Id assocId)
Creates a new block associated with some previous block. |
void |
cache(MediaserverBlock b)
Cache a mediaserver block. |
void |
expungeDatum(Mediaserver.Id id)
Permanently remove a block. |
MediaserverBlock |
getDatum(Mediaserver.Id id)
Get the datum corresponding to the given id. |
java.util.Set |
getDiffsFrom(Mediaserver.Id id)
|
java.util.Set |
getDiffsTo(Mediaserver.Id id)
|
java.util.Set |
getIDs()
Get a set of the IDs of all entries in the Mediaserver database. |
Mediaserver.Id |
getPointer(java.lang.String s)
(Kludge) Get a String-identified pointer local to this mediaserver. |
java.util.Set |
getPointers()
(Kludge) Get the names of all String-identified pointers local to this mediaserver. |
PointerSet |
getPointerSet(java.lang.String s)
|
java.lang.String |
getPoolName()
Get the name of the pool this mediaserver stores. |
void |
setPointer(java.lang.String s,
Mediaserver.Id id)
(Kludge) Set a String-identified pointer local to this mediaserver. |
void |
setPointer(java.lang.String s,
Mediaserver.Id id,
Mediaserver.Id obsolete)
|
void |
setPointer(java.lang.String s,
Mediaserver.Id id,
java.util.Set obsoletes)
|
void |
setPoolName(java.lang.String s)
Set the name of the pool this mediaserver stores. |
void |
storeDatum(Mediaserver.Id id,
byte[] data)
Store an existing datum under a given ID. |
void |
uncache(MediaserverBlock b)
Uncache a mediaserver block. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MultiplexingMediaserver(Mediaserver fb, Mediaserver[] ro, Mediaserver[] rw)
fb
- fallback storage pool, read-write, fallback for writesro
- read-only storage poolsrw
- read-write storage poolspublic MultiplexingMediaserver(Mediaserver fb, Mediaserver ro)
Method Detail |
public java.lang.String getPoolName() throws java.io.IOException
getPoolName
in interface Mediaserver
java.io.IOException
public void setPoolName(java.lang.String s) throws java.io.IOException
setPoolName
in interface Mediaserver
java.io.IOException
public java.util.Set getIDs() throws java.io.IOException
Mediaserver
getIDs
in interface Mediaserver
java.io.IOException
public MediaserverBlock getDatum(Mediaserver.Id id) throws java.io.IOException
Mediaserver
getDatum
in interface Mediaserver
java.io.IOException
public Mediaserver.Id addDatum(byte[] data, java.lang.String contentType) throws java.io.IOException
addDatum
in interface Mediaserver
java.io.IOException
public Mediaserver.Id addDatum(byte[] data, java.lang.String contentType, Mediaserver.Id assocId) throws java.io.IOException
addDatum
in interface Mediaserver
java.io.IOException
public Mediaserver.Id addDatum(byte[] data, java.util.Collection headerLines, Mediaserver.Id assocId, boolean addDefaultHeaders) throws java.io.IOException
Mediaserver
addDatum
in interface Mediaserver
assocId
- May be null
.addDefaultHeaders
- Whether to also add the default header
lines: "Content-Transfer-Encoding: binary",
"X-Injector: ...", and "Date: ...".
java.io.IOException
public void storeDatum(Mediaserver.Id id, byte[] data) throws java.io.IOException
Mediaserver
storeDatum
in interface Mediaserver
data
- the pure data block obtained from another mediaserver,
containing all header information etc.
java.io.IOException
public void expungeDatum(Mediaserver.Id id) throws java.io.IOException
Mediaserver
expungeDatum
in interface Mediaserver
java.io.IOException
public void cache(MediaserverBlock b)
Mediaserver
cache
in interface Mediaserver
public void uncache(MediaserverBlock b)
Mediaserver
uncache
in interface Mediaserver
public Mediaserver.Id getPointer(java.lang.String s) throws java.io.IOException
Mediaserver
null
if the pointer is not yet set.
getPointer
in interface Mediaserver
java.io.IOException
setPointer
public java.util.Set getPointers() throws java.io.IOException
Mediaserver
getPointers
in interface Mediaserver
java.io.IOException
public PointerSet getPointerSet(java.lang.String s) throws java.io.IOException
getPointerSet
in interface Mediaserver
java.io.IOException
public void setPointer(java.lang.String s, Mediaserver.Id id) throws java.io.IOException
Mediaserver
XXX THIS EXPLANATION IS OUTDATED! Explain the new pointer system!
setPointer
in interface Mediaserver
java.io.IOException
public void setPointer(java.lang.String s, Mediaserver.Id id, Mediaserver.Id obsolete) throws java.io.IOException
setPointer
in interface Mediaserver
java.io.IOException
public void setPointer(java.lang.String s, Mediaserver.Id id, java.util.Set obsoletes) throws java.io.IOException
java.io.IOException
public java.util.Set getDiffsFrom(Mediaserver.Id id) throws java.io.IOException
getDiffsFrom
in interface Mediaserver
java.io.IOException
public java.util.Set getDiffsTo(Mediaserver.Id id) throws java.io.IOException
getDiffsTo
in interface Mediaserver
java.io.IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |