Search in sources :

Example 1 with EnumResolver

use of org.opendaylight.controller.config.facade.xml.osgi.EnumResolver in project controller by opendaylight.

the class Config method fromXmlModulesResolved.

// TODO refactor, replace string representing namespace with namespace class
// TODO refactor, replace Map->Multimap with e.g. ConfigElementResolved
// class
public Map<String, Multimap<String, ModuleElementResolved>> fromXmlModulesResolved(final XmlElement xml, final EditStrategyType defaultEditStrategyType, final ServiceRegistryWrapper serviceTracker) throws DocumentedException {
    Optional<XmlElement> modulesElement = getModulesElement(xml);
    List<XmlElement> moduleElements = getModulesElementList(modulesElement);
    Map<String, Multimap<String, ModuleElementResolved>> retVal = Maps.newHashMap();
    ResolvingStrategy<ModuleElementResolved> resolvingStrategy = (moduleMapping, moduleElement, serviceTracker1, instanceName, moduleNamespace, defaultStrategy) -> moduleMapping.fromXml(moduleElement, serviceTracker1, instanceName, moduleNamespace, defaultStrategy, identityMap, enumResolver);
    for (XmlElement moduleElement : moduleElements) {
        resolveModule(retVal, serviceTracker, moduleElement, defaultEditStrategyType, resolvingStrategy);
    }
    return retVal;
}
Also used : XmlUtil(org.opendaylight.controller.config.util.xml.XmlUtil) Multimap(com.google.common.collect.Multimap) EditStrategyType(org.opendaylight.controller.config.facade.xml.strategy.EditStrategyType) HashMultimap(com.google.common.collect.HashMultimap) Lists(com.google.common.collect.Lists) Optional(com.google.common.base.Optional) Document(org.w3c.dom.Document) Map(java.util.Map) EnumResolver(org.opendaylight.controller.config.facade.xml.osgi.EnumResolver) DocumentedException(org.opendaylight.controller.config.util.xml.DocumentedException) IdentityMapping(org.opendaylight.controller.config.facade.xml.mapping.IdentityMapping) Collection(java.util.Collection) Set(java.util.Set) ObjectName(javax.management.ObjectName) Maps(com.google.common.collect.Maps) Preconditions.checkState(com.google.common.base.Preconditions.checkState) List(java.util.List) Revision(org.opendaylight.yangtools.yang.common.Revision) Element(org.w3c.dom.Element) Entry(java.util.Map.Entry) Preconditions(com.google.common.base.Preconditions) XmlElement(org.opendaylight.controller.config.util.xml.XmlElement) ObjectNameUtil(org.opendaylight.controller.config.api.jmx.ObjectNameUtil) Collections(java.util.Collections) XmlMappingConstants(org.opendaylight.controller.config.util.xml.XmlMappingConstants) Multimap(com.google.common.collect.Multimap) HashMultimap(com.google.common.collect.HashMultimap) XmlElement(org.opendaylight.controller.config.util.xml.XmlElement)

Aggregations

Optional (com.google.common.base.Optional)1 Preconditions (com.google.common.base.Preconditions)1 Preconditions.checkState (com.google.common.base.Preconditions.checkState)1 HashMultimap (com.google.common.collect.HashMultimap)1 Lists (com.google.common.collect.Lists)1 Maps (com.google.common.collect.Maps)1 Multimap (com.google.common.collect.Multimap)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 List (java.util.List)1 Map (java.util.Map)1 Entry (java.util.Map.Entry)1 Set (java.util.Set)1 ObjectName (javax.management.ObjectName)1 ObjectNameUtil (org.opendaylight.controller.config.api.jmx.ObjectNameUtil)1 IdentityMapping (org.opendaylight.controller.config.facade.xml.mapping.IdentityMapping)1 EnumResolver (org.opendaylight.controller.config.facade.xml.osgi.EnumResolver)1 EditStrategyType (org.opendaylight.controller.config.facade.xml.strategy.EditStrategyType)1 DocumentedException (org.opendaylight.controller.config.util.xml.DocumentedException)1 XmlElement (org.opendaylight.controller.config.util.xml.XmlElement)1