예제 #1
0
 /**
  * @param bool $singleItemMode
  * @return MessageHandler
  */
 protected function getArticleImporterMessageHandler($singleItemMode = false)
 {
     $supportedProcessingType = $singleItemMode ? Article::prototype() : ArticleCollection::prototype();
     return MessageHandler::fromDefinition(MessageHandlerId::generate(), 'Article Importer', NodeName::defaultName(), MessageHandler\HandlerType::connector(), MessageHandler\DataDirection::target(), MessageHandler\ProcessingTypes::support([$supportedProcessingType]), ProcessingMetadata::fromArray(['chunk_support' => true]), 'sqlconnector-pm-metadata', 'glyphicon-hdd', 'glyphicon');
 }
 /**
  * @param MessageHandlerId $messageHandlerId
  * @param $messageHandlerName
  * @param MessageHandler\HandlerType $handlerType
  * @param MessageHandler\DataDirection $dataDirection
  * @param MessageHandler\ProcessingTypes $supportedProcessingTypes
  * @param ProcessingMetadata $processingMetadata
  * @param string $metadataRiotTag
  * @param string $icon
  * @param string $iconType
  * @param null|Prototype $preferredProcessingType
  * @param null|MessageHandler\ProcessingId $processingId
  * @param array $additionalData
  * @return MessageHandler
  */
 public function installMessageHandler(MessageHandlerId $messageHandlerId, $messageHandlerName, HandlerType $handlerType, DataDirection $dataDirection, ProcessingTypes $supportedProcessingTypes, ProcessingMetadata $processingMetadata, $metadataRiotTag, $icon, $iconType, Prototype $preferredProcessingType = null, ProcessingId $processingId = null, array $additionalData = [])
 {
     return MessageHandler::fromDefinition($messageHandlerId, $messageHandlerName, $this->nodeName(), $handlerType, $dataDirection, $supportedProcessingTypes, $processingMetadata, $metadataRiotTag, $icon, $iconType, $preferredProcessingType, $processingId, $additionalData);
 }
 /**
  * @param $dataDirection
  * @param null|string $handlerType
  * @param null|array $metadata
  * @return MessageHandler
  */
 private function getMessageHandler($dataDirection, $handlerType = null, array $metadata = null)
 {
     if (!is_null($handlerType)) {
         $handlerType = MessageHandler\HandlerType::fromString($handlerType);
     } else {
         $handlerType = MessageHandler\HandlerType::connector();
     }
     if (!is_null($metadata)) {
         $metadata = ProcessingMetadata::fromArray($metadata);
     } else {
         $metadata = ProcessingMetadata::noData();
     }
     return MessageHandler::fromDefinition(MessageHandlerId::generate(), 'Article Export', NodeName::defaultName(), $handlerType, MessageHandler\DataDirection::fromString($dataDirection), MessageHandler\ProcessingTypes::support([ArticleCollection::prototype(), Article::prototype()]), $metadata, 'sqlconnector-pm-metadata', 'glyphicon-hdd', 'glyphicon', Article::prototype(), MessageHandler\ProcessingId::fromString('sqlconnector:::example'));
 }