Open Data Catalog v
Drupal\datastore\Plugin\QueueWorker\Import Class Reference
Inheritance diagram for Drupal\datastore\Plugin\QueueWorker\Import:

Public Member Functions

 __construct (array $configuration, $plugin_id, $plugin_definition, ConfigFactoryInterface $configFactory, DatastoreService $datastore, LoggerChannelFactoryInterface $loggerFactory, ReferenceLookup $referenceLookup, Connection $defaultConnection, Connection $datastoreConnection)
 
 processItem ($data)
 

Static Public Member Functions

static create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
 

Protected Member Functions

 setConnectionTimeout (Connection $connection, int $timeout)
 
 importData (array $data)
 
 processResult (Result $result, $data, $queued=FALSE)
 
 invalidateCacheTags ($resourceId)
 
 requeue (array $data)
 

Protected Attributes

 $databaseQueue
 
 $datastore
 
 $referenceLookup
 
 $datastoreConfig
 
 $fileSystem
 

Detailed Description

Processes resource import.

@QueueWorker( id = "datastore_import", title = @Translation("Queue to process datastore import"), cron = { "time" = 180, "lease_time" = 10800 } )

Definition at line 29 of file Import.php.

Constructor & Destructor Documentation

◆ __construct()

Drupal\datastore\Plugin\QueueWorker\Import::__construct ( array  $configuration,
  $plugin_id,
  $plugin_definition,
ConfigFactoryInterface  $configFactory,
DatastoreService  $datastore,
LoggerChannelFactoryInterface  $loggerFactory,
ReferenceLookup  $referenceLookup,
Connection  $defaultConnection,
Connection  $datastoreConnection 
)

Constructs a \Drupal\Component\Plugin\PluginBase object.

Parameters
array$configurationA configuration array containing information about the plugin instance.
string$plugin_idThe plugin_id for the plugin instance.
mixed$plugin_definitionThe plugin implementation definition.
\Drupal\Core\Config\ConfigFactoryInterface$configFactoryA config factory instance.
\Drupal\datastore\Service$datastoreA DKAN datastore service instance.
\Drupal\Core\Logger\LoggerChannelFactoryInterface$loggerFactoryA logger channel factory instance.
\Drupal\metastore\Reference\ReferenceLookup$referenceLookupThe reference lookup service.
\Drupal\Core\Database\Connection$defaultConnectionAn instance of the default database connection.
\Drupal\Core\Database\Connection$datastoreConnectionAn instance of the datastore database connection.

Definition at line 89 of file Import.php.

Member Function Documentation

◆ create()

static Drupal\datastore\Plugin\QueueWorker\Import::create ( ContainerInterface  $container,
array  $configuration,
  $plugin_id,
  $plugin_definition 
)
static

{}

Definition at line 118 of file Import.php.

◆ importData()

Drupal\datastore\Plugin\QueueWorker\Import::importData ( array  $data)
protected

Perform the actual data import.

Parameters
array$dataResource identifier information.

Definition at line 167 of file Import.php.

◆ invalidateCacheTags()

Drupal\datastore\Plugin\QueueWorker\Import::invalidateCacheTags (   $resourceId)
protected

Invalidate all appropriate cache tags for this resource.

Parameters
mixed$resourceIdA resource ID.

Definition at line 228 of file Import.php.

◆ processItem()

Drupal\datastore\Plugin\QueueWorker\Import::processItem (   $data)

{}

Definition at line 148 of file Import.php.

◆ processResult()

Drupal\datastore\Plugin\QueueWorker\Import::processResult ( Result  $result,
  $data,
  $queued = FALSE 
)
protected

Process the result of the import operation.

Parameters
\Procrastinator\Result$resultThe result object.
mixed$dataThe resource data for import.
bool$queuedWhether the import job is currently queued.
Returns
bool The updated value for $queued.

Definition at line 196 of file Import.php.

◆ requeue()

Drupal\datastore\Plugin\QueueWorker\Import::requeue ( array  $data)
protected

Requeues the job with extra state information.

Parameters
array$dataQueue data.
Returns
mixed Queue ID or false if unsuccessful.
Todo:
Clarify return value. Documentation suggests it should return ID.

Definition at line 243 of file Import.php.

◆ setConnectionTimeout()

Drupal\datastore\Plugin\QueueWorker\Import::setConnectionTimeout ( Connection  $connection,
int  $timeout 
)
protected

Set the wait_timeout for the given database connection.

Parameters
\Drupal\Core\Database\Connection$connectionDatabase connection instance.
int$timeoutWait timeout in seconds.

Definition at line 140 of file Import.php.

Member Data Documentation

◆ $databaseQueue

Drupal\datastore\Plugin\QueueWorker\Import::$databaseQueue
protected

Definition at line 37 of file Import.php.

◆ $datastore

Drupal\datastore\Plugin\QueueWorker\Import::$datastore
protected

Definition at line 44 of file Import.php.

◆ $datastoreConfig

Drupal\datastore\Plugin\QueueWorker\Import::$datastoreConfig
protected

Definition at line 58 of file Import.php.

◆ $fileSystem

Drupal\datastore\Plugin\QueueWorker\Import::$fileSystem
protected

Definition at line 65 of file Import.php.

◆ $referenceLookup

Drupal\datastore\Plugin\QueueWorker\Import::$referenceLookup
protected

Definition at line 51 of file Import.php.