Class VersionedOwnership

  • All Implemented Interfaces:
    ExternalizableLite, PortableObject, Serializable, Cloneable

    public class VersionedOwnership
    extends Ownership
    An extension of the partition Ownership object which also carries a change version. Ownership versions are used to track changes in the primary ownership rather than the contents of a partition.

    Note: A change in the primary ownership necessitates an increment to the partition version, however a change to the backup ownership does not. Thus (1,2) -> (3,2) does require a version increment but (1,2) -> (1,3) does not.

    Since:
    Coherence 12.1.3
    Author:
    rhl 2013.08.19
    See Also:
    Serialized Form
    • Field Detail

      • m_nVersion

        protected int m_nVersion
        The ownership version.
    • Constructor Detail

      • VersionedOwnership

        public VersionedOwnership()
        Default constructor (needed for serialization).
      • VersionedOwnership

        public VersionedOwnership​(int cBackups,
                                  int nVersion)
        Constructs a VersionedOwnership with the provided backup count and version.
        Parameters:
        cBackups - the number of backups
        nVersion - the version of this VersionedOwnership
      • VersionedOwnership

        public VersionedOwnership​(VersionedOwnership that)
        Copy constructor.
        Parameters:
        that - the VersionedOwnership to copy from
    • Method Detail

      • getVersion

        public int getVersion()
        Return the ownership version.
        Returns:
        the ownership version
      • setVersion

        public void setVersion​(int nVersion)
        Set the new ownership version.
        Parameters:
        nVersion - the ownership version
      • getDescription

        public String getDescription()
        Return a human-readable description of this Ownership.
        Overrides:
        getDescription in class Ownership
        Returns:
        a human-readable description
      • clone

        public Object clone()
        Create a clone of this Ownership.
        Overrides:
        clone in class Ownership
        Returns:
        a clone of the Ownership object
      • equals

        public boolean equals​(Object o)
        Indicates whether some other object is "equal to" this one.
        Overrides:
        equals in class Ownership
        Parameters:
        o - the object to test for equality
        Returns:
        true if this object is the same as the given one; false otherwise.
      • readExternal

        public void readExternal​(DataInput in)
                          throws IOException
        Restore the contents of this object by loading the object's state from the passed DataInput object.
        Specified by:
        readExternal in interface ExternalizableLite
        Overrides:
        readExternal in class Ownership
        Parameters:
        in - the DataInput stream to read data from in order to restore the state of this object
        Throws:
        IOException - if an I/O exception occurs
        NotActiveException - if the object is not in its initial state, and therefore cannot be deserialized into
      • readExternal

        public void readExternal​(PofReader in)
                          throws IOException
        Restore the contents of a user type instance by reading its state using the specified PofReader object.
        Specified by:
        readExternal in interface PortableObject
        Overrides:
        readExternal in class Ownership
        Parameters:
        in - the PofReader from which to read the object's state
        Throws:
        IOException - if an I/O error occurs
      • writeExternal

        public void writeExternal​(PofWriter out)
                           throws IOException
        Save the contents of a POF user type instance by writing its state using the specified PofWriter object.
        Specified by:
        writeExternal in interface PortableObject
        Overrides:
        writeExternal in class Ownership
        Parameters:
        out - the PofWriter to which to write the object's state
        Throws:
        IOException - if an I/O error occurs