oracle.sysman.dbTarget.db.changemgr.emo.docaccess
Class ApplyOneDiffResult

java.lang.Object
  extended by oracle.sysman.dbTarget.db.changemgr.emo.docaccess.ApplyOneDiffResult

public class ApplyOneDiffResult
extends java.lang.Object

Encapsulates the result of applying one difference from a Diff SXML document to a target SXML document. XMLAccesor.applyDiffs() returns an array contining one of these objects for each difference applied. Clients that implement the ApplyDiffListener.applyDiffResult() method are called with an ApplyOneDiffResult object before each difference is applied, and may examine the conflict (if any) and accept or reject the difference.


Field Summary
static int CONFLICT_EXISTS_DIFFERENT
          Indicates that the item to be added already exists and is different, or the item to be removed is different
static int CONFLICT_EXISTS_SAME
          Indicates that the item to be added already exists and is the same (this may not be considered a conflict)
static int CONFLICT_MODIFIED_DIFFERENT
          Indicates that the item to be modified has already been modified to a different value
static int CONFLICT_MODIFIED_PREVIOUSLY
          Indicates that the item to be modified has already been modified to the old valuerecorded in the difference
static int CONFLICT_MODIFIED_SAME
          Indicates that the item to be modified has already been modified to the same value (this may not be considered a conflict)
static int CONFLICT_NONE
          Indicates that no conflict was detected
static int CONFLICT_NOT_EXIST
          Indicates that the item to be removed or modified does not exist
static int DIFF_ADD
          Indicates that the difference adds a subobject (such as a column, constraint, or optional section) to an object
static int DIFF_MODIFY
          Indicates that the difference modifies the value of an attribute
static int DIFF_NONE
          No difference (this is not normally seen)
static int DIFF_REMOVE
          Indicates that the difference removes a subobject (such as a column, constraint, or optional section) from an object
 
Constructor Summary
ApplyOneDiffResult(int diffType)
          Constructs an ApplyOneDiffResult object.with a default conflict type of CONFLICT_NONE.
ApplyOneDiffResult(int diffType, int conflictType)
          Constructs an ApplyOneDiffResult object.
 
Method Summary
 int getConflictType()
          Returns the conflict type.
 oracle.xml.parser.v2.XMLNode getDiffNode()
          Returns the difference node associated with the difference
 int getDiffType()
          Returns the difference type.
 boolean getDoChange()
          Indicate whether a difference should be applied or not.
 oracle.xml.parser.v2.XMLNode getTargetNode()
          Returns the target node associated with the apply-diff operation
 java.lang.String getXpath()
          Returns the xpath associated with the difference.
 void setConflictType(int conflictType)
          Sets the conflict type.
 void setDiffNode(oracle.xml.parser.v2.XMLNode node)
          Sets the difference node associated with the difference
 void setDoChange(boolean doIt)
          Called by the client to indicate whether a difference should be applied or not, in interactive conflict resolution.
 void setTargetNode(oracle.xml.parser.v2.XMLNode node)
          Sets the target node associated with the apply-diff operation
 void setXpath(java.lang.String xpath)
          Sets the xpath associated with the difference.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DIFF_NONE

public static final int DIFF_NONE
No difference (this is not normally seen)

See Also:
Constant Field Values

DIFF_REMOVE

public static final int DIFF_REMOVE
Indicates that the difference removes a subobject (such as a column, constraint, or optional section) from an object

See Also:
Constant Field Values

DIFF_ADD

public static final int DIFF_ADD
Indicates that the difference adds a subobject (such as a column, constraint, or optional section) to an object

See Also:
Constant Field Values

DIFF_MODIFY

public static final int DIFF_MODIFY
Indicates that the difference modifies the value of an attribute

See Also:
Constant Field Values

CONFLICT_NONE

public static final int CONFLICT_NONE
Indicates that no conflict was detected

See Also:
Constant Field Values

CONFLICT_NOT_EXIST

public static final int CONFLICT_NOT_EXIST
Indicates that the item to be removed or modified does not exist

See Also:
Constant Field Values

CONFLICT_EXISTS_SAME

public static final int CONFLICT_EXISTS_SAME
Indicates that the item to be added already exists and is the same (this may not be considered a conflict)

See Also:
Constant Field Values

CONFLICT_EXISTS_DIFFERENT

public static final int CONFLICT_EXISTS_DIFFERENT
Indicates that the item to be added already exists and is different, or the item to be removed is different

See Also:
Constant Field Values

CONFLICT_MODIFIED_SAME

public static final int CONFLICT_MODIFIED_SAME
Indicates that the item to be modified has already been modified to the same value (this may not be considered a conflict)

See Also:
Constant Field Values

CONFLICT_MODIFIED_DIFFERENT

public static final int CONFLICT_MODIFIED_DIFFERENT
Indicates that the item to be modified has already been modified to a different value

See Also:
Constant Field Values

CONFLICT_MODIFIED_PREVIOUSLY

public static final int CONFLICT_MODIFIED_PREVIOUSLY
Indicates that the item to be modified has already been modified to the old valuerecorded in the difference

See Also:
Constant Field Values
Constructor Detail

ApplyOneDiffResult

public ApplyOneDiffResult(int diffType,
                          int conflictType)
Constructs an ApplyOneDiffResult object.

Parameters:
diffType - One of:
  • DIFF_REMOVE
  • DIFF_ADD
  • DIFF_MODIFY
conflictType - One of:
  • CONFLICT_NONE
  • CONFLICT_NOT_EXIST
  • CONFLICT_EXISTS_SAME
  • CONFLICT_EXISTS_DIFFERENT
  • CONFLICT_MODIFIED_SAME
  • CONFLICT_MODIFIED_DIFFERENT
  • CONFLICT_MODIFIED_PREVIOUSLY

ApplyOneDiffResult

public ApplyOneDiffResult(int diffType)
Constructs an ApplyOneDiffResult object.with a default conflict type of CONFLICT_NONE.

Parameters:
diffType - One of:
  • DIFF_REMOVE
  • DIFF_ADD
  • DIFF_MODIFY
Method Detail

getDiffType

public int getDiffType()
Returns the difference type.

Returns:
One of:
  • DIFF_REMOVE
  • DIFF_ADD
  • DIFF_MODIFY

setConflictType

public void setConflictType(int conflictType)
Sets the conflict type.

Parameters:
conflictType - One of:
  • CONFLICT_NONE
  • CONFLICT_NOT_EXIST
  • CONFLICT_EXISTS_SAME
  • CONFLICT_EXISTS_DIFFERENT
  • CONFLICT_MODIFIED_SAME
  • CONFLICT_MODIFIED_DIFFERENT
  • CONFLICT_MODIFIED_PREVIOUSLY

getConflictType

public int getConflictType()
Returns the conflict type.

Returns:
One of:
  • CONFLICT_NONE
  • CONFLICT_NOT_EXIST
  • CONFLICT_EXISTS_SAME
  • CONFLICT_EXISTS_DIFFERENT
  • CONFLICT_MODIFIED_SAME
  • CONFLICT_MODIFIED_DIFFERENT
  • CONFLICT_MODIFIED_PREVIOUSLY

setXpath

public void setXpath(java.lang.String xpath)
Sets the xpath associated with the difference.

Parameters:
xpath - the xpath

getXpath

public java.lang.String getXpath()
Returns the xpath associated with the difference.

Returns:
the xpath

setDiffNode

public void setDiffNode(oracle.xml.parser.v2.XMLNode node)
Sets the difference node associated with the difference

Parameters:
node - the difference node

getDiffNode

public oracle.xml.parser.v2.XMLNode getDiffNode()
Returns the difference node associated with the difference

Returns:
the difference node

setTargetNode

public void setTargetNode(oracle.xml.parser.v2.XMLNode node)
Sets the target node associated with the apply-diff operation

Parameters:
node - the target node

getTargetNode

public oracle.xml.parser.v2.XMLNode getTargetNode()
Returns the target node associated with the apply-diff operation

Returns:
the target node

setDoChange

public void setDoChange(boolean doIt)
Called by the client to indicate whether a difference should be applied or not, in interactive conflict resolution.

Parameters:
doIt - true if the change should be applied, false if it should not be applied.

getDoChange

public boolean getDoChange()
Indicate whether a difference should be applied or not. This value is initially set based on conflict detection. If the client changes it to true, Change Manager will apply the difference to the target regardless of any detected conflict.


toString

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