com.ibm.xdms.common
Class XcapDiffInfo

java.lang.Object
  extended by com.ibm.xdms.common.XcapDiffInfo
All Implemented Interfaces:
java.io.Serializable

public class XcapDiffInfo
extends java.lang.Object
implements java.io.Serializable

Class containing xcap-diff information. This class is sent over SIBus from NotifyXcapFilter to the listener, so it must be Serializable.

See Also:
Serialized Form

Field Summary
static java.lang.String ATTRIBUTE_TYPE
           
static java.lang.String DOCUMENT_TYPE
           
static java.lang.String ELEMENT_TYPE
           
 
Constructor Summary
XcapDiffInfo()
          No argument constructor for serialization
XcapDiffInfo(java.lang.String auid, java.lang.String xcapRoot, java.lang.String documentSelector, long oldETag, long newETag, java.lang.String lastModifierIdentity, java.util.Date lastModifiedDate)
          Constructs an XcapDiffInfo object given all the fields explicitly.
XcapDiffInfo(XcapServerRequest request, XcapServerResponse response)
          Constructs an XcapDiffInfo object based on XcapServerRequest and XcapServerResponse.
XcapDiffInfo(XcapServerRequest request, XcapServerResponse response, java.lang.String node_sel, java.lang.String sel, java.lang.String type, java.lang.String pos, java.lang.String ws, java.lang.String content, java.lang.String oldAttValue)
          Constructs an XcapDiffInfo object based on XcapServerRequest, XcapServerResponse, as well as patching info.
 
Method Summary
 java.lang.String getAuid()
           
 java.lang.String getDocumentSelector()
           
 java.util.Date getLastModifiedDate()
           
 java.lang.String getLastModifierIdentity()
           
 long getNewETag()
           
 java.lang.String getNodeSelector()
           
 java.lang.String getOldAttValue()
           
 long getOldETag()
           
 java.lang.String getPatchOp()
           
 java.lang.String getPatchOpContent()
           
 java.lang.String getPatchOpSel()
           
 java.lang.String getXcapRoot()
           
 void setAuid(java.lang.String auid)
           
 void setDocumentSelector(java.lang.String documentSelector)
           
 void setLastModifiedDate(java.util.Date lastModifiedDate)
           
 void setLastModifierIdentity(java.lang.String lastModifierIdentity)
           
 void setNewETag(long newETag)
           
 void setNodeSelector(java.lang.String nodeSelector)
           
 void setOldAttValue(java.lang.String oldAttValue)
           
 void setOldETag(long oldETag)
           
 void setPatchOp(java.lang.String patch_op)
           
 void setPatchOpContent(java.lang.String patch_op_content)
           
 void setPatchOpSel(java.lang.String patch_op_att_sel)
           
 void setXcapRoot(java.lang.String xcapRoot)
           
protected  java.lang.String toAttributeElement(java.lang.String node_sel, java.lang.String diffProcessing, java.lang.String content, boolean isGlobalIndex)
          returns an attribute element formatted for xcapdiff
protected  java.lang.String toDocElement(java.lang.String diffProcessing)
          return a doc element formatted for xcapdiff
protected  java.lang.String toDocElement(java.lang.String diffProcessing, boolean isForUA)
          return a doc element formatted for xcapdiff
 java.lang.String toElement(java.lang.String type, java.lang.String diffProcessing, java.lang.String node_sel, java.lang.String content, boolean isGlobalIndex)
          returns either a document, element, or attribute element formatted for xcap diff
 java.lang.String toElement(java.lang.String type, java.lang.String diffProcessing, java.lang.String node_sel, java.lang.String content, boolean isGlobalIndex, boolean isForUA)
          returns either a document, element, or attribute element formatted for xcap diff
protected  java.lang.String toElementElement(java.lang.String node_sel, java.lang.String diffProcessing, java.lang.String content, boolean isGlobalIndex)
          returns an element element formatted for xcapdiff
 java.lang.String toInitialNotify(java.lang.String elements)
          returns an xcap diff with the content provided
 java.lang.String toPatchOpString()
          reutnrs a patch ops string for the xcap diff info
 java.lang.String toString()
           
 java.lang.String toXcapDiffEvent(java.lang.String diffProcessing, java.lang.String type, java.lang.String node_sel, java.lang.String content, boolean isGlobalIndex)
          returns an xcap diff
 java.lang.String toXcapDiffUA(boolean include_patch_ops)
          returns a ua profile xcap diff
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DOCUMENT_TYPE

public static final java.lang.String DOCUMENT_TYPE
See Also:
Constant Field Values

ELEMENT_TYPE

public static final java.lang.String ELEMENT_TYPE
See Also:
Constant Field Values

ATTRIBUTE_TYPE

public static final java.lang.String ATTRIBUTE_TYPE
See Also:
Constant Field Values
Constructor Detail

XcapDiffInfo

public XcapDiffInfo()
No argument constructor for serialization


XcapDiffInfo

public XcapDiffInfo(XcapServerRequest request,
                    XcapServerResponse response)
             throws XdmsException
Constructs an XcapDiffInfo object based on XcapServerRequest and XcapServerResponse. The response object must be filled in, so you should only call this after the call to chain.doXXX(). Data is read from the request and response to fill in the values of the new XcapDiffInfo.

Parameters:
request -
response -
Throws:
XdmsException

XcapDiffInfo

public XcapDiffInfo(XcapServerRequest request,
                    XcapServerResponse response,
                    java.lang.String node_sel,
                    java.lang.String sel,
                    java.lang.String type,
                    java.lang.String pos,
                    java.lang.String ws,
                    java.lang.String content,
                    java.lang.String oldAttValue)
             throws XdmsException
Constructs an XcapDiffInfo object based on XcapServerRequest, XcapServerResponse, as well as patching info. The response object must be filled in, so you should only call this after the call to chain.doXXX(). Data is read from the request and response to fill in the values of the new XcapDiffInfo.

Parameters:
request -
response -
patch_op -
sel -
type -
pos -
ws -
content -
Throws:
XdmsException

XcapDiffInfo

public XcapDiffInfo(java.lang.String auid,
                    java.lang.String xcapRoot,
                    java.lang.String documentSelector,
                    long oldETag,
                    long newETag,
                    java.lang.String lastModifierIdentity,
                    java.util.Date lastModifiedDate)
Constructs an XcapDiffInfo object given all the fields explicitly.

Parameters:
auid - AUID
xcapRoot - XCAP root
documentSelector - document selector
oldETag - The previous e-tag of the document
newETag - The new e-tag of the document
lastModifierIdentity - User who last mofified the document
lastModifiedDate - Date of last update
Method Detail

getAuid

public java.lang.String getAuid()
Returns:
the auid

setAuid

public void setAuid(java.lang.String auid)
Parameters:
auid - the auid to set

getDocumentSelector

public java.lang.String getDocumentSelector()
Returns:
the documentSelector

setDocumentSelector

public void setDocumentSelector(java.lang.String documentSelector)
Parameters:
documentSelector - the documentSelector to set

getNodeSelector

public java.lang.String getNodeSelector()
Returns:
the nodeSelector

setNodeSelector

public void setNodeSelector(java.lang.String nodeSelector)
Parameters:
nodeSelector - the nodeSelector to set

getLastModifiedDate

public java.util.Date getLastModifiedDate()
Returns:
the lastModifiedDate

setLastModifiedDate

public void setLastModifiedDate(java.util.Date lastModifiedDate)
Parameters:
lastModifiedDate - the lastModifiedDate to set

getLastModifierIdentity

public java.lang.String getLastModifierIdentity()
Returns:
the lastModifierIdentity

setLastModifierIdentity

public void setLastModifierIdentity(java.lang.String lastModifierIdentity)
Parameters:
lastModifierIdentity - the lastModifierIdentity to set

getNewETag

public long getNewETag()
Returns:
the newETag

setNewETag

public void setNewETag(long newETag)
Parameters:
newETag - the newETag to set

getOldETag

public long getOldETag()
Returns:
the oldETag

setOldETag

public void setOldETag(long oldETag)
Parameters:
oldETag - the oldETag to set

getXcapRoot

public java.lang.String getXcapRoot()
Returns:
the xcapRoot

setXcapRoot

public void setXcapRoot(java.lang.String xcapRoot)
Parameters:
xcapRoot - the xcapRoot to set

getPatchOp

public java.lang.String getPatchOp()
Returns:
the patch_op

setPatchOp

public void setPatchOp(java.lang.String patch_op)
Parameters:
patch_op - the patch_op to set

getPatchOpSel

public java.lang.String getPatchOpSel()
Returns:
the patch_op_att_sel

setPatchOpSel

public void setPatchOpSel(java.lang.String patch_op_att_sel)
Parameters:
patch_op_att_sel - the patch_op_att_sel to set

getPatchOpContent

public java.lang.String getPatchOpContent()
Returns:
the patch_op_content

setPatchOpContent

public void setPatchOpContent(java.lang.String patch_op_content)
Parameters:
patch_op_content - the patch_op_content to set

getOldAttValue

public java.lang.String getOldAttValue()
Returns:
the oldAttValue

setOldAttValue

public void setOldAttValue(java.lang.String oldAttValue)
Parameters:
oldAttValue - the oldAttValue to set

toElement

public java.lang.String toElement(java.lang.String type,
                                  java.lang.String diffProcessing,
                                  java.lang.String node_sel,
                                  java.lang.String content,
                                  boolean isGlobalIndex)
returns either a document, element, or attribute element formatted for xcap diff

Parameters:
type -
diffProcessing -
node_sel -
content -
isGlobalIndex -
Returns:

toElement

public java.lang.String toElement(java.lang.String type,
                                  java.lang.String diffProcessing,
                                  java.lang.String node_sel,
                                  java.lang.String content,
                                  boolean isGlobalIndex,
                                  boolean isForUA)
returns either a document, element, or attribute element formatted for xcap diff

Parameters:
type -
diffProcessing -
node_sel -
content -
isGlobalIndex -
isForUA -
Returns:

toDocElement

protected java.lang.String toDocElement(java.lang.String diffProcessing)
return a doc element formatted for xcapdiff

Parameters:
diffProcessing -
Returns:

toDocElement

protected java.lang.String toDocElement(java.lang.String diffProcessing,
                                        boolean isForUA)
return a doc element formatted for xcapdiff

Parameters:
isForUA -
diffProcessing -
Returns:

toElementElement

protected java.lang.String toElementElement(java.lang.String node_sel,
                                            java.lang.String diffProcessing,
                                            java.lang.String content,
                                            boolean isGlobalIndex)
returns an element element formatted for xcapdiff

Parameters:
node_sel -
diffProcessing -
content -
isGlobalIndex -
Returns:

toAttributeElement

protected java.lang.String toAttributeElement(java.lang.String node_sel,
                                              java.lang.String diffProcessing,
                                              java.lang.String content,
                                              boolean isGlobalIndex)
returns an attribute element formatted for xcapdiff

Parameters:
node_sel -
diffProcessing -
content -
isGlobalIndex -
Returns:

toInitialNotify

public java.lang.String toInitialNotify(java.lang.String elements)
returns an xcap diff with the content provided

Parameters:
elements -
Returns:

toXcapDiffUA

public java.lang.String toXcapDiffUA(boolean include_patch_ops)
returns a ua profile xcap diff

Parameters:
include_patch_ops -
Returns:

toXcapDiffEvent

public java.lang.String toXcapDiffEvent(java.lang.String diffProcessing,
                                        java.lang.String type,
                                        java.lang.String node_sel,
                                        java.lang.String content,
                                        boolean isGlobalIndex)
returns an xcap diff

Parameters:
diffProcessing -
type -
node_sel -
content -
isGlobalIndex -
Returns:

toPatchOpString

public java.lang.String toPatchOpString()
reutnrs a patch ops string for the xcap diff info

Returns:

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object