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 classResourceRepositoryImpl.FileLayoutClass 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 booleanadd(java.lang.String repoId, SearchableRepository.ResourceDescriptor rd)Add a resource descriptor to the index.voidaddListener(ResourceRepository.Listener rrl)Add a new event listenerbooleandelete(java.lang.String repoId, byte[] id)booleandeleteCache(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.FilegetCacheDir(java.lang.String name)java.io.FilegetResource(byte[] rd, RepositoryPlugin.DownloadListener... blockers)Get the file belonging to a Resource DescriptorResourceDescriptorImplgetResourceDescriptor(byte[] rd)List the resources.voidremoveListener(ResourceRepository.Listener rrl)Remove an event listenervoidsetCache(java.io.File cache)voidsetExecutor(java.util.concurrent.Executor executor)voidsetIndexFile(java.io.File file)voidsetReporter(aQute.service.reporter.Reporter processor)voidsetURLConnector(URLConnectionHandler connector)java.lang.StringtoString()
-
-
-
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:
filterin interfaceResourceRepositoryfilter- 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:
deletein interfaceResourceRepository- Throws:
java.lang.Exception
-
deleteCache
public boolean deleteCache(byte[] id) throws java.lang.ExceptionDelete a cache entry- Specified by:
deleteCachein interfaceResourceRepository- Throws:
java.lang.Exception
-
add
public boolean add(java.lang.String repoId, SearchableRepository.ResourceDescriptor rd) throws java.lang.ExceptionAdd a resource descriptor to the index.- Specified by:
addin interfaceResourceRepository- Throws:
java.lang.Exception
-
getResource
public java.io.File getResource(byte[] rd, RepositoryPlugin.DownloadListener... blockers) throws java.lang.ExceptionGet the file belonging to a Resource Descriptor- Specified by:
getResourcein interfaceResourceRepository- Throws:
java.lang.Exception
-
addListener
public void addListener(ResourceRepository.Listener rrl)
Add a new event listener- Specified by:
addListenerin 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:
getResourceDescriptorin 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:
findin interfaceResourceRepository- Throws:
java.lang.Exception
-
getCacheDir
public java.io.File getCacheDir(java.lang.String name)
- Specified by:
getCacheDirin interfaceResourceRepository
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-