Class ConverterUtils


  • @Deprecated(forRemoval=true)
    public final class ConverterUtils
    extends Object
    Deprecated, for removal: This API element is subject to removal in a future version.
    This class is moved to lighty-codecs-util.
    A utility class which may be helpful while manipulating with binding independent nodes.
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static Optional<org.opendaylight.yangtools.yang.common.QName> getRpcQName​(XmlElement xmlElement)
      Deprecated, for removal: This API element is subject to removal in a future version.
      This method extracts from the given XmlElement the name and namespace from the first element and creates a QName.
      static Optional<org.opendaylight.yangtools.yang.common.QName> getRpcQName​(String inputString)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create RPC QName.
      static Optional<@NonNull org.opendaylight.yangtools.yang.data.util.DataSchemaContextNode<?>> getSchemaNode​(org.opendaylight.yangtools.yang.model.api.EffectiveModelContext effectiveModelContext, String namespace, String revision, String localName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates an instance of SchemaNode for the given namespace, revision and localname.
      static Optional<@NonNull org.opendaylight.yangtools.yang.data.util.DataSchemaContextNode<?>> getSchemaNode​(org.opendaylight.yangtools.yang.model.api.EffectiveModelContext effectiveModelContext, org.opendaylight.yangtools.yang.common.QName qname)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates an instance of SchemaNode for the given QName in the given SchemaContext.
      static Optional<@NonNull org.opendaylight.yangtools.yang.data.util.DataSchemaContextNode<?>> getSchemaNode​(org.opendaylight.yangtools.yang.model.api.EffectiveModelContext effectiveModelContext, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier yangInstanceIdentifier)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      static Optional<? extends org.opendaylight.yangtools.yang.model.api.NotificationDefinition> loadNotification​(org.opendaylight.yangtools.yang.model.api.SchemaContext schemaContext, org.opendaylight.yangtools.yang.common.QName notificationQname)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Utility method to extract the SchemaNode for the given Notification.
      static Optional<? extends org.opendaylight.yangtools.yang.model.api.RpcDefinition> loadRpc​(org.opendaylight.yangtools.yang.model.api.SchemaContext schemaContext, org.opendaylight.yangtools.yang.common.QName rpcQName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the RpcDefinition from the given SchemaContext and given QName.
      static XmlElement rpcAsInput​(XmlElement inputXmlElement)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      static XmlElement rpcAsInput​(XmlElement inputXmlElement, String namespace)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Removes the first XML tag and replaces it with an <input> element.
      static XmlElement rpcAsOutput​(XmlElement inputXmlElement)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Calls the method rpcAsOutput(XmlElement, String) with an empty namespace.
      static XmlElement rpcAsOutput​(XmlElement inputXmlElement, String namespace)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Removes the first XML tag and replaces it with an <output> element.
    • Method Detail

      • loadRpc

        public static Optional<? extends org.opendaylight.yangtools.yang.model.api.RpcDefinition> loadRpc​(org.opendaylight.yangtools.yang.model.api.SchemaContext schemaContext,
                                                                                                          org.opendaylight.yangtools.yang.common.QName rpcQName)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns the RpcDefinition from the given SchemaContext and given QName. The QName of a rpc can be constructed via

        QName.create("http://netconfcentral.org/ns/toaster", "2009-11-20", "make-toast"); , where "make-toast" is the name of the RPC given in the yang model.

        If the given RPC was found in the SchemaContext the RpcDefinition will be present

        Parameters:
        schemaContext - the schema context used for the RPC resolution
        rpcQName - QName of the RPC
        Returns:
        Optional representation of the RpcDefinition
        See Also:
        QName
      • loadNotification

        public static Optional<? extends org.opendaylight.yangtools.yang.model.api.NotificationDefinition> loadNotification​(org.opendaylight.yangtools.yang.model.api.SchemaContext schemaContext,
                                                                                                                            org.opendaylight.yangtools.yang.common.QName notificationQname)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Utility method to extract the SchemaNode for the given Notification.
        Parameters:
        schemaContext - to be used
        notificationQname - yang RPC name
        Returns:
        Optional of SchemaNode
      • getRpcQName

        public static Optional<org.opendaylight.yangtools.yang.common.QName> getRpcQName​(XmlElement xmlElement)
        Deprecated, for removal: This API element is subject to removal in a future version.
        This method extracts from the given XmlElement the name and namespace from the first element and creates a QName.
        Parameters:
        xmlElement - input data.
        Returns:
        QName for input data or empty.
      • getRpcQName

        public static Optional<org.opendaylight.yangtools.yang.common.QName> getRpcQName​(String inputString)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Create RPC QName.
        Parameters:
        inputString - RPC name
        Returns:
        QName for RPC name or empty.
        Throws:
        IllegalArgumentException - if there was a problem during parsing the XML document
        See Also:
        getRpcQName(XmlElement)
      • rpcAsInput

        public static XmlElement rpcAsInput​(XmlElement inputXmlElement)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • rpcAsInput

        public static XmlElement rpcAsInput​(XmlElement inputXmlElement,
                                            String namespace)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Removes the first XML tag and replaces it with an <input> element. This method may be useful when converting the input of a rpc. The provided namespace will be used for the input tag document.
        Parameters:
        inputXmlElement - input xml data to wrap.
        namespace - namespace
        Returns:
        wrapped xml data.
      • rpcAsOutput

        public static XmlElement rpcAsOutput​(XmlElement inputXmlElement,
                                             String namespace)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Removes the first XML tag and replaces it with an <output> element. This method may be useful when the output rpc is created. The namespace will be used for the output tag.
        Parameters:
        inputXmlElement - input rpc element data.
        namespace - namespace
        Returns:
        wrapped xml element.
        See Also:
        XmlUtil
      • getSchemaNode

        public static Optional<@NonNull org.opendaylight.yangtools.yang.data.util.DataSchemaContextNode<?>> getSchemaNode​(org.opendaylight.yangtools.yang.model.api.EffectiveModelContext effectiveModelContext,
                                                                                                                          org.opendaylight.yangtools.yang.common.QName qname)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Creates an instance of SchemaNode for the given QName in the given SchemaContext.
        Parameters:
        effectiveModelContext - the given schema context which contains the QName
        qname - the given QName
        Returns:
        instance of DataSchemaContextNode
        See Also:
        getSchemaNode(EffectiveModelContext, String, String, String)
      • getSchemaNode

        public static Optional<@NonNull org.opendaylight.yangtools.yang.data.util.DataSchemaContextNode<?>> getSchemaNode​(org.opendaylight.yangtools.yang.model.api.EffectiveModelContext effectiveModelContext,
                                                                                                                          org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier yangInstanceIdentifier)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • getSchemaNode

        public static Optional<@NonNull org.opendaylight.yangtools.yang.data.util.DataSchemaContextNode<?>> getSchemaNode​(org.opendaylight.yangtools.yang.model.api.EffectiveModelContext effectiveModelContext,
                                                                                                                          String namespace,
                                                                                                                          String revision,
                                                                                                                          String localName)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Creates an instance of SchemaNode for the given namespace, revision and localname. The namespace, revision and localname are used to construct the QName which must exist in the SchemaContext.
        Parameters:
        effectiveModelContext - given schema context
        namespace - QName namespace
        revision - QName revision
        localName - QName localname
        Returns:
        instance of SchemaNode
        See Also:
        getSchemaNode(EffectiveModelContext, QName)