aQute.bnd.resource.repository
Class ResourceRepositoryImpl

java.lang.Object
  extended by aQute.bnd.resource.repository.ResourceRepositoryImpl
All Implemented Interfaces:
ResourceRepository

public class ResourceRepositoryImpl
extends 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
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
protected static RepositoryPlugin.DownloadListener[] EMPTY_LISTENER
           
 
Fields inherited from interface aQute.bnd.service.repository.ResourceRepository
FILENAME
 
Constructor Summary
ResourceRepositoryImpl()
           
 
Method Summary
 boolean add(String repoId, SearchableRepository.ResourceDescriptor rd)
          Add a resource descriptor to the index.
 void addListener(ResourceRepository.Listener rrl)
          Add a new event listener
 boolean delete(String repoId, byte[] id)
           
 boolean deleteCache(byte[] id)
          Delete a cache entry
 List<ResourceDescriptorImpl> filter(String repoId, String filter)
          List the resources.
 SortedSet<SearchableRepository.ResourceDescriptor> find(String repoId, String bsn, VersionRange range)
           
 File getCacheDir(String name)
           
 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(File cache)
           
 void setExecutor(Executor executor)
           
 void setIndexFile(File file)
           
 void setReporter(Reporter processor)
           
 void setURLConnector(URLConnectionHandler connector)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_LISTENER

protected static final RepositoryPlugin.DownloadListener[] EMPTY_LISTENER
Constructor Detail

ResourceRepositoryImpl

public ResourceRepositoryImpl()
Method Detail

filter

public List<ResourceDescriptorImpl> filter(String repoId,
                                           String filter)
                                    throws Exception
List the resources. We skip the filter for now.

Specified by:
filter in interface ResourceRepository
filter - An OSGi filter matched against the SearchableRepository.ResourceDescriptor
Returns:
an immutable list of resource descriptors
Throws:
Exception

delete

public boolean delete(String repoId,
                      byte[] id)
               throws Exception
Specified by:
delete in interface ResourceRepository
Throws:
Exception

deleteCache

public boolean deleteCache(byte[] id)
                    throws Exception
Delete a cache entry

Specified by:
deleteCache in interface ResourceRepository
Throws:
Exception

add

public boolean add(String repoId,
                   SearchableRepository.ResourceDescriptor rd)
            throws Exception
Add a resource descriptor to the index.

Specified by:
add in interface ResourceRepository
Throws:
Exception

getResource

public File getResource(byte[] rd,
                        RepositoryPlugin.DownloadListener... blockers)
                 throws Exception
Get the file belonging to a Resource Descriptor

Specified by:
getResource in interface ResourceRepository
Throws:
Exception

addListener

public void addListener(ResourceRepository.Listener rrl)
Add a new event listener

Specified by:
addListener in interface ResourceRepository

removeListener

public void removeListener(ResourceRepository.Listener rrl)
Remove an event listener


getResourceDescriptor

public ResourceDescriptorImpl getResourceDescriptor(byte[] rd)
                                             throws Exception
List the resources. We skip the filter for now.

Specified by:
getResourceDescriptor in interface ResourceRepository
Throws:
Exception

setReporter

public void setReporter(Reporter processor)

setIndexFile

public void setIndexFile(File file)

setCache

public void setCache(File cache)

setExecutor

public void setExecutor(Executor executor)
                 throws Exception
Throws:
Exception

setURLConnector

public void setURLConnector(URLConnectionHandler connector)
                     throws Exception
Throws:
Exception

find

public SortedSet<SearchableRepository.ResourceDescriptor> find(String repoId,
                                                               String bsn,
                                                               VersionRange range)
                                                        throws Exception
Specified by:
find in interface ResourceRepository
Throws:
Exception

getCacheDir

public File getCacheDir(String name)
Specified by:
getCacheDir in interface ResourceRepository

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2014 aQute SARL. All rights reserved.