Class PreparedXMLStatement

Object
com.tailf.navu.PreparedXMLStatement

public class PreparedXMLStatement extends Object
This class represents a parsed XML-string, optionally with parameterized values. The string "?" denotes a value that is unknown at the time when the XML-string is parsed. The "?"-strings can be replaced by actual values at a later time.

The put() method is used to replace a "?" parameter with its actual ConfValue. The parameter index is zero-based.

When all "?" parameters have been replaced, setValues() can be issued which will insert or replace (if values already exist) the configuration tree specified by the XML-string at the location where prepareXMLCall was called.

If a parameter is not replaced by a value before a setValues() occurs, the value is treated as a ConfDefault.

No validation of data types occurs when put() is called, but setValues() will fail if a parameter is set to a type other than the one mandated by the YANG-model.

 module mtest {
   namespace "http://tail-f.com/test/mtest/1.0";
   prefix mtest;

   import ietf-inet-types {
     prefix inet;
   }

   container mtest {
     container servers {
       list server {
         key name;
         max-elements 64;
         leaf name {
           type string;
         }
         leaf ip {
           type inet:host;
           mandatory true;
         }
         leaf port {
           type inet:port-number;
           default 80;
         }
         list interface {
           key name;
           max-elements 8;
           leaf name {
             type string;
           }
           leaf mtu {
             type int64;
             default 1500;
           }
         }
       }
     }
   }
 }
 
 
 PreparedXMLStatement xmlst =
     serversNavuNode.prepareXMLCall("<server>"
                                    + "<name>?</name>"
                                    + "<ip>?</ip>"
                                    + "<port>?</port>"
                                    + "</server>");

 xmlst.put(0, "www1");
 xmlst.put(1, new ConfIPv4("192.168.10.12"));
 xmlst.put(2, new ConfUInt16(80));
 xmlst.setValues();
  • Constructor Details

  • Method Details

    • put

      public void put(int index, ConfObject val)
      Populate the parameterized value at position index with the value val. The first parameter has index 0.
      Parameters:
      index - zero-based index of the parameter
      val - the value to give to the parameter
    • put

      public void put(int index, String strval)
      Populate the parameterized value at position index with the value strval. The first parameter has index 0. The input string is converted to the appropriate data type as specified by the current schema.
      Parameters:
      index - zero-based index of the parameter
      strval - string representation of the value to give to the parameter
    • reset

      public void reset()
    • setUInt8

      @Deprecated public void setUInt8(int index, ConfUInt8 val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfUInt8 value.
      Parameters:
      index - The Index position
      val - The value at position index
    • setUInt16

      @Deprecated public void setUInt16(int index, ConfUInt16 val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfUInt16 value.
      Parameters:
      index - The Index position
      val - The value at position index
    • setUInt32

      @Deprecated public void setUInt32(int index, ConfUInt32 val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfUInt32 value.
      Parameters:
      index - The Index position
      val - The value at position index
    • setUInt64

      @Deprecated public void setUInt64(int index, ConfUInt64 val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfUInt64 value.
      Parameters:
      index - The Index position
      val - The value at position index
    • setInt8

      @Deprecated public void setInt8(int index, ConfInt8 val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfInt8 value.
      Parameters:
      index - The Index position
      val - The value at position index
    • setInt16

      @Deprecated public void setInt16(int index, ConfInt16 val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfUInt16 value.
      Parameters:
      index - The Index position
      val - The value at position index
    • setInt32

      @Deprecated public void setInt32(int index, ConfInt32 val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfUInt32 value.
      Parameters:
      index - The Index position
      val - The value at position index
    • setInt64

      @Deprecated public void setInt64(int index, ConfInt64 val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfUInt64 value.
      Parameters:
      index - The Index position
      val - The value at position index
    • setIPv4

      @Deprecated public void setIPv4(int index, ConfIPv4 val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfIPv4 value.
      Parameters:
      index - The Index position
      val - The value at position index
    • setIPv4Prefix

      @Deprecated public void setIPv4Prefix(int index, ConfIPv4Prefix val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfIPv4Prefix value.
      Parameters:
      index - The Index position
      val - The value at position index
    • setIPv6

      @Deprecated public void setIPv6(int index, ConfIPv6 val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfIPv4Prefix value.
      Parameters:
      index - The Index position
      val - The value at position index
    • setIPv6Prefix

      @Deprecated public void setIPv6Prefix(int index, ConfIPv6Prefix val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfIPv6Prefix value.
      Parameters:
      index - The Index position
      val - The value at position index
    • setBinary

      @Deprecated public void setBinary(int index, ConfBinary val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfBinary value.
      Parameters:
      index - The Index position
      val - The value at position index
    • setHexList

      @Deprecated public void setHexList(int index, ConfHexList val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfHexList value.
      Parameters:
      index - The Index position
      val - The value at position index
    • setBit32

      @Deprecated public void setBit32(int index, ConfBit32 val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfBit32value.
      Parameters:
      index - The Index position
      val - The value at position index
    • setBit64

      @Deprecated public void setBit64(int index, ConfBit64 val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfBit64value.
      Parameters:
      index - The Index position
      val - The value at position index
    • setBool

      @Deprecated public void setBool(int index, ConfBool val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfBool.
      Parameters:
      index - The Index position
      val - The value at position index
    • setBool

      @Deprecated public void setBool(int index, boolean val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfBool.
      Parameters:
      index - The Index position
      val - The value at position index
    • setBuf

      @Deprecated public void setBuf(int index, ConfBuf val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfBuf.
      Parameters:
      index - The Index position
      val - The value at position index
    • setBuf

      @Deprecated public void setBuf(int index, String val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfBuf.
      Parameters:
      index - The Index position
      val - The value at position index
    • setDate

      @Deprecated public void setDate(int index, ConfDate val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfDate.
      Parameters:
      index - The Index position
      val - The value at position index
    • setDatetime

      @Deprecated public void setDatetime(int index, ConfDatetime val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfDatetime.
      Parameters:
      index - The Index position
      val - The value at position index
    • setDuration

      @Deprecated public void setDuration(int index, ConfDuration val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfDuration.
      Parameters:
      index - The Index position
      val - The value at position index
    • setEnumeration

      @Deprecated public void setEnumeration(int index, ConfEnumeration val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfEnumeration.
      Parameters:
      index - The Index position
      val - The value at position index
    • setDecimal64

      @Deprecated public void setDecimal64(int index, ConfDecimal64 val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfDecimal64.
      Parameters:
      index - The Index position
      val - The value at position index
    • setConfDouble

      @Deprecated public void setConfDouble(int index, ConfDouble val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfDouble.
      Parameters:
      index - The Index position
      val - The value at position index
    • setConfFloat

      @Deprecated public void setConfFloat(int index, ConfFloat val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfDouble.
      Parameters:
      index - The Index position
      val - The value at position index
    • setConfIdentityRef

      @Deprecated public void setConfIdentityRef(int index, ConfIdentityRef val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfIdentityRef.
      Parameters:
      index - The Index position
      val - The value at position index
    • setConfObjectRef

      @Deprecated public void setConfObjectRef(int index, ConfObjectRef val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfIdentityRef.
      Parameters:
      index - The Index position
      val - The value at position index
    • setConfHexList

      @Deprecated public void setConfHexList(int index, ConfHexList val)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead. Set the parameter at index index with the corresponding ConfIdentityRef.
      Parameters:
      index - The Index position
      val - The value at position index
    • setConfKey

      @Deprecated public void setConfKey(int index, ConfKey key)
      Deprecated.
      This method is deprecated, use put(int, ConfObject) instead.
    • getConfXMLParams

      public ConfXMLParam[] getConfXMLParams()
    • set

      @Deprecated public void set() throws NavuException
      Deprecated.
      This method is deprecated, use setValues() instead
      Throws:
      NavuException
    • set

      @Deprecated public void set(NavuContext context) throws NavuException
      Deprecated.
      This method is deprecated, use setValues(NavuContext) instead
      Throws:
      NavuException
    • set

      @Deprecated public void set(NavuNode node) throws NavuException
      Deprecated.
      This method is deprecated, use setValues(NavuNode) instead
      Throws:
      NavuException
    • setValues

      public void setValues() throws NavuException
      When all of the parameterized values have been filled in, this method is intended to be invoked for a final set operation with the given values.
      Throws:
      NavuException
    • setValues

      public void setValues(NavuContext context) throws NavuException
      When all of the parameterized values have been filled in, this method is intended to be invoked for a final set operation with the given values.
      Parameters:
      context - NavuContext object that the setValues() operation should use
      Throws:
      NavuException
    • setValues

      public void setValues(NavuNode node) throws NavuException
      Similar to setValues(NavuContext) but uses the context of the supplied node.
      Parameters:
      node - node containing the NavuContext to use
      Throws:
      NavuException
    • sharedSetValues

      public void sharedSetValues() throws NavuException
      Variant of setValues() with FastMap support.
      Throws:
      NavuException
    • sharedSetValues

      public void sharedSetValues(NavuContext context) throws NavuException
      Variant of setValues(NavuContext) with FastMap support.
      Parameters:
      context - NavuContext object that the sharedSetValues() operation should use
      Throws:
      NavuException
    • sharedSetValues

      public void sharedSetValues(NavuNode node) throws NavuException
      Variant of setValues(NavuNode) with FastMap support.
      Parameters:
      node - node containing the NavuContext to use
      Throws:
      NavuException