|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface SimpleExhibitPipelineIF
Simple interface implemented by several stages in the Web exhibit-handling pipeline. In particular, the on-disc exhibit-data cache and backend datasource adaptors implement this.
The pipeline stages that implement this may well implement other interfaces in parallel to provide richer and more efficient cacheing, etc.
As this is in effect handling a stream of I/O on its way to a browser, IOException seems the natural way to signal errors.
We may make implementers of this interface Serializable so as to allow them to be persisted in servlet context for robustness and distribution, but making copies through this mechanism will upset the ability to fully track usage and efficiently share caches, etc.
Note that this extends the variable-handling pipeline interface, ie data pipelines also handle system variables.
Note that transient errors (eg caused by temporary resource shortage/congestion) and indicated by InterruptedIOException being thrown, and may indicate that a retry soon may be successful.
| Nested Class Summary | |
|---|---|
static class |
SimpleExhibitPipelineIF.PropsKey
Class that holds key to Properties lookup/fetch. |
| Field Summary | |
|---|---|
static int |
MAX_USER_READ_SIZE
Maximum exhibit user-driven I/O data transfer request in bytes; strictly positive. |
| Method Summary | |
|---|---|
void |
destroy()
Shut down the data pipeline. |
AllExhibitImmutableData |
getAllExhibitImmutableData(long oldStamp)
Gets set of all static exhibit data if its timestamp is not that specified. |
AllExhibitProperties |
getAllExhibitProperties(long oldHash)
Gets set of all exhibit properties if its hash is not that specified; never null for -1 argument. |
GenProps |
getGenProps(long oldStamp)
Gets the general properties as a GenProps object if its timestamp is not that specified; never null for -1 argument. |
java.util.Properties |
getGenSecProps(long oldStamp)
Deprecated. Use getProperties() for new code. |
java.util.Properties |
getProperties(SimpleExhibitPipelineIF.PropsKey key,
long versionID)
Get requested Properties selected by key and versionID. |
void |
getRawFile(java.nio.ByteBuffer buf,
Name.ExhibitFull exhibitName,
int position,
boolean dontCache)
Read a chunk of the raw exhibit binary into the given buffer. |
ExhibitStaticAttr |
getStaticAttr(Name.ExhibitFull name)
Get the static attributes for a given exhibit. |
Stratum |
getStratum()
Gets information about our stratum and upstream server; never null. |
ExhibitThumbnails |
getThumbnails(Name.ExhibitFull name,
boolean create)
Gets the thumbnails for an exhibit. |
void |
poll(GenProps gp)
Poll periodically (of the order of seconds) to do background work. |
| Methods inherited from interface org.hd.d.pg2k.svrCore.vars.SimpleVariablePipelineIF |
|---|
syncVariables |
| Methods inherited from interface org.hd.d.pg2k.svrCore.vars.BasicVarMgrInterface |
|---|
getEventValue, getEventValues, getVariable, getVariables, setVariable, setVariables |
| Field Detail |
|---|
static final int MAX_USER_READ_SIZE
Some operations that request transfers larger than this (and where the caller has control of the size of the request), eg reading raw data from an exhibit, may be rejected with an IOException.
Note that this does not limit the return of large data items (eg AllExhibitProperties) whose size is not controlled by the caller.
This helps prevent denial-of-service by a faulty/malicious client.
A power of two for efficiency in various places.
A size of many times BULK_DATA_TRANSFER_SIZE to a few mBytes is probably reasonable.
| Method Detail |
|---|
ExhibitStaticAttr getStaticAttr(Name.ExhibitFull name)
throws java.io.IOException
java.io.IOException - if the operation cannot be completed due to I/O
restrictions or failure
void getRawFile(java.nio.ByteBuffer buf,
Name.ExhibitFull exhibitName,
int position,
boolean dontCache)
throws java.io.IOException
buf - the buffer into which to read the data;
must be non-null, in put()able state,
and with remaining capacity of at least the requested number of bytesexhibitName - the full name of the exhibit to read from;
never null and must be syntactically validposition - position/index of first byte in exhibitFile to read;
non-negativedontCache - if true, this is a hint not to attempt to cache this
or displace anything from extant caches for this data
as it may for example be precaching or random activity;
by default callers should leave this false to allow cacheing
java.lang.IllegalArgumentException - for invalid arguments such as
a null or syntactically-invalid name,
a negative position or excessive number of requested bytes,
a negative (or in some cases, non-positive) len
java.io.IOException - for requests that cannot be fulfilled because of
I/O restrictions or problems, such as link failure or
an upper bound on the length of a request
AllExhibitImmutableData getAllExhibitImmutableData(long oldStamp)
throws java.io.IOException
If no exhibits are currently installed a default set with a zero timestamp is returned.
If the caller's copy appears to be up-to-date (eg the oldStamp matches that that would have been returned) null is returned.
java.io.IOException - if the operation cannot be completed due to I/O
restrictions or failure
AllExhibitProperties getAllExhibitProperties(long oldHash)
throws java.io.IOException
If no exhibits are currently installed a default set with a zero timestamp is returned.
If the caller's copy appears to be up-to-date (eg the oldHash matches that that would have been returned) null is returned.
java.io.IOException - if the operation cannot be completed due to I/O
restrictions or failure
GenProps getGenProps(long oldStamp)
throws java.io.IOException
If no props are currently installed/available a default set with a zero timestamp is returned.
If the caller's copy appears to be up-to-date (eg the oldStamp matches that that would have been returned) null is returned.
java.io.IOException - if the operation cannot be completed due to I/O
restrictions or failure
@Deprecated
java.util.Properties getGenSecProps(long oldStamp)
throws java.io.IOException
If no props are currently installed/available a default set with a zero timestamp is returned.
If the caller's copy appears to be up-to-date (eg the oldStamp matches that that would have been returned) null is returned.
java.io.IOException - if the operation cannot be completed due to I/O
restrictions or failure
ExhibitThumbnails getThumbnails(Name.ExhibitFull name,
boolean create)
throws java.io.IOException
create - if true, and no thumbnail yet exists, try to
create one if possible, else if create is false
only return an existing one and return null if none is to hand
java.io.IOException - if the operation cannot be completed due to I/O
restrictions or failure
java.util.Properties getProperties(SimpleExhibitPipelineIF.PropsKey key,
long versionID)
throws java.io.IOException
key - selector (with possible embedded sub-key)
for desired properties set; never nullversionID - if -1 then map is always returned if available,
else must be non-negative and null is returned if the versionID
presented matches that of the current version
(ie if the caller has presumably got the up-to-date version);
may be a timestamp or a hash or other value,
and by convention is zero only for an empty properties set
java.io.IOException
Stratum getStratum()
throws java.io.IOException
java.io.IOException
void poll(GenProps gp)
throws java.io.IOException
java.io.IOException - in case of difficulty, but even if a sub-ordinate
call throws IOException then poll() call should continue
to do as much of its remaining work as reasonably possiblevoid destroy()
|
DHD Multimedia Gallery V1.60.69 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||