Search in sources :

Example 1 with RuntimeRpcElementResolved

use of org.opendaylight.controller.config.facade.xml.rpc.RuntimeRpcElementResolved 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);
}
Also used : AttributeConfigElement(org.opendaylight.controller.config.facade.xml.mapping.attributes.fromxml.AttributeConfigElement) RuntimeRpcElementResolved(org.opendaylight.controller.config.facade.xml.rpc.RuntimeRpcElementResolved) Rpcs(org.opendaylight.controller.config.facade.xml.rpc.Rpcs) ModuleRpcs(org.opendaylight.controller.config.facade.xml.rpc.ModuleRpcs) InstanceRuntimeRpc(org.opendaylight.controller.config.facade.xml.rpc.InstanceRuntimeRpc) XmlElement(org.opendaylight.controller.config.util.xml.XmlElement) ModuleRpcs(org.opendaylight.controller.config.facade.xml.rpc.ModuleRpcs) ObjectName(javax.management.ObjectName)

Aggregations

ObjectName (javax.management.ObjectName)1 AttributeConfigElement (org.opendaylight.controller.config.facade.xml.mapping.attributes.fromxml.AttributeConfigElement)1 InstanceRuntimeRpc (org.opendaylight.controller.config.facade.xml.rpc.InstanceRuntimeRpc)1 ModuleRpcs (org.opendaylight.controller.config.facade.xml.rpc.ModuleRpcs)1 Rpcs (org.opendaylight.controller.config.facade.xml.rpc.Rpcs)1 RuntimeRpcElementResolved (org.opendaylight.controller.config.facade.xml.rpc.RuntimeRpcElementResolved)1 XmlElement (org.opendaylight.controller.config.util.xml.XmlElement)1