Package aQute.bnd.deployer.repository
Class AbstractIndexedRepo
java.lang.Object
aQute.bnd.osgi.repository.BaseRepository
aQute.bnd.deployer.repository.AbstractIndexedRepo
- All Implemented Interfaces:
aQute.bnd.service.IndexProvider,aQute.bnd.service.Plugin,aQute.bnd.service.Refreshable,aQute.bnd.service.RegistryPlugin,aQute.bnd.service.RemoteRepositoryPlugin,aQute.bnd.service.RepositoryPlugin,aQute.bnd.service.tags.Tagged,org.osgi.service.repository.Repository
- Direct Known Subclasses:
LocalIndexedRepo
public abstract class AbstractIndexedRepo
extends aQute.bnd.osgi.repository.BaseRepository
implements aQute.bnd.service.RegistryPlugin, aQute.bnd.service.Plugin, aQute.bnd.service.RemoteRepositoryPlugin, aQute.bnd.service.IndexProvider, org.osgi.service.repository.Repository, aQute.bnd.service.Refreshable
Abstract base class for indexed repositories.
The repository implementation is read-only by default. To implement a
writable repository, subclasses should override canWrite() and
put(InputStream, aQute.bnd.service.RepositoryPlugin.PutOptions).
-
Nested Class Summary
Nested classes/interfaces inherited from interface aQute.bnd.service.RepositoryPlugin
aQute.bnd.service.RepositoryPlugin.DownloadListener, aQute.bnd.service.RepositoryPlugin.PutOptions, aQute.bnd.service.RepositoryPlugin.PutResult -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<String,IRepositoryContentProvider> Make sure the content providers are always processed in the same order.protected final List<IRepositoryContentProvider>protected org.osgi.service.log.LogServiceprotected Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected aQute.bnd.service.Registrystatic final Stringstatic final Stringprotected aQute.service.reporter.Reporterprotected Set<aQute.bnd.service.ResolutionPhase>Fields inherited from interface org.osgi.service.repository.Repository
URLFields inherited from interface aQute.bnd.service.RepositoryPlugin
DEFAULT_REPO_TAGS, DEFAULTOPTIONSFields inherited from interface aQute.bnd.service.tags.Tagged
EMPTY_TAGS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanWrite()Map<org.osgi.resource.Requirement,Collection<org.osgi.resource.Capability>> findProviders(Collection<? extends org.osgi.resource.Requirement> requirements) get(String bsn, aQute.bnd.version.Version version, Map<String, String> properties, aQute.bnd.service.RepositoryPlugin.DownloadListener... listeners) This can be optimized to use the download technique with the listeners.File[]aQute.bnd.service.ResourceHandlegetHandle(String bsn, String range, aQute.bnd.service.Strategy strategy, Map<String, String> properties) protected aQute.bnd.service.ResourceHandle[]getHandles(String bsn, String rangeStr) getName()Set<aQute.bnd.service.ResolutionPhase>protected final voidinit()protected final voidinit(boolean ignoreCachedFile) protected voidAdd all repository content providers that are in the registry (through workspace plugins) to the known content providersparseLocations(String locationsStr) Utility function for parsing lists of URLs.aQute.bnd.service.RepositoryPlugin.PutResultput(InputStream stream, aQute.bnd.service.RepositoryPlugin.PutOptions options) booleanrefresh()protected static File[]requestAll(aQute.bnd.service.ResourceHandle[] handles) voidreset()voidsetProperties(Map<String, String> map) final voidsetRegistry(aQute.bnd.service.Registry registry) voidsetReporter(aQute.service.reporter.Reporter reporter) toString()SortedSet<aQute.bnd.version.Version>Methods inherited from class aQute.bnd.osgi.repository.BaseRepository
findProviders, getExpressionCombiner, getTags, newRequirementBuilder, setTagsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface aQute.bnd.service.Refreshable
getRootMethods inherited from interface aQute.bnd.service.RemoteRepositoryPlugin
getCacheDirectoryMethods inherited from interface org.osgi.service.repository.Repository
findProviders, getExpressionCombiner, newRequirementBuilderMethods inherited from interface aQute.bnd.service.RepositoryPlugin
getIcon, getLocation, getStatus, isOk, isRemote, syncMethods inherited from interface aQute.bnd.service.tags.Tagged
getTags
-
Field Details
-
PROP_NAME
- See Also:
-
PROP_REPO_TYPE
- See Also:
-
PROP_RESOLUTION_PHASE
- See Also:
-
PROP_RESOLUTION_PHASE_ANY
- See Also:
-
REPO_TYPE_R5
- See Also:
-
REPO_INDEX_SHA_EXTENSION
- See Also:
-
PROP_CACHE_TIMEOUT
- See Also:
-
PROP_ONLINE
- See Also:
-
PROP_VERSION_KEY
- See Also:
-
PROP_VERSION_HASH
- See Also:
-
PROP_CHECK_BSN
- See Also:
-
allContentProviders
Make sure the content providers are always processed in the same order. -
generatingProviders
-
registry
protected aQute.bnd.service.Registry registry -
reporter
protected aQute.service.reporter.Reporter reporter -
logService
protected org.osgi.service.log.LogService logService -
name
-
supportedPhases
-
-
Constructor Details
-
AbstractIndexedRepo
protected AbstractIndexedRepo()
-
-
Method Details
-
reset
public void reset() -
loadIndexes
- Returns:
- a list of URIs, parsed from the 'locations' property
- Throws:
Exception
-
loadAllContentProviders
protected void loadAllContentProviders()Add all repository content providers that are in the registry (through workspace plugins) to the known content providers -
init
- Throws:
Exception
-
init
- Throws:
Exception
-
getIndexLocations
- Specified by:
getIndexLocationsin interfaceaQute.bnd.service.IndexProvider- Throws:
Exception
-
setRegistry
public final void setRegistry(aQute.bnd.service.Registry registry) - Specified by:
setRegistryin interfaceaQute.bnd.service.RegistryPlugin
-
setProperties
- Specified by:
setPropertiesin interfaceaQute.bnd.service.Plugin
-
get
- Throws:
Exception
-
requestAll
- Throws:
Exception
-
getHandles
protected aQute.bnd.service.ResourceHandle[] getHandles(String bsn, String rangeStr) throws Exception - Throws:
Exception
-
setReporter
public void setReporter(aQute.service.reporter.Reporter reporter) - Specified by:
setReporterin interfaceaQute.bnd.service.Plugin
-
get
public File get(String bsn, String range, aQute.bnd.service.Strategy strategy, Map<String, String> properties) throws Exception- Throws:
Exception
-
getHandle
public aQute.bnd.service.ResourceHandle getHandle(String bsn, String range, aQute.bnd.service.Strategy strategy, Map<String, String> properties) throws Exception- Specified by:
getHandlein interfaceaQute.bnd.service.RemoteRepositoryPlugin- Throws:
Exception
-
canWrite
public boolean canWrite()- Specified by:
canWritein interfaceaQute.bnd.service.RepositoryPlugin
-
put
public aQute.bnd.service.RepositoryPlugin.PutResult put(InputStream stream, aQute.bnd.service.RepositoryPlugin.PutOptions options) throws Exception - Specified by:
putin interfaceaQute.bnd.service.RepositoryPlugin- Throws:
Exception
-
list
- Specified by:
listin interfaceaQute.bnd.service.RepositoryPlugin- Throws:
Exception
-
versions
- Specified by:
versionsin interfaceaQute.bnd.service.RepositoryPlugin- Throws:
Exception
-
getName
- Specified by:
getNamein interfaceaQute.bnd.service.RepositoryPlugin
-
findProviders
public Map<org.osgi.resource.Requirement,Collection<org.osgi.resource.Capability>> findProviders(Collection<? extends org.osgi.resource.Requirement> requirements) - Specified by:
findProvidersin interfaceorg.osgi.service.repository.Repository
-
parseLocations
protected static List<URI> parseLocations(String locationsStr) throws MalformedURLException, URISyntaxException Utility function for parsing lists of URLs.- Parameters:
locationsStr- Comma-separated list of URLs- Returns:
- a list of URIs
- Throws:
MalformedURLExceptionURISyntaxException
-
getSupportedPhases
- Specified by:
getSupportedPhasesin interfaceaQute.bnd.service.IndexProvider
-
toString
-
get
public File get(String bsn, aQute.bnd.version.Version version, Map<String, String> properties, aQute.bnd.service.RepositoryPlugin.DownloadListener... listeners) throws ExceptionThis can be optimized to use the download technique with the listeners. Now just a quick hack to make it work. I actually think these classes should extend FileRepo. TODO- Specified by:
getin interfaceaQute.bnd.service.RepositoryPlugin- Throws:
Exception
-
refresh
- Specified by:
refreshin interfaceaQute.bnd.service.Refreshable- Throws:
Exception
-