You are here

interface AcquiaPurgeExecutorInterface in Acquia Purge 7

Describes an executor, which is responsible for taking a set of invalidation objects and wiping these paths/URLs from an external cache.

Hierarchy

Expanded class hierarchy of AcquiaPurgeExecutorInterface

All classes that implement AcquiaPurgeExecutorInterface

File

lib/executor/AcquiaPurgeExecutorInterface.php, line 12
Contains AcquiaPurgeExecutorInterface.

View source
interface AcquiaPurgeExecutorInterface {

  /**
   * Construct an executor object.
   *
   * @param AcquiaPurgeService $service
   *   The Acquia Purge service.
   */
  public function __construct(AcquiaPurgeService $service);

  /**
   * Get a unique identifier for this executor.
   *
   * @return string
   */
  public function getId();

  /**
   * Instantiate a new request object.
   *
   * @param string $uri
   *   The URL to connect to, e.g.: http://domain.com/path/a/b/c
   *
   * @return AcquiaPurgeExecutorRequestInterface
   */
  public function getRequest($uri = NULL);

  /**
   * Invalidate one or multiple paths from an external layer.
   *
   * This method is responsible for clearing all the given invalidation objects
   * from the external cache layer this executor covers. Executors decide /how/
   * they clear something, as long as they correctly call ::setStatusSucceeded()
   * or ::setStatusFailed() on each processed object.
   *
   * @param AcquiaPurgeInvalidationInterface[] $invalidations
   *   Unassociative list of AcquiaPurgeInvalidationInterface-compliant objects
   *   that contain the necessary info in them. You may likely need several of
   *   the following methods on the invalidation object:
   *     - ::getScheme(): e.g.: 'https' or 'https://' when passing TRUE.
   *     - ::getDomain(): e.g.: 'site.com'
   *     - ::getPath(): e.g.: '/basepath/products/electrical/*'
   *     - ::getUri(): e.g.: 'https://site.com/basepath/products/electrical/*'
   *     - ::hasWildcard(): call this to find out if there's a asterisk ('*').
   *     - ::setStatusFailed(): call this when clearing this item failed.
   *     - ::setStatusSucceeded(): call this when clearing this item succeeded.
   */
  public function invalidate($invalidations);

  /**
   * Determine if the executor is enabled or not.
   *
   * @param AcquiaPurgeService $service
   *   The Acquia Purge service.
   */
  public static function isEnabled(AcquiaPurgeService $service);

  /**
   * Execute a series of HTTP requests efficiently through cURL's multi handler.
   *
   * @param AcquiaPurgeExecutorRequestInterface[] $requests
   *   Unassociative list of request objects created by ::getRequest(). The
   *   properties 'scheme', 'method', 'uri' are used for executing the request.
   *   The properties 'result', 'error_curl', 'response_code' and 'error_debug'
   *   are updated during execution.
   * @param string $no_ssl_verify
   *   Skip host and peer verification, don't use for requests that include
   *   sensitive data (e.g. API keys).
   */
  public function requestsExecute($requests, $no_ssl_verify = FALSE);

  /**
   * Log a series of requests according to their 'result' properties.
   *
   * @param AcquiaPurgeExecutorRequestInterface[] $requests
   *   Unassociative list of ::requestsExecute() processed requests.
   * @param string $consequence
   *   Appendable message determing what happens because of a failed request.
   */
  public function requestsLog($requests, $consequence = 'goes back to queue');

}

Members

Namesort descending Modifiers Type Description Overrides
AcquiaPurgeExecutorInterface::getId public function Get a unique identifier for this executor. 1
AcquiaPurgeExecutorInterface::getRequest public function Instantiate a new request object. 1
AcquiaPurgeExecutorInterface::invalidate public function Invalidate one or multiple paths from an external layer. 2
AcquiaPurgeExecutorInterface::isEnabled public static function Determine if the executor is enabled or not. 2
AcquiaPurgeExecutorInterface::requestsExecute public function Execute a series of HTTP requests efficiently through cURL's multi handler. 1
AcquiaPurgeExecutorInterface::requestsLog public function Log a series of requests according to their 'result' properties. 1
AcquiaPurgeExecutorInterface::__construct public function Construct an executor object. 1