public interface ResourceManager
URI
.
For each set of resources the accompanying PathFinder
will be set on the ResourceManager.
See setPathFinder(PathFinder)
NormURI.normalize(URI)
Modifier and Type | Method and Description |
---|---|
boolean |
create(URI normalizedURI)
Create the resource that is identified by the given
normalizedURI . |
boolean |
delete(URI normalizedURI)
Delete or remove the resource that is identified by the given
normalizedURI . |
boolean |
exists(URI normalizedURI)
Does the resource that is identified by the given
normalizedURI exist in the resource store. |
boolean |
keep(URI normalizedURI)
Keep the resource that is identified by the given
normalizedURI . |
boolean |
keepOnly(Set<URI> normalizedURIs)
Clean up the managed store.
|
void |
setPathFinder(PathFinder pathFinder)
Sets the current pathFinder on this ResourceManager.
|
boolean |
update(URI normalizedURI)
Update the resource that is identified by the given
normalizedURI . |
VerificationStatus |
verifyHash(URI normalizedURI,
String algorithm,
String hash)
Verify the
hash of the resource that is identified by the given normalizedURI ,
computed with the indicated algorithm . |
VerificationStatus |
verifyLastModified(URI normalizedURI,
ZonedDateTime lastModified)
Verify the last modified date of the resource that is identified by the given
normalizedURI . |
VerificationStatus |
verifySize(URI normalizedURI,
long size)
Verify the size in bytes of the resource that is identified by the given
normalizedURI . |
void setPathFinder(PathFinder pathFinder)
PathFinder.getCapabilityListUri()
.
A ResourceManager should rely on the fact that each call to this method signifies the
synchronisation of a new set of resources.pathFinder
- the pathFinder for the current set of resourcesboolean exists(@Nonnull URI normalizedURI)
normalizedURI
exist in the resource store.normalizedURI
- identifies the resourcetrue
if the indicated resource exists, false
otherwiseVerificationStatus verifyHash(@Nonnull URI normalizedURI, @Nonnull String algorithm, @Nonnull String hash)
hash
of the resource that is identified by the given normalizedURI
,
computed with the indicated algorithm
.normalizedURI
- identifies the resourcealgorithm
- indicates algorithm for hash computationhash
- hash to verifyVerificationStatus verifyLastModified(@Nonnull URI normalizedURI, @Nonnull ZonedDateTime lastModified)
normalizedURI
.normalizedURI
- identifies the resourcelastModified
- dateTime to verifyVerificationStatus verifySize(@Nonnull URI normalizedURI, long size)
normalizedURI
.normalizedURI
- identifies the resourcesize
- size in bytes of the remote resourceboolean keepOnly(@Nonnull Set<URI> normalizedURIs)
normalizedURIs
should be kept in the managed store, others should be removed or deleted.
This call enables the ResourceManager to clean up if the Source issues a new ResourceList. The ResourceManager
should only remove resources that are not listed. The ResourceManager will be enabled
to create(URI)
and/or update(URI)
resources that are indicated
in the set but are not yet in the managed store.normalizedURIs
- identify the resources that should be kept in the managed store.true
if the operation succeeded, false
otherwiseboolean keep(@Nonnull URI normalizedURI)
normalizedURI
. The resource is present
and verified to be up-to-date. So the ResourceManager is not expected to handle the indicated resource,
but may, of course, take any action it deems appropriate.normalizedURI
- identifies the resourcetrue
if the operation succeeded, false
otherwiseboolean create(@Nonnull URI normalizedURI)
normalizedURI
. The resource was not present.normalizedURI
- identifies the resourcetrue
if the operation succeeded, false
otherwiseboolean update(@Nonnull URI normalizedURI)
normalizedURI
. The resource was present but
was not up-to-date.normalizedURI
- identifies the resourcetrue
if the operation succeeded, false
otherwiseboolean delete(@Nonnull URI normalizedURI)
normalizedURI
. The resource
was present but was purged from the set of resources.normalizedURI
- identifies the resourcetrue
if the operation succeeded, false
otherwiseCopyright © 2017. All rights reserved.