Class AdaptationHome

java.lang.Object
com.onwbp.adaptation.AdaptationHome

public final class AdaptationHome extends Object
Represents a dataspace or a snapshot in a repository.

Note: In previous versions, a dataspace was known as a branch, and a snapshot was known as a version.

See Also:
  • Method Details

    • findAdaptationOrNull

      public Adaptation findAdaptationOrNull(AdaptationName aName)
      Returns the specified dataset or record based on its AdaptationName. Returns null if it cannot be found.
      See Also:
    • findParent

      @Deprecated public Adaptation findParent(Adaptation aDataSetOrRecord)
      Deprecated.
    • findAllChildren

      public List<Adaptation> findAllChildren(Adaptation aDataSetOrRecord)
      Returns a list of all datasets or records that are direct children of the one specified.
    • findAllDescendants

      public List<Adaptation> findAllDescendants(Adaptation aDataSetOrRecord)
      Returns a list of all the datasets and records that inherit from the one specified, either as direct children or as descendants (recursive).
    • findAllRoots

      public List<Adaptation> findAllRoots()
      Returns all the dataset roots of this AdaptationHome.
      See Also:
    • getKey

      public HomeKey getKey()
      Returns the key that identifies this dataspace or snapshot in the current repository.
    • getOwner

      public Profile getOwner()
      Returns the owner profile of this dataspace or snapshot in the current repository.
    • getCreator

      public Profile getCreator()
      Returns the creator profile of this dataspace or snapshot in the current repository.

      Returns null if no creator is defined. For example, technical reserved branches are created by the 'System User'.

    • getLabel

      public UserMessage getLabel()
      Returns the internationalized label of this dataspace or snapshot.

      Returns null if no labels are defined in any language.

    • getLabel

      public String getLabel(Locale aLocale)
      Returns the label of this dataspace or snapshot for a given locale. Returns null if no label is defined for the locale provided.
    • getLabelOrName

      public String getLabelOrName(Locale aLocale)
      Returns the label of this dataspace or snapshot for a given locale. Returns the key name if no label is defined for the locale provided.
    • getLabelOrNameAsUserMessage

      public UserMessage getLabelOrNameAsUserMessage()
      Returns the internationalized label of this dataspace or snapshot. Returns the key name if no labels are defined in any locale.
    • getDescription

      public UserMessage getDescription()
      Returns the internationalized description of this dataspace or snapshot.

      Returns null if no descriptions are defined in any language.

    • getDescription

      public String getDescription(Locale aLocale)
      Returns the description of this dataspace or snapshot for a given locale. Returns null if no description is defined for the locale provided.
    • getCreationDate

      public Date getCreationDate()
      Returns the creation date of this dataspace or snapshot.
    • getTerminationDate

      public Date getTerminationDate()
      Returns the date this dataspace or snapshot was closed, if it is closed.

      Returns null if the dataspace or snapshot is open.

    • getParent

      public AdaptationHome getParent()
      Returns the parent dataspace of this AdaptationHome. Returns null if this is the reference dataspace.

      For a dataspace, its parent is always its initial snapshot. For a snapshot, its parent is always its parent dataspace.

    • getParentBranch

      public AdaptationHome getParentBranch()
      Returns the parent dataspace or snapshot of this AdaptationHome. Returns null if this AdaptationHome is the reference dataspace.

      Note: For a dataspace, its direct parent is its initial snapshot, hence its parent dataspace is the parent of this initial snapshot. For a snapshot, its parent dataspace is its direct parent.

      See Also:
    • getBranchChildren

      public List<AdaptationHome> getBranchChildren()
      Returns the dataspaces which have been created from this AdaptationHome.

      Note: A dataspace has no direct dataspace children; when a dataspace is created from another dataspace, first an initial snapshot is created, then the new dataspace is created from this initial snapshot.

      See Also:
    • getVersionChildren

      public List<AdaptationHome> getVersionChildren()
      Returns the snapshots which have been created from this AdaptationHome.

      A snapshot is always created from a dataspace.

      See Also:
    • getRepository

      public Repository getRepository()
      Returns the repository that contains this AdaptationHome.
    • isBranch

      public boolean isBranch()
      Returns true if this AdaptationHome is a dataspace.
    • isBranchReference

      public boolean isBranchReference()
      Returns true if this AdaptationHome is the reference dataspace.
    • isOpenBranch

      public boolean isOpenBranch()
      Returns true if this AdaptationHome is an open dataspace.
    • isOpenVersion

      public boolean isOpenVersion()
      Returns true if this AdaptationHome is an open snapshot.
    • isOpen

      public boolean isOpen()
      Returns true if this AdaptationHome is either an open snapshot or an open dataspace.
    • isLockedBranch

      public boolean isLockedBranch()
      Returns true if this AdaptationHome is a locked dataspace.
      See Also:
    • isMarkedForPurge

      @Deprecated public boolean isMarkedForPurge()
      Deprecated.
      Always returns false.
      See Also:
    • isMarkedForHistoryPurge

      public boolean isMarkedForHistoryPurge()
      Returns true if this AdaptationHome is marked for history purge.
      See Also:
    • isAncestorOf

      public boolean isAncestorOf(AdaptationHome anotherHome)
      Returns true if this AdaptationHome is an ancestor of the specified AdaptationHome (the AdaptationHome itself is excluded).
    • isVersion

      public boolean isVersion()
      Returns true if this AdaptationHome is a snapshot.
    • isInitialVersion

      public boolean isInitialVersion()
      Returns true if this AdaptationHome is an initial snapshot of a dataspace.

      When a dataspace is created from another dataspace, first an initial snapshot is created, then the new dataspace is created from this initial snapshot.

      See Also:
    • toDisplayString

      public final String toDisplayString(Locale aLocale)
      Returns a user-friendly string that specifies the type of this object, for example, "Dataspace <key>" or "Snapshot <key>".
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getValidationReportsMap

      public Map<AdaptationName,ValidationReport> getValidationReportsMap(Severity minimalSeverity)
      Returns a map of all validation reports of datasets in this AdaptationHome that have at least one validation item of the specified severity or higher.

      Since this method calls Adaptation.getValidationReport(false) on each dataset, it does not require the datasets to be activated.

      The rules for ensuring that data in EBX® remains valid, with respect to potential concurrent updates, are explained in section Consistency and validation.

      Returns:
      a map whose keys are AdaptationNames and values ValidationReports
      See Also:
    • resetValidationReports

      public final void resetValidationReports()
      Resets the validation reports of the datasets contained in this dataspace.
      Since:
      5.9.0
      See Also:
    • isTechnicalBranch

      public final boolean isTechnicalBranch()
      Returns true if this AdaptationHome is a technical dataspace. A technical dataspace is used internally used by EBX®, and cannot be closed or merged.
    • isTechnicalVersion

      public final boolean isTechnicalVersion()
      Returns true if this AdaptationHome is a technical snapshot. A snapshot is technical if it is a snapshot of a technical dataspace.
      See Also: