Decision Center API

ilog.rules.teamserver.model
Class IlrCommitableObject

java.lang.Object
  extended by ilog.rules.teamserver.model.IlrCommitableObject
All Implemented Interfaces:
ilog.rules.teamserver.model.IlrCompositeObject, Serializable

public class IlrCommitableObject
extends Object
implements Serializable, ilog.rules.teamserver.model.IlrCompositeObject

Holds an element to commit in the database along with its details and/or a list of its contained elements to add or delete during the commit.

This allows you to commit a complete root element, that is, its details and its contained elements (elements in relationship with the root element through a containment reference EReference.isContainment()).

See Also:
IlrSession.commit(IlrCommitableObject), Serialized Form

Constructor Summary
IlrCommitableObject(IlrElementHandle rootElement)
          Creates a commitable object.
 
Method Summary
 void addDeletedElement(org.eclipse.emf.ecore.EReference reference, IlrElementDetails containedDetails)
          Adds a contained element to delete upon commit.
 void addModifiedElement(org.eclipse.emf.ecore.EReference reference, IlrElementDetails containedDetails)
          Adds a contained element to commit together with the root element.
 boolean equals(Object o)
          Indicates whether some other committable object is "equal to" this one.
 String getComment()
          Gets the comment that will be associated with the commit.
 Object getDeletedElement(org.eclipse.emf.ecore.EReference reference)
          Deprecated. : use getMonoValuedDeletedElement or getMultiValuedDeletedElement instead. Gets the contained element or the set of contained elements to delete.

 IlrElementDetails getDetails()
           
 Object getFromReference(org.eclipse.emf.ecore.EReference reference)
           
 Object getModifiedElement(org.eclipse.emf.ecore.EReference reference)
          Deprecated. : use getMonoValuedModifiedElement or getMultiValuedModifiedElement instead. Gets the contained element or the set of contained elements to commit together with the root element.

 IlrElementDetails getMonoValuedDeletedElement(org.eclipse.emf.ecore.EReference reference)
          Gets the contained element for given reference to delete.
 IlrElementDetails getMonoValuedFromReference(org.eclipse.emf.ecore.EReference reference)
           
 IlrElementDetails getMonoValuedModifiedElement(org.eclipse.emf.ecore.EReference reference)
          Gets the contained element for given reference to commit together with the root element.
 Set<IlrElementDetails> getMultiValuedDeletedElement(org.eclipse.emf.ecore.EReference reference)
          Gets the set of contained element for given reference to delete.
 List<IlrElementDetails> getMultiValuedFromReference(org.eclipse.emf.ecore.EReference reference)
           
 Set<IlrElementDetails> getMultiValuedModifiedElement(org.eclipse.emf.ecore.EReference reference)
          Gets the set of contained elements for given reference to commit together with the root element.
 IlrElementDetails getRootDetails()
          Gets the details to commit for the root element
 IlrElementHandle getRootElementHandle()
          Gets the handle on the root element to commit.
 int hashCode()
           
 boolean isUpdateMajorVersion()
          Indicates whether the commit must update the major version of the element or not.
 void setComment(String comment)
          Sets the comment that will be associated with the commit.
 void setRootDetails(IlrElementDetails rootDetails)
          Sets the details to commit for the root element.
 void setUpdateMajorVersion(boolean updateMajorVersion)
          Deprecated. should customize IlrSessionController.getNextVersion(). Indicates whether the commit must update the major version of the element or not.

 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlrCommitableObject

public IlrCommitableObject(IlrElementHandle rootElement)
Creates a commitable object.

Parameters:
rootElement - Handle on the root element that is going to be committed.
Method Detail

getRootElementHandle

public IlrElementHandle getRootElementHandle()
Gets the handle on the root element to commit.

Returns:
A handle on the root element.

getComment

public String getComment()
Gets the comment that will be associated with the commit.

Returns:
A string, or null if no comment has been set.

setComment

public void setComment(String comment)
Sets the comment that will be associated with the commit.

Parameters:
comment - Any string.

isUpdateMajorVersion

public boolean isUpdateMajorVersion()
Indicates whether the commit must update the major version of the element or not.

Returns:
True if the major version will be updated. If false, the minor version will be updated instead. By default, this method returns false.

setUpdateMajorVersion

public void setUpdateMajorVersion(boolean updateMajorVersion)
Deprecated. should customize IlrSessionController.getNextVersion(). Indicates whether the commit must update the major version of the element or not.

Parameters:
updateMajorVersion - True if the major version needs to be updated; false to update the minor version.

setRootDetails

public void setRootDetails(IlrElementDetails rootDetails)
Sets the details to commit for the root element.

Parameters:
rootDetails - The IlrElementDetails to commit.

getRootDetails

public IlrElementDetails getRootDetails()
Gets the details to commit for the root element

Returns:
IlrElementDetails to commit.

getDeletedElement

public Object getDeletedElement(org.eclipse.emf.ecore.EReference reference)
Deprecated. : use getMonoValuedDeletedElement or getMultiValuedDeletedElement instead. Gets the contained element or the set of contained elements to delete.

Parameters:
reference - A containment reference (EReference.isContainment()).
Returns:
An IlrElementDetails if the reference is unary or a set of IlrElementDetails otherwise (ETypedElement.isMany()).

getMonoValuedDeletedElement

public IlrElementDetails getMonoValuedDeletedElement(org.eclipse.emf.ecore.EReference reference)
Gets the contained element for given reference to delete.

Parameters:
reference - An unary containment reference (EReference.isContainment()).
Returns:
An IlrElementDetails if the reference is unary or a set of IlrElementDetails otherwise (ETypedElement.isMany()).

getMultiValuedDeletedElement

public Set<IlrElementDetails> getMultiValuedDeletedElement(org.eclipse.emf.ecore.EReference reference)
Gets the set of contained element for given reference to delete.

Parameters:
reference - A multi-valued containment reference (EReference.isContainment()).
Returns:
An IlrElementDetails if the reference is unary or a set of IlrElementDetails otherwise (ETypedElement.isMany()).

getModifiedElement

public Object getModifiedElement(org.eclipse.emf.ecore.EReference reference)
Deprecated. : use getMonoValuedModifiedElement or getMultiValuedModifiedElement instead. Gets the contained element or the set of contained elements to commit together with the root element.

Parameters:
reference - A containment reference (EReference.isContainment()).
Returns:
An IlrElementDetails if the reference is unary or a set of IlrElementDetails otherwise (ETypedElement.isMany()).

getMonoValuedModifiedElement

public IlrElementDetails getMonoValuedModifiedElement(org.eclipse.emf.ecore.EReference reference)
Gets the contained element for given reference to commit together with the root element.

Parameters:
reference - An unary containment reference (EReference.isContainment()).
Returns:
An IlrElementDetails if the reference is unary or a set of IlrElementDetails otherwise (ETypedElement.isMany()).

getMultiValuedModifiedElement

public Set<IlrElementDetails> getMultiValuedModifiedElement(org.eclipse.emf.ecore.EReference reference)
Gets the set of contained elements for given reference to commit together with the root element.

Parameters:
reference - A multi-valued containment reference (EReference.isContainment()).
Returns:
A set of IlrElementDetails otherwise (ETypedElement.isMany()).

addModifiedElement

public void addModifiedElement(org.eclipse.emf.ecore.EReference reference,
                               IlrElementDetails containedDetails)
Adds a contained element to commit together with the root element.

Parameters:
reference - A containment reference (EReference.isContainment()).
containedDetails - Details of the contained element to commit.

addDeletedElement

public void addDeletedElement(org.eclipse.emf.ecore.EReference reference,
                              IlrElementDetails containedDetails)
Adds a contained element to delete upon commit.

Parameters:
reference - A containment reference (EReference.isContainment()).
containedDetails - Details of the contained element to delete upon commit.

equals

public boolean equals(Object o)
Indicates whether some other committable object is "equal to" this one.

Overrides:
equals in class Object
Parameters:
o - The object to compare with this.
Returns:
true If both committable objects reference the same element handle.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getDetails

public IlrElementDetails getDetails()
Specified by:
getDetails in interface ilog.rules.teamserver.model.IlrCompositeObject

getFromReference

public Object getFromReference(org.eclipse.emf.ecore.EReference reference)
Specified by:
getFromReference in interface ilog.rules.teamserver.model.IlrCompositeObject

getMonoValuedFromReference

public IlrElementDetails getMonoValuedFromReference(org.eclipse.emf.ecore.EReference reference)

getMultiValuedFromReference

public List<IlrElementDetails> getMultiValuedFromReference(org.eclipse.emf.ecore.EReference reference)

Decision Center API

© Copyright IBM Corp. 1987, 2013