Package aQute.bnd.service.repository
Interface SearchableRepository
@ProviderType
public interface SearchableRepository
A Searchable Repository is backed by a search engine that holds more
revisions than that are currently available locally. For example, it is
backed by a database. This interface provides a query interface for text
search as well as a requirement based search.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
Describes a resource that is a member of the underlying remote repository. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Add a resource descriptors to the underlying repository.Return the URL to a web page that allows browsing or searching of the repository.findResources
(org.osgi.resource.Requirement requirement, boolean includeDependencies) Find a set of resources that match the given requirement.This is intended to be used to provide extra resources when a resolve fails.getResources
(URI url, boolean includeDependencies) Convert a URL to a set of resource descriptors.Search a repository and return a set of resource descriptors that match the query.
-
Method Details
-
getResources
Set<SearchableRepository.ResourceDescriptor> getResources(URI url, boolean includeDependencies) throws Exception Convert a URL to a set of resource descriptors. If the url is not recognized null is returned. This method can be used if a URL is dropped and you need to know the resources identified by this url. The returned set is owned by the caller and may be modified. The @{code includeDependencies} parameter indicates that if possible any mandatory compile and runtime dependencies should be added to the result set.- Parameters:
url
- the dropped urlincludeDependencies
- Include any dependent revisions- Returns:
- null or the modifiable set of associated resource descriptors.
- Throws:
Exception
-
query
Search a repository and return a set of resource descriptors that match the query. The query string may use any syntax. If the syntax is not recognized or no results are returned an empty set should be returned. The returned set is owned by the caller and may be modified. Returned items are not automatically added to the repository.- Parameters:
query
- The query syntax- Returns:
- a set of resource descriptors.
- Throws:
Exception
-
addResource
Add a resource descriptors to the underlying repository. Only descriptors recognized to be from the designated repository are added, others must be ignored. True must be returned if this descriptor was accepted.- Parameters:
resource
- the descriptor to add- Returns:
- true if added, false if rejected
- Throws:
Exception
-
findResources
Set<SearchableRepository.ResourceDescriptor> findResources(org.osgi.resource.Requirement requirement, boolean includeDependencies) throws Exception Find a set of resources that match the given requirement.This is intended to be used to provide extra resources when a resolve fails. Returned are all revisions that have a matching capability. The @{code includeDependencies} parameter indicates that if possible any mandatory compile and runtime dependencies should be added to the result set.- Parameters:
requirement
- The requirement to matchincludeDependencies
- Include any dependent revisions- Returns:
- the set of resource descriptors that match, potentially empty
- Throws:
Exception
-
browse
Return the URL to a web page that allows browsing or searching of the repository.- Parameters:
searchString
- A search string, or null for general browsing- Returns:
- A URL that may be opened in a web browser, or null if the repository does not support web browsing.
- Throws:
Exception
-