You are here

interface RepositoryHandlerInterface in Workspace 8.2

RepositoryHandler plugins handle content replication.

The replication will use data from the target repository handler plugin to merge the content between the source and the target. For example an internal replication might just need the workspace IDs, but a contrib module performing an external replication may need hostname, port, username, password etc.

Hierarchy

Expanded class hierarchy of RepositoryHandlerInterface

All classes that implement RepositoryHandlerInterface

2 files declare their use of RepositoryHandlerInterface
LiveRepositoryHandler.php in src/Plugin/RepositoryHandler/LiveRepositoryHandler.php
NullRepositoryHandler.php in src/Plugin/RepositoryHandler/NullRepositoryHandler.php

File

src/RepositoryHandlerInterface.php, line 17

Namespace

Drupal\workspace
View source
interface RepositoryHandlerInterface extends PluginInspectionInterface, DerivativeInspectionInterface {

  /**
   * Indicate that an item has been updated both on the source and the target.
   *
   * @var int
   */
  const CONFLICT_UPDATE_ON_CHANGE = 1;

  /**
   * Indicate that an item updated on the source has been deleted on the target.
   *
   * @var int
   */
  const CONFLICT_UPDATE_ON_DELETE = 2;

  /**
   * Indicate that an item deleted on the source has been changed on the target.
   *
   * @var int
   */
  const CONFLICT_DELETE_ON_CHANGE = 3;

  /**
   * Returns the label of the repository handler.
   *
   * This is used as a form label where a user selects the replication target.
   *
   * @return string
   *   The label text, which could be a plain string or an object that can be
   *   cast to a string.
   */
  public function getLabel();

  /**
   * Returns the repository handler plugin description.
   *
   * @return string
   *   The description text, which could be a plain string or an object that can
   *   be cast to a string.
   */
  public function getDescription();

  /**
   * Pushes content from a source repository to a target repository.
   */
  public function push();

  /**
   * Pulls content from a target repository to a source repository.
   */
  public function pull();

  /**
   * Checks if there are any conflicts between the source and the target.
   *
   * @return array
   *   Returns an array consisting of the number of conflicts between the source
   *   and the target, keyed by the conflict type constant.
   */
  public function checkConflictsOnTarget();

  /**
   * Gets the revision identifiers for items which have changed on the target.
   *
   * @return array
   *   A multidimensional array of revision identifiers, either the revision ID
   *   or the revision UUID, keyed by entity type IDs.
   *
   * @todo Update the return values to be only UUIDs and revision UUIDs in
   *   https://www.drupal.org/node/2958752
   */
  public function getDifferringRevisionIdsOnTarget();

  /**
   * Gets the revision identifiers for items which have changed on the source.
   *
   * @return array
   *   A multidimensional array of revision identifiers, either the revision ID
   *   or the revision UUID, keyed by entity type IDs.
   *
   * @todo Update the return values to be only UUIDs and revision UUIDs in
   *   https://www.drupal.org/node/2958752
   */
  public function getDifferringRevisionIdsOnSource();

  /**
   * Gets the total number of items which have changed on the target.
   *
   * This returns the aggregated changes count across all entity types.
   * For example, if two nodes and one taxonomy term have changed on the target,
   * the return value is 3.
   *
   * @return int
   *   The number of differing revisions.
   */
  public function getNumberOfChangesOnTarget();

  /**
   * Gets the total number of items which have changed on the source.
   *
   * This returns the aggregated changes count across all entity types.
   * For example, if two nodes and one taxonomy term have changed on the source,
   * the return value is 3.
   *
   * @return int
   *   The number of differing revisions.
   */
  public function getNumberOfChangesOnSource();

}

Members

Namesort descending Modifiers Type Description Overrides
DerivativeInspectionInterface::getBaseId public function Gets the base_plugin_id of the plugin instance. 1
DerivativeInspectionInterface::getDerivativeId public function Gets the derivative_id of the plugin instance. 1
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 4
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2
RepositoryHandlerInterface::checkConflictsOnTarget public function Checks if there are any conflicts between the source and the target. 2
RepositoryHandlerInterface::CONFLICT_DELETE_ON_CHANGE constant Indicate that an item deleted on the source has been changed on the target.
RepositoryHandlerInterface::CONFLICT_UPDATE_ON_CHANGE constant Indicate that an item has been updated both on the source and the target.
RepositoryHandlerInterface::CONFLICT_UPDATE_ON_DELETE constant Indicate that an item updated on the source has been deleted on the target.
RepositoryHandlerInterface::getDescription public function Returns the repository handler plugin description. 2
RepositoryHandlerInterface::getDifferringRevisionIdsOnSource public function Gets the revision identifiers for items which have changed on the source. 2
RepositoryHandlerInterface::getDifferringRevisionIdsOnTarget public function Gets the revision identifiers for items which have changed on the target. 2
RepositoryHandlerInterface::getLabel public function Returns the label of the repository handler. 2
RepositoryHandlerInterface::getNumberOfChangesOnSource public function Gets the total number of items which have changed on the source. 2
RepositoryHandlerInterface::getNumberOfChangesOnTarget public function Gets the total number of items which have changed on the target. 2
RepositoryHandlerInterface::pull public function Pulls content from a target repository to a source repository. 2
RepositoryHandlerInterface::push public function Pushes content from a source repository to a target repository. 2