public interface ITrustedLocator extends ILocator
ILocator guarantees that a change to its physical resource while
its is used by application code will be detected or healed.
This behavior is for example important for an application creating a signature for a document, where it is crucial that no one will change the data to be signed while the user verifies and accepts the original version.
An ITrustedLocator guarantess that
OutputStream or
IRandomAccess acquired from this ITrustedLocator, the new
data stream will become valid at least after a "close" or "flush" operation.
After the data is written to the physical resource it will contain exactly
the new data where changed and exactly the old data where not. Otherwise the
write will fail. Subsequent input stream will read the new data as described
above.ITrustedLocator is free to implement "checkpoint" in a more
performant way.| Modifier and Type | Method and Description |
|---|---|
void |
checkpoint()
Make sure current state of the resource is still the same as seen with
last "checkpoint".
|
void |
ensureEqual(ILocator locator)
Check if
locator references data that is equal to the
one referenced by this. |
delete, exists, getChild, getFullName, getInputStream, getLength, getLocalName, getOutputStream, getParent, getRandomAccess, getReader, getReader, getType, getTypedName, getWriter, getWriter, isDirectory, isReadOnly, listLocators, rename, setReadOnly, toURLisOutOfSynch, synchvoid checkpoint()
throws IOException
Most likely the ITrustedLocator will take a hash value here which
it uses to compare when a physical access is made later. Be sure to
understand the documentation on the measures taken by a concrete
implementation as this is crucial for security level and performance.
IOExceptionvoid ensureEqual(ILocator locator) throws IOException
locator references data that is equal to the
one referenced by this.locator - The ILocator to the data to be checked against this.IOExceptionCopyright © 2013 intarsys consulting GmbH. All Rights Reserved.