Top Description Fields Methods
org.osgi.service.repository

public Interface Repository

Annotations
@ProviderType
Imports
java.util.Collection, .Map, org.osgi.annotation.versioning.ProviderType, org.osgi.resource.Capability, .Requirement, .Resource, org.osgi.util.promise.Promise

A repository service that contains resources.

Repositories may be registered as services and may be used as by a resolve context during resolver operations.

Repositories registered as services may be filtered using standard service properties.

Author
$Id: be8094486733aaf1e15921123391477eedf6d752 $

Field Summary

Modifier and TypeField and Description
public static final String
URL

Service property to provide URLs related to this repository.

Method Summary

Modifier and TypeMethod and Description
public Map<Requirement, Collection<Capability>>

Returns:

A map of matching capabilities for the specified requirements. Each specified requirement must appear as a key in the map. If there are no matching capabilities for a specified requirement, then the value in the map for the specified requirement must be an empty collection. The returned map is the property of the caller and can be modified by the caller. The returned map may be lazily populated, so calling size() may result in a long running operation.
findProviders
(Collection<? extends Requirement>
The requirements for which matching capabilities should be returned. Must not be null.
requirements
)

Find the capabilities that match the specified requirements.

public Promise<Collection<Resource>>

Returns:

A promise to a collection of matching Resources. If there are no matching resources, an empty collection is returned. The returned collection is the property of the caller and can be modified by the caller. The returned collection may be lazily populated, so calling size() may result in a long running operation.
findProviders
(RequirementExpression
The RequirementExpression for which matching capabilities should be returned. Must not be null.
expression
)

Find the resources that match the specified requirement expression.

public ExpressionCombiner

Returns:

An ExpressionCombiner.
getExpressionCombiner
()

Return an expression combiner.

public RequirementBuilder

Returns:

A new requirement builder for a requirement in the specified namespace.
newRequirementBuilder
(String
The namespace for the requirement to be created.
namespace
)

Return a new RequirementBuilder which provides a convenient way to create a requirement.

Field Detail

URLback to summary
public static final String URL

Service property to provide URLs related to this repository.

The value of this property must be of type String, String[], or Collection<String>.

Method Detail

findProvidersback to summary
public Map<Requirement, Collection<Capability>> findProviders(Collection<? extends Requirement> requirements)

Find the capabilities that match the specified requirements.

Parameters
requirements:Collection<? extends Requirement>

The requirements for which matching capabilities should be returned. Must not be null.

Returns:Map<Requirement, Collection<Capability>>

A map of matching capabilities for the specified requirements. Each specified requirement must appear as a key in the map. If there are no matching capabilities for a specified requirement, then the value in the map for the specified requirement must be an empty collection. The returned map is the property of the caller and can be modified by the caller. The returned map may be lazily populated, so calling size() may result in a long running operation.

findProvidersback to summary
public Promise<Collection<Resource>> findProviders(RequirementExpression expression)

Find the resources that match the specified requirement expression.

Parameters
expression:RequirementExpression

The RequirementExpression for which matching capabilities should be returned. Must not be null.

Returns:Promise<Collection<Resource>>

A promise to a collection of matching Resources. If there are no matching resources, an empty collection is returned. The returned collection is the property of the caller and can be modified by the caller. The returned collection may be lazily populated, so calling size() may result in a long running operation.

Since
1.1
getExpressionCombinerback to summary
public ExpressionCombiner getExpressionCombiner()

Return an expression combiner. An expression combiner can be used to combine multiple requirement expressions into more complex requirement expressions using and, or and not operators.

Returns:ExpressionCombiner

An ExpressionCombiner.

Since
1.1
newRequirementBuilderback to summary
public RequirementBuilder newRequirementBuilder(String namespace)

Return a new RequirementBuilder which provides a convenient way to create a requirement.

For example:

 
Requirement myReq = repository.newRequirementBuilder("org.foo.ns1").
  addDirective("filter", "(org.foo.ns1=val1)").
  addDirective("cardinality", "multiple").build();
Parameters
namespace:String

The namespace for the requirement to be created.

Returns:RequirementBuilder

A new requirement builder for a requirement in the specified namespace.

Since
1.1