Class ArchiveImportSpecMode

java.lang.Object
com.orchestranetworks.service.ArchiveImportSpecMode

public class ArchiveImportSpecMode extends Object
Defines the strategy used for importing an archive.
See Also:
  • Field Details

    • DEFAULT

      public static final ArchiveImportSpecMode DEFAULT
      Default mode for importing archives. If the archive defines a change set, the mode CHANGESET is used. If the archive does not define a change set, the mode REPLACE is used.
    • REPLACE

      public static final ArchiveImportSpecMode REPLACE
      Replace mode for importing archives. For each dataset in the archive:
      • If the archive defines a change set, the import procedure will ignore the change set. In the case where the archive contains updates only, (that is, ArchiveExportSpec.isDifferencesWithMinimalContentsOnRight() returns true), the import procedure fails. Otherwise, the import will proceed as described below.
        1. if a dataset is defined in both the archive and in the current dataspace (identified by the same reference), this dataset is fully replaced (1);
        2. if a dataset is defined only in the archive and not in the current dataspace, the dataset is created and fully copied to the current dataspace.
        3. if a dataset is not defined in the archive but exists in the current dataspace, it remains unchanged.

      (1): The replacement respects the following rules, according to the definition modes in the source (the archive to be imported) and in the target (the current branch).

      Target record
      Not defined Root/overwrite Inherit Occulting
      Source record in Archive Not defined Not defined Target is deleted Target is deleted Target is deleted
      Root/overwrite Target becomes Root/overwrite Target becomes Root/overwrite Target becomes Root/overwrite Target becomes Root/overwrite
      Inherited Target becomes Inherited Target becomes Inherited Target becomes Inherited Target becomes Inherited
      Occulting Target becomes Occulting Target becomes Occulting Target becomes Occulting Target becomes Occulting
    • CHANGESET

      public static final ArchiveImportSpecMode CHANGESET
      Change set mode for importing archives. If the archive defines a change set, the import procedure will take it into account. For example, if the change set specifies a deletion, the dataset is deleted (if the dataset is defined in the current branch). If the archive does not define a change set, the import procedure will fail.
  • Method Details

    • isReplace

      public boolean isReplace()
    • isDefault

      public boolean isDefault()
    • isChangeSet

      public boolean isChangeSet()
    • getLabel

      public String getLabel()
    • toString

      public String toString()
      Overrides:
      toString in class Object