Package aQute.bnd.resource.repository
Class ResourceRepositoryImpl
- java.lang.Object
-
- aQute.bnd.resource.repository.ResourceRepositoryImpl
-
- All Implemented Interfaces:
ResourceRepository
public class ResourceRepositoryImpl extends java.lang.Object implements ResourceRepository
This class implements a hidden repository. This repo is kept in a text file that is under scm control. Files are fetched on demand. The idea is that bnd will bootstrap from this repo and downloads plugins. These plugins then provide faces on this hidden repository.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ResourceRepositoryImpl.FileLayout
Class maintains the info stored in the text file in the cnf directory that holds our contents.-
Nested classes/interfaces inherited from interface aQute.bnd.service.repository.ResourceRepository
ResourceRepository.Listener, ResourceRepository.ResourceRepositoryEvent, ResourceRepository.TYPE
-
-
Field Summary
Fields Modifier and Type Field Description protected static RepositoryPlugin.DownloadListener[]
EMPTY_LISTENER
-
Fields inherited from interface aQute.bnd.service.repository.ResourceRepository
FILENAME
-
-
Constructor Summary
Constructors Constructor Description ResourceRepositoryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 listenerboolean
delete(java.lang.String repoId, byte[] id)
boolean
deleteCache(byte[] id)
Delete a cache entryjava.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 DescriptorResourceDescriptorImpl
getResourceDescriptor(byte[] rd)
List the resources.void
removeListener(ResourceRepository.Listener rrl)
Remove an event listenervoid
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()
-
-
-
Field Detail
-
EMPTY_LISTENER
protected static final RepositoryPlugin.DownloadListener[] EMPTY_LISTENER
-
-
Method Detail
-
filter
public java.util.List<ResourceDescriptorImpl> filter(java.lang.String repoId, java.lang.String filter) throws java.lang.Exception
List the resources. We skip the filter for now.- Specified by:
filter
in interfaceResourceRepository
filter
- An OSGi filter matched against theSearchableRepository.ResourceDescriptor
- Returns:
- an immutable list of resource descriptors
- Throws:
java.lang.Exception
-
delete
public boolean delete(java.lang.String repoId, byte[] id) throws java.lang.Exception
- Specified by:
delete
in interfaceResourceRepository
- Throws:
java.lang.Exception
-
deleteCache
public boolean deleteCache(byte[] id) throws java.lang.Exception
Delete a cache entry- Specified by:
deleteCache
in interfaceResourceRepository
- Throws:
java.lang.Exception
-
add
public boolean add(java.lang.String repoId, SearchableRepository.ResourceDescriptor rd) throws java.lang.Exception
Add a resource descriptor to the index.- Specified by:
add
in interfaceResourceRepository
- Throws:
java.lang.Exception
-
getResource
public java.io.File getResource(byte[] rd, RepositoryPlugin.DownloadListener... blockers) throws java.lang.Exception
Get the file belonging to a Resource Descriptor- Specified by:
getResource
in interfaceResourceRepository
- Throws:
java.lang.Exception
-
addListener
public void addListener(ResourceRepository.Listener rrl)
Add a new event listener- Specified by:
addListener
in interfaceResourceRepository
-
removeListener
public void removeListener(ResourceRepository.Listener rrl)
Remove an event listener
-
getResourceDescriptor
public ResourceDescriptorImpl getResourceDescriptor(byte[] rd) throws java.lang.Exception
List the resources. We skip the filter for now.- Specified by:
getResourceDescriptor
in interfaceResourceRepository
- Throws:
java.lang.Exception
-
setReporter
public void setReporter(aQute.service.reporter.Reporter processor)
-
setIndexFile
public void setIndexFile(java.io.File file)
-
setCache
public void setCache(java.io.File cache)
-
setExecutor
public void setExecutor(java.util.concurrent.Executor executor) throws java.lang.Exception
- Throws:
java.lang.Exception
-
setURLConnector
public void setURLConnector(URLConnectionHandler connector) throws java.lang.Exception
- Throws:
java.lang.Exception
-
find
public java.util.SortedSet<SearchableRepository.ResourceDescriptor> find(java.lang.String repoId, java.lang.String bsn, VersionRange range) throws java.lang.Exception
- Specified by:
find
in interfaceResourceRepository
- Throws:
java.lang.Exception
-
getCacheDir
public java.io.File getCacheDir(java.lang.String name)
- Specified by:
getCacheDir
in interfaceResourceRepository
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-