public final class YangSourceFromCapabilitiesResolver extends YangSourceContextResolver
SchemaSourceProvider and set of QName which represent capabilities.
This source code resolver is useful for components which deals with
capability exchange similar to YANG/Netconf specification
and there is SchemaSourceProvider able to retrieve YANG models.YangSourceContextResolver.ResolutionState| Constructor and Description |
|---|
YangSourceFromCapabilitiesResolver(Iterable<org.opendaylight.yangtools.yang.common.QName> capabilities,
org.opendaylight.yangtools.yang.model.util.repo.SchemaSourceProvider<InputStream> schemaSourceProvider)
Construct new
YangSourceFromCapabilitiesResolver. |
| Modifier and Type | Method and Description |
|---|---|
com.google.common.base.Optional<YangModelDependencyInfo> |
getDependencyInfo(org.opendaylight.yangtools.yang.model.util.repo.SourceIdentifier identifier)
Returns dependency information for provided identifier
Implementations are required to:
return
Optional.absent() If source code for source is not
present
return same dependency information for multiple invocations of this
method for same source identifier.
return latest available revision if SourceIdentifier does not
specify revision. |
YangSourceContext |
resolveContext()
Resolves
YangSourceContext
Implementators of this method should invoke
YangSourceContextResolver.resolveSource(SourceIdentifier) for sources which should be
present in YangSourceContext and YangSourceContextResolver.createSourceContext()
to create resulting YangSourceContext which will contain state
derived by callbacks to YangSourceContextResolver.getDependencyInfo(SourceIdentifier). |
createSourceContext, getSourceProvider, resolveSource, resolveSourcepublic YangSourceFromCapabilitiesResolver(Iterable<org.opendaylight.yangtools.yang.common.QName> capabilities, org.opendaylight.yangtools.yang.model.util.repo.SchemaSourceProvider<InputStream> schemaSourceProvider)
YangSourceFromCapabilitiesResolver.capabilities - Set of QName representing module capabilities, QName.getLocalName() represents
source name and QName.getRevision() represents revision of source.schemaSourceProvider - - SchemaSourceProvider which should be used to resolve sources.public YangSourceContext resolveContext()
YangSourceContextResolverYangSourceContext
Implementators of this method should invoke
YangSourceContextResolver.resolveSource(SourceIdentifier) for sources which should be
present in YangSourceContext and YangSourceContextResolver.createSourceContext()
to create resulting YangSourceContext which will contain state
derived by callbacks to YangSourceContextResolver.getDependencyInfo(SourceIdentifier).resolveContext in class YangSourceContextResolverYangSourceContext.public com.google.common.base.Optional<YangModelDependencyInfo> getDependencyInfo(org.opendaylight.yangtools.yang.model.util.repo.SourceIdentifier identifier)
YangSourceContextResolverOptional.absent() If source code for source is not
presentSourceIdentifier does not
specify revision. If no revision is available Optional.absent()
MUST be returned.YangSourceContext
will be updated as following:
Optional.absent() is returned:
YangSourceContextResolver.ResolutionState.MISSING_SOURCE and
source identifier will be contained in -
YangSourceContext.getMissingSources()YangSourceContext.getMissingDependencies()identifier - Source identifierSourceIdentifier,
Optional.absent() if no source is present.Copyright © 2014. All rights reserved.