Class JsonRepository
- java.lang.Object
-
- org.apache.felix.utils.repository.BaseRepository
-
- org.apache.felix.utils.repository.JsonRepository
-
- All Implemented Interfaces:
org.osgi.service.repository.Repository
public class JsonRepository extends BaseRepository
Repository using a JSON representation of resource metadata. The json should be a map: the key is the resource uri and the value is a map of resource headers. The content of the URL can be gzipped.
-
-
Field Summary
-
Fields inherited from class org.apache.felix.utils.repository.BaseRepository
capSets, resources
-
-
Constructor Summary
Constructors Constructor Description JsonRepository(java.lang.String url, long expiration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
buildResource(java.lang.String uri, java.util.Map<java.lang.String,java.lang.String> headerMap)
protected void
checkAndLoadCache()
protected boolean
doRead(java.io.InputStream is)
java.util.Map<org.osgi.resource.Requirement,java.util.Collection<org.osgi.resource.Capability>>
findProviders(java.util.Collection<? extends org.osgi.resource.Requirement> requirements)
java.util.List<org.osgi.resource.Resource>
getResources()
-
Methods inherited from class org.apache.felix.utils.repository.BaseRepository
addResource, findProviders, getExpressionCombiner, newRequirementBuilder
-
-
-
-
Method Detail
-
getResources
public java.util.List<org.osgi.resource.Resource> getResources()
- Overrides:
getResources
in classBaseRepository
-
findProviders
public java.util.Map<org.osgi.resource.Requirement,java.util.Collection<org.osgi.resource.Capability>> findProviders(java.util.Collection<? extends org.osgi.resource.Requirement> requirements)
- Specified by:
findProviders
in interfaceorg.osgi.service.repository.Repository
- Overrides:
findProviders
in classBaseRepository
-
checkAndLoadCache
protected void checkAndLoadCache()
-
doRead
protected boolean doRead(java.io.InputStream is) throws java.io.IOException
- Throws:
java.io.IOException
-
buildResource
protected void buildResource(java.lang.String uri, java.util.Map<java.lang.String,java.lang.String> headerMap) throws java.io.IOException
- Throws:
java.io.IOException
-
-