[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Transactions



Keith,

In my implementation, I want to be explicit about my
expectations of current state.  I also have an op="merge".
The two scenarios you mentioned would result in failure.
Had I not cared whether or not the target already exists
I would have used op="merge".     That would have resulted
in an add or replace, as necessary.  As you can imagine, once
you support add and replace, adding merge is a matter of
a couple of lines of code in the library.

Larry


Allen, Keith wrote:

Larry,

 

One final question about your example (included below).  In Op 4 you "add" a dead-interval element with a value of 40, and in Op 7 you "replace" the value of a metric element with a value of 20.  What would have been the response if there had already been a dead-interval with a value of 60, say, and if there had been no metric value.  Would these have resulted in error conditions?

 

So, you have to know if the element already exists, and if so use "replace" to change it.  If it doesn't exist, use "add" to create it and set it?

 

 

Keith Allen

SBC Technology Resources

9505 Arboretum Blvd.

Austin,TX 78759

(512) 372-5741

kallen@tri.sbc.com

 

 

-----Original Message-----
From: Larry Menten [mailto:lmenten@lucent.com]
Sent: Tuesday, May 13, 2003 3:08 PM
To: netconf
Subject: Re: Is DOM vs SAX a red herring?

 

Keith,

To represent the transaction in multiple parts the target has to be identified.
We have used XPath expressions for this purpose as in the following example:

<transaction id="29">
        <deleteRequest opId="2" select="/root/configuration/protocol/ospf/area[@id='0']" />
        <deleteRequest opId="1" select="/root/configuration/protocol/ospf/area[@id='3']" />
        <addRequest opId="3" select="/root/configuration/protocol/ospf">
            <area id="4">
                <interface id="ge-2/2">
                    <authentication-key>
                        <keyname>gargoyle</keyname>
                        <key-id>3</key-id>
                    </authentication-key>
                    <metric>1</metric>
                    <hello-interval>10</hello-interval>
                    <dead-interval>40</dead-interval>
                    <retransmit-interval>10</retransmit-interval>
                    <transit-delay>5</transit-delay>
                </interface>
            </area>
        </addRequest>
        <addRequest opId="4" select="/root/configuration/protocol/ospf/area[@id='2']/interface[@id='ge-1/5']">
            <dead-interval>40</dead-interval>
        </addRequest>
        <addRequest opId="5" select="/root/configuration/protocol/is-is">
            <area id="5"></area>
        </addRequest>
        <addRequest opId="6" select="/root/configuration/protocol/ospf/area[@id='1']">
            <label-switched-path id="to-SFO">
                <metric>15</metric>
            </label-switched-path>
        </addRequest>
        <replaceRequest opId="7" select="/root/configuration/protocol/ospf/area[@id='6']/label-switched-path[@id='to-SFO']">
            <metric>20</metric>
        </replaceRequest>
    </transaction>





 
Larry Menten               Lucent Technologies/Bell Laboratories
Phone: 908 582-4467        600 Mountain Avenue, Murray Hill, NJ  07974 USA 

-- 
Larry Menten               Lucent Technologies/Bell Laboratories
Phone: 908 582-4467        600 Mountain Avenue, Murray Hill, NJ  07974 USA