org.mobicents.protocols.xcap.diff.component
Interface ElementPatchComponentBuilder<C,E>

Type Parameters:
C - the component type, defines what is the concrete type of each patch component, to be aggregated in a XCAP DIFF patch
E - the element type, defines what is the concrete type of XML elements used

public interface ElementPatchComponentBuilder<C,E>

Builds element patch components. Generated content is valid for xcap-diff document, ie, xcap-diff document could look like follows(bold content is generated by instance of this interface):

 <?xml version="1.0" encoding="UTF-8"?>
    <xcap-diff xmlns="urn:ietf:params:xml:ns:xcap-diff"
               xcap-root="http://xcap.example.com/">
 
     <element sel="rls-services/users/sip:joe@example.com/index/~~/A;/service%5b@uri='sip:marketing@example.com'%5d" xmlns:rl="urn:ietf:params:xml:ns:resource-lists">
                <s:service uri="sip:marketing@example.com">
                        <s:list name="marketing">
                                <rl:entry uri="sip:joe@example.com"/>
                                <rl:entry uri="sip:sudhir@example.com"/>
                        </s:list>
                        <s:packages>
                                <s:package>presence</s:package>
                        </s:packages>
                </s:service>
       </element>
 
    </xcap-diff>
 

Author:
baranowb, martins

Method Summary
 C buildPatchComponent(java.lang.String sel, boolean exists, java.util.Map<java.lang.String,java.lang.String> namespaceBindings)
          Builds a patch component which indicates the existence an element.
 C buildPatchComponent(java.lang.String sel, E element, java.util.Map<java.lang.String,java.lang.String> namespaceBindings)
          Builds a patch component which indicates an update of an element.
 

Method Detail

buildPatchComponent

C buildPatchComponent(java.lang.String sel,
                      E element,
                      java.util.Map<java.lang.String,java.lang.String> namespaceBindings)
                      throws BuildPatchException
Builds a patch component which indicates an update of an element.

Parameters:
sel - the selector which points to the element in the owner document, relative to the final patch xcap root.
element - the updated element
namespaceBindings - namespace bindings for undeclared namespaces in the element and in sel
Returns:
Throws:
BuildPatchException - if an exception occurred while building the patch, the concrete exception is the exception's cause.

buildPatchComponent

C buildPatchComponent(java.lang.String sel,
                      boolean exists,
                      java.util.Map<java.lang.String,java.lang.String> namespaceBindings)
                      throws BuildPatchException
Builds a patch component which indicates the existence an element.

Parameters:
sel - the selector which points to the element in the owner document, relative to the final patch xcap root.
exists - indicates if the element exists
namespaceBindings - namespace bindings for undeclared namespaces in sel
Returns:
Throws:
BuildPatchException - if an exception occurred while building the patch, the concrete exception is the exception's cause.


Copyright © 2011. All Rights Reserved.