static final String RPC_REGISTRY_NAME = "org.opendaylight.blueprint.RpcRegistry";
static final String NOTIFICATION_SERVICE_NAME = "org.opendaylight.blueprint.NotificationService";
static final String TYPE_ATTR = "type";
+ static final String UPDATE_STRATEGY_ATTR = "update-strategy";
private static final Logger LOG = LoggerFactory.getLogger(OpendaylightNamespaceHandler.class);
private static final String COMPONENT_PROCESSOR_NAME = ComponentProcessor.class.getName();
private static final String ID_ATTR = "id";
private static final String RPC_SERVICE = "rpc-service";
private static final String SPECIFIC_SERVICE_REF_LIST = "specific-reference-list";
+ private static final String STATIC_REFERENCE = "static-reference";
@SuppressWarnings("rawtypes")
@Override
return parseClusteredAppConfig(element, context);
} else if (nodeNameEquals(element, SPECIFIC_SERVICE_REF_LIST)) {
return parseSpecificReferenceList(element, context);
+ } else if (nodeNameEquals(element, STATIC_REFERENCE)) {
+ return parseStaticReference(element, context);
}
throw new ComponentDefinitionException("Unsupported standalone element: " + element.getNodeName());
return new DataStoreAppConfigMetadata(getId(context, element), element.getAttribute(
DataStoreAppConfigMetadata.BINDING_CLASS), element.getAttribute(
- DataStoreAppConfigMetadata.LIST_KEY_VALUE), defaultAppConfigElement);
+ DataStoreAppConfigMetadata.LIST_KEY_VALUE), element.getAttribute(
+ DataStoreAppConfigMetadata.DEFAULT_CONFIG_FILE_NAME), parseUpdateStrategy(
+ element.getAttribute(UPDATE_STRATEGY_ATTR)), defaultAppConfigElement);
+ }
+
+ private UpdateStrategy parseUpdateStrategy(String updateStrategyValue) {
+ if (Strings.isNullOrEmpty(updateStrategyValue) ||
+ updateStrategyValue.equalsIgnoreCase(UpdateStrategy.RELOAD.name())) {
+ return UpdateStrategy.RELOAD;
+ } else if(updateStrategyValue.equalsIgnoreCase(UpdateStrategy.NONE.name())){
+ return UpdateStrategy.NONE;
+ } else {
+ LOG.warn("update-strategy {} not supported, using reload", updateStrategyValue);
+ return UpdateStrategy.RELOAD;
+ }
}
private Metadata parseSpecificReferenceList(Element element, ParserContext context) {
return metadata;
}
+ private Metadata parseStaticReference(Element element, ParserContext context) {
+ ComponentFactoryMetadata metadata = new StaticReferenceMetadata(getId(context, element),
+ element.getAttribute(INTERFACE));
+
+ LOG.debug("parseStaticReference returning {}", metadata);
+
+ return metadata;
+ }
+
private Element parseXML(String name, String xml) {
DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
builderFactory.setNamespaceAware(true);