Class MergeSession

java.lang.Object
com._1c.g5.v8.dt.internal.merge.MergeSession
All Implemented Interfaces:
IMergeSession

public class MergeSession extends Object implements IMergeSession
The internal implementation of the merge session.
  • Constructor Details

    • MergeSession

      public MergeSession(ComparisonSession comparisonSession, ILibraryRegistry libraryRegistry, boolean ignoreNonBlockingProblems)
      Constructs a merge session.
      Parameters:
      comparisonSession - the comparison session on which the constructed merge session will be based, not null
      libraryRegistry - the library registry, not null
      ignoreNonBlockingProblems - defines should we ignore non-blocking problems at the validation stage or not
  • Method Details

    • getBmModel

      public IBmModel getBmModel()
      Description copied from interface: IMergeSession
      Returns the BM model.
      Specified by:
      getBmModel in interface IMergeSession
      Returns:
      the BM model, never null
    • getComparisonSession

      public ComparisonSession getComparisonSession()
      Description copied from interface: IMergeSession
      Returns the comparison session this merge session is based on.
      Specified by:
      getComparisonSession in interface IMergeSession
      Returns:
      the comparison session, never null
    • getImportedObjectId

      public Long getImportedObjectId(ComparisonNode node)
      Description copied from interface: IMergeSession
      Returns the id of the imported BM object registered for the specified node.
      Specified by:
      getImportedObjectId in interface IMergeSession
      Parameters:
      node - the node to get the id of the BM object imported and registered for it
      Returns:
      the imported object id or null
    • getImportedObjectSymlink

      public String getImportedObjectSymlink(String otherSymlink)
      Description copied from interface: IMergeSession
      In case when a partial other datasource object is to be merged according to current settings, returns the symbolic link of the object in terms of the main datasource, or null if the other object will not be imported.
      Specified by:
      getImportedObjectSymlink in interface IMergeSession
      Parameters:
      otherSymlink - the symbolic link of the other object, not null
      Returns:
      a main symlink or null (if not imported)
    • getMainDataSource

      public IActiveComparisonDataSource getMainDataSource()
      Description copied from interface: IMergeSession
      Returns the main data source of the session.
      Specified by:
      getMainDataSource in interface IMergeSession
      Returns:
      the main data source, never null
    • getMainRuntimeVersion

      public Version getMainRuntimeVersion()
      Description copied from interface: IMergeSession
      Returns the runtime version of the main datasource.
      Specified by:
      getMainRuntimeVersion in interface IMergeSession
      Returns:
      main datasource runtime version, never null
    • registerImportedObject

      public void registerImportedObject(ComparisonNode node, IBmObject importedEmfObject)
      Description copied from interface: IMergeSession
      Registers a BM object imported during the merge of the specified node.
      Specified by:
      registerImportedObject in interface IMergeSession
      Parameters:
      node - the node for which to register the imported object
      importedEmfObject - the imported BM object
    • registerRenamingObject

      public void registerRenamingObject(SymlinkComparisonNode node, String newSymlink)
      Description copied from interface: IMergeSession
      Registers a new symbolic link of the object to be renamed during the merge process.
      Specified by:
      registerRenamingObject in interface IMergeSession
      Parameters:
      node - the comparison node related to the renaming object, cannot be null
      newSymlink - the new symbolic link the object will have after renaming, cannot be null or empty
    • getMainSymlink

      public String getMainSymlink(SymlinkComparisonNode node)
      Description copied from interface: IMergeSession
      Gets actual symbolic link (a.k.a. FQN) of the object from the MAIN side during the merge process. The FQN can be changed if the object is going to be renamed, so all participants have to use this method during the merge phase to obtain actual symbolic link instead of direct ComparisonNode#getMainSymlink() method.
      Specified by:
      getMainSymlink in interface IMergeSession
      Parameters:
      node - the comparison node related to the object to get main symbolic link for, cannot be null
      Returns:
      the actual symbolic link or null if there is no object from the MAIN side
    • registerRenamingObjectSymlink

      public void registerRenamingObjectSymlink(String currentSymlink, String newSymlink)
      Description copied from interface: IMergeSession
      Registers a new symbolic link of the object to be renamed during the merge process.
      Specified by:
      registerRenamingObjectSymlink in interface IMergeSession
      Parameters:
      currentSymlink - the object symlink before rename operation, cannot be null
      newSymlink - the object symlink after rename operation, cannot be null
    • getRenamingObjectNewSymlink

      public String getRenamingObjectNewSymlink(String symlinkBeforeRename)
      Description copied from interface: IMergeSession
      Gets symbolic link of a renaming object after rename operation finish, if it registered by IMergeSession.registerRenamingObjectSymlink(String, String).
      Specified by:
      getRenamingObjectNewSymlink in interface IMergeSession
      Parameters:
      symlinkBeforeRename - the object's symbolic link before renaming, cannot be null
      Returns:
      the actual object's symbolic link after renaming, may be null
    • addPostponedFileOperation

      public void addPostponedFileOperation(IPostponedFileOperation operation)
      Description copied from interface: IMergeSession
      Adds a postponed file operation.
      Specified by:
      addPostponedFileOperation in interface IMergeSession
      Parameters:
      operation - the postponed file operation, cannot be null
    • getPostponedFileOperations

      public List<IPostponedFileOperation> getPostponedFileOperations()
      Description copied from interface: IMergeSession
      Gets the list of postponed file operations in the order of addition.
      Specified by:
      getPostponedFileOperations in interface IMergeSession
      Returns:
      the list of postponed file operations, never null
    • getLibraryDescriptorChangeType

      public LibraryDescriptorChangeType getLibraryDescriptorChangeType()
      Description copied from interface: IMergeSession
      Returns the library descriptor change type during the merge.
      Specified by:
      getLibraryDescriptorChangeType in interface IMergeSession
      Returns:
      the library descriptor change type, never null
    • isIgnoreNonBlockingProblems

      public boolean isIgnoreNonBlockingProblems()
      Description copied from interface: IMergeSession
      Checks should we ignore non-blocking problems during validation or not
      Specified by:
      isIgnoreNonBlockingProblems in interface IMergeSession
      Returns:
      true if we should ignore non-blocking problems during validation and false if not
    • addConflictingUuid

      public void addConflictingUuid(UUID uuid)
      Description copied from interface: IMergeSession
      Should be used at the validation merge stage to save info about duplicate (conflicting) UUID
      Specified by:
      addConflictingUuid in interface IMergeSession
      Parameters:
      uuid - UUID that several objects have at once, cannot be null
    • isConflictingUuid

      public boolean isConflictingUuid(UUID uuid)
      Description copied from interface: IMergeSession
      Checks that the current UUID saved in IMergeSession as a duplicate or not, should be used at the merge stage
      Specified by:
      isConflictingUuid in interface IMergeSession
      Parameters:
      uuid - UUID to check that it is saved as conflicting, cannot be null
      Returns:
      true if UUID saved as conflicting and false if not
    • removeConflictingUuid

      public void removeConflictingUuid(UUID uuid)
      Description copied from interface: IMergeSession
      Removes the current UUID from saved as duplicate, should be used after resolving UUID conflict at the merge stage
      Specified by:
      removeConflictingUuid in interface IMergeSession
      Parameters:
      uuid - UUID for which conflict is resolved, cannot be null
    • hasConflictingUuids

      public boolean hasConflictingUuids()
      Description copied from interface: IMergeSession
      Checks if there are any conflicting UUIDs left in the IMergeSession
      Specified by:
      hasConflictingUuids in interface IMergeSession
      Returns:
      true if any conflicting UUIDs saved in IMergeSession and false if not