public class ResourceRepositoryImpl extends java.lang.Object implements ResourceRepository
| Modifier and Type | Class and Description |
|---|---|
static class |
ResourceRepositoryImpl.FileLayout
Class maintains the info stored in the text file in the cnf directory
that holds our contents.
|
ResourceRepository.Listener, ResourceRepository.ResourceRepositoryEvent, ResourceRepository.TYPE| Modifier and Type | Field and Description |
|---|---|
protected static RepositoryPlugin.DownloadListener[] |
EMPTY_LISTENER |
FILENAME| Constructor and Description |
|---|
ResourceRepositoryImpl() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(java.lang.String repoId,
SearchableRepository.ResourceDescriptor rd)
Add a resource descriptor to the index.
|
void |
addListener(ResourceRepository.Listener rrl)
Add a new event listener
|
boolean |
delete(java.lang.String repoId,
byte[] id) |
boolean |
deleteCache(byte[] id)
Delete a cache entry
|
java.util.List<ResourceDescriptorImpl> |
filter(java.lang.String repoId,
java.lang.String filter)
List the resources.
|
java.util.SortedSet<SearchableRepository.ResourceDescriptor> |
find(java.lang.String repoId,
java.lang.String bsn,
VersionRange range) |
java.io.File |
getCacheDir(java.lang.String name) |
java.io.File |
getResource(byte[] rd,
RepositoryPlugin.DownloadListener... blockers)
Get the file belonging to a Resource Descriptor
|
ResourceDescriptorImpl |
getResourceDescriptor(byte[] rd)
List the resources.
|
void |
removeListener(ResourceRepository.Listener rrl)
Remove an event listener
|
void |
setCache(java.io.File cache) |
void |
setExecutor(java.util.concurrent.Executor executor) |
void |
setIndexFile(java.io.File file) |
void |
setReporter(aQute.service.reporter.Reporter processor) |
void |
setURLConnector(URLConnectionHandler connector) |
java.lang.String |
toString() |
protected static final RepositoryPlugin.DownloadListener[] EMPTY_LISTENER
public java.util.List<ResourceDescriptorImpl> filter(java.lang.String repoId, java.lang.String filter) throws java.lang.Exception
filter in interface ResourceRepositoryfilter - An OSGi filter matched against the SearchableRepository.ResourceDescriptorjava.lang.Exceptionpublic boolean delete(java.lang.String repoId,
byte[] id)
throws java.lang.Exception
delete in interface ResourceRepositoryjava.lang.Exceptionpublic boolean deleteCache(byte[] id)
throws java.lang.Exception
deleteCache in interface ResourceRepositoryjava.lang.Exceptionpublic boolean add(java.lang.String repoId,
SearchableRepository.ResourceDescriptor rd)
throws java.lang.Exception
add in interface ResourceRepositoryjava.lang.Exceptionpublic java.io.File getResource(byte[] rd,
RepositoryPlugin.DownloadListener... blockers)
throws java.lang.Exception
getResource in interface ResourceRepositoryjava.lang.Exceptionpublic void addListener(ResourceRepository.Listener rrl)
addListener in interface ResourceRepositorypublic void removeListener(ResourceRepository.Listener rrl)
public ResourceDescriptorImpl getResourceDescriptor(byte[] rd) throws java.lang.Exception
getResourceDescriptor in interface ResourceRepositoryjava.lang.Exceptionpublic void setReporter(aQute.service.reporter.Reporter processor)
public void setIndexFile(java.io.File file)
public void setCache(java.io.File cache)
public void setExecutor(java.util.concurrent.Executor executor)
throws java.lang.Exception
java.lang.Exceptionpublic void setURLConnector(URLConnectionHandler connector) throws java.lang.Exception
java.lang.Exceptionpublic java.util.SortedSet<SearchableRepository.ResourceDescriptor> find(java.lang.String repoId, java.lang.String bsn, VersionRange range) throws java.lang.Exception
find in interface ResourceRepositoryjava.lang.Exceptionpublic java.io.File getCacheDir(java.lang.String name)
getCacheDir in interface ResourceRepositorypublic java.lang.String toString()
toString in class java.lang.Object