use of org.opendaylight.controller.config.facade.xml.rpc.InstanceRuntimeRpc in project controller by opendaylight.
the class RpcFacade method fromXml.
public OperationExecution fromXml(final XmlElement xml) throws DocumentedException {
final String namespace;
namespace = xml.getNamespace();
final XmlElement contextInstanceElement = xml.getOnlyChildElement(CONTEXT_INSTANCE);
final String operationName = xml.getName();
final RuntimeRpcElementResolved id = RuntimeRpcElementResolved.fromXpath(contextInstanceElement.getTextContent(), operationName, namespace);
final Rpcs rpcs = mapRpcs();
final ModuleRpcs rpcMapping = rpcs.getRpcMapping(id);
final InstanceRuntimeRpc instanceRuntimeRpc = rpcMapping.getRpc(id.getRuntimeBeanName(), operationName);
// TODO move to Rpcs after xpath attribute is redesigned
final ObjectName on = id.getObjectName(rpcMapping);
Map<String, AttributeConfigElement> attributes = instanceRuntimeRpc.fromXml(xml);
attributes = sortAttributes(attributes, xml);
return new OperationExecution(on, instanceRuntimeRpc.getName(), attributes, instanceRuntimeRpc.getReturnType(), namespace);
}
Aggregations