Delete a task by its receipt.

@param string $receipt
@param array $logContext
177422
protected function doDelete($receipt, array $logContext = [])
    {
        // ensures that the SQS Queue exist
        if (!$this->queueExists()) {
            $this->createQueue();
        }

        $logContext = array_merge([
            'QueueUrl' => $this->queueUrl
        ], $logContext);

        try {
            $this->getClient()->deleteMessage([
                'QueueUrl' => $this->queueUrl,
                'ReceiptHandle' => $receipt
            ]);

            $this->logDebug('Task deleted from queue.', $logContext);
        } catch (AwsException $e) {
            $this->logError('Deleting task failed with MSG: '. $e->getAwsErrorMessage(), $logContext);
        }
    }
405681
public function setReceiptData($receipt_data): self
    {
        if (strpos($receipt_data, '{') !== false) {
            $this->receipt_data = base64_encode($receipt_data);
        } else {
            $this->receipt_data = $receipt_data;
        }

        return $this;
    }
1067614
public function removeLog(\Amulen\ShopBundle\Entity\ProductOrderStatusLog $log)
    {
        $this->logs->removeElement($log);
    }
302971
@Override
    public java.util.concurrent.Future<DeleteMessageResult> deleteMessageAsync(String queueUrl, String receiptHandle,
            com.amazonaws.handlers.AsyncHandler<DeleteMessageRequest, DeleteMessageResult> asyncHandler) {

        return deleteMessageAsync(new DeleteMessageRequest().withQueueUrl(queueUrl).withReceiptHandle(receiptHandle), asyncHandler);
    }
1077178
public function log($level, $message, array $context = array())
    {
        if ($this->loggerInstance !== null) {
            $this->loggerInstance->log($level, $message, $context);
        } elseif ($this->loggerCallback !== null) {
            call_user_func_array($this->loggerCallback, array($level, $message, $context));
        }
    }
928866
public function delete()
    {
        parent::delete();

        $this->sqs->deleteMessage([
            'QueueUrl' => $this->queue, 'ReceiptHandle' => $this->job['ReceiptHandle'],
        ]);
    }
1271154
public function getCheckCodes(Receipt $receipt)
    {
        if (isset($receipt->bkp, $receipt->pkp))
        {
            $this->pkp = $receipt->pkp;
            $this->bkp = $receipt->bkp;
        }
        else
        {
            $objKey = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, ['type' => 'private']);
            $objKey->loadKey($this->cert->getPrivateKey());

            $arr = [
                $receipt->dic_popl,
                $receipt->id_provoz,
                $receipt->id_pokl,
                $receipt->porad_cis,
                $receipt->dat_trzby->format('c'),
                Format::price($receipt->celk_trzba)
            ];

            $this->pkp = $objKey->signData(implode('|', $arr));
            $this->bkp = Format::BKB(sha1($this->pkp));
        }

        return [
            'pkp' => [
                '_'        => $this->pkp,
                'digest'   => 'SHA256',
                'cipher'   => 'RSA2048',
                'encoding' => 'base64'
            ],
            'bkp' => [
                '_'        => $this->bkp,
                'digest'   => 'SHA1',
                'encoding' => 'base16'
            ]
        ];
    }
1336847
public function deleteContext($context)
    {

// Delete any outstanding share keys for resource links for this context
        $sql = sprintf('DELETE sk ' .
                       "FROM {$this->dbTableNamePrefix}" . DataConnector::RESOURCE_LINK_SHARE_KEY_TABLE_NAME . ' sk ' .
                       "INNER JOIN {$this->dbTableNamePrefix}" . DataConnector::RESOURCE_LINK_TABLE_NAME . ' rl ON sk.resource_link_pk = rl.resource_link_pk ' .
                       'WHERE rl.context_pk = %d',
                       $context->getRecordId());
        mysql_query($sql);

// Delete any users in resource links for this context
        $sql = sprintf('DELETE u ' .
                       "FROM {$this->dbTableNamePrefix}" . DataConnector::USER_RESULT_TABLE_NAME . ' u ' .
                       "INNER JOIN {$this->dbTableNamePrefix}" . DataConnector::RESOURCE_LINK_TABLE_NAME . ' rl ON u.resource_link_pk = rl.resource_link_pk ' .
                       'WHERE rl.context_pk = %d',
                       $context->getRecordId());
        mysql_query($sql);

// Update any resource links for which this consumer is acting as a primary resource link
        $sql = sprintf("UPDATE {$this->dbTableNamePrefix}" . DataConnector::RESOURCE_LINK_TABLE_NAME . ' prl ' .
                       "INNER JOIN {$this->dbTableNamePrefix}" . DataConnector::RESOURCE_LINK_TABLE_NAME . ' rl ON prl.primary_resource_link_pk = rl.resource_link_pk ' .
                       'SET prl.primary_resource_link_pk = null, prl.share_approved = null ' .
                       'WHERE rl.context_pk = %d',
                       $context->getRecordId());
        $ok = mysql_query($sql);

// Delete any resource links for this consumer
        $sql = sprintf('DELETE rl ' .
                       "FROM {$this->dbTableNamePrefix}" . DataConnector::RESOURCE_LINK_TABLE_NAME . ' rl ' .
                       'WHERE rl.context_pk = %d',
                       $context->getRecordId());
        mysql_query($sql);

// Delete context
        $sql = sprintf('DELETE c ' .
                       "FROM {$this->dbTableNamePrefix}" . DataConnector::CONTEXT_TABLE_NAME . ' c ',
                       'WHERE c.context_pk = %d',
                       $context->getRecordId());
        $ok = mysql_query($sql);
        if ($ok) {
            $context->initialize();
        }

        return $ok;

    }
778742
public function log($level, $message, array $context = [])
    {
        $record = $this->prepareRecord($level, $message, $context);
        
        $iterator = $this->handlers->getIterator();
        
        while ($iterator->valid()) {
            /** @var HandlerInterface $handler */
            $handler = $iterator->current();
            
            if ($handler->levelAllow($level)) {
                $handler->handle($record);
            }
            
            $iterator->next();
        }
        
        return true;
    }
1073385
public function deleteMessage($receiptHandle)
    {
        try {
            $this->queue->deleteMessage($receiptHandle);
            return true;
        } catch (MnsException $e) {
            Yii::trace(sprintf('Delete Message Failed:  `%s`...', $e));
            return false;
        }
    }
1192404
public static function delete_data_for_all_users_in_context(\context $context) {
        // Sanity check that context is at the user context level, then get the userid.
        if ($context->contextlevel !== CONTEXT_USER) {
            return;
        }
        $userid = $context->instanceid;

        // Delete all the userkeys.
        \core_userkey\privacy\provider::delete_userkeys('rss', $userid);

    }
966346
public function discardAction(array $nodeContextPaths)
    {
        try {
            foreach ($nodeContextPaths as $contextPath) {
                $node = $this->nodeService->getNodeFromContextPath($contextPath, null, null, true);
                if ($node->isRemoved() === true) {
                    // When discarding node removal we should re-create it
                    $updateNodeInfo = new UpdateNodeInfo();
                    $updateNodeInfo->setNode($node);
                    $updateNodeInfo->recursive();

                    $updateParentNodeInfo = new UpdateNodeInfo();
                    $updateParentNodeInfo->setNode($node->getParent());

                    $this->feedbackCollection->add($updateNodeInfo);
                    $this->feedbackCollection->add($updateParentNodeInfo);

                    // Reload document for content node changes
                    // (as we can't RenderContentOutOfBand from here, we don't know dom addresses)
                    if (!$this->nodeService->isDocument($node)) {
                        $reloadDocument = new ReloadDocument();
                        $this->feedbackCollection->add($reloadDocument);
                    }
                } elseif (!$this->nodeService->nodeExistsInWorkspace($node, $node->getWorkSpace()->getBaseWorkspace())) {
                    // If the node doesn't exist in the target workspace, tell the UI to remove it
                    $removeNode = new RemoveNode();
                    $removeNode->setNode($node);
                    $this->feedbackCollection->add($removeNode);
                }

                $this->publishingService->discardNode($node);
            }

            $success = new Success();
            $success->setMessage(sprintf('Discarded %d node(s).', count($nodeContextPaths)));

            $this->updateWorkspaceInfo($nodeContextPaths[0]);
            $this->feedbackCollection->add($success);

            $this->persistenceManager->persistAll();
        } catch (\Exception $e) {
            $error = new Error();
            $error->setMessage($e->getMessage());

            $this->feedbackCollection->add($error);
        }

        $this->view->assign('value', $this->feedbackCollection);
    }
290593
public function send($view, array $data = [], $callback = null): ReceiptContract
    {
        $mailer = $this->getMailer();

        if ($view instanceof MailableContract) {
            $this->updateFromOnMailable($view)->send($mailer);
        } else {
            $mailer->send($view, $data, $callback);
        }

        return new Receipt($mailer, false);
    }
308119
public function sendLogsTo(LogConsumer $logConsumer)
    {
        if ($logConsumer === $this) {
            throw new LogicException('Operation not allowed');
        }
        
        while (!empty($this->collectedLogs)) {
            $log = array_shift($this->collectedLogs);
            $logConsumer->consumeLog($log['message'], $log['context']);
        }
    }
935136
public function send(Recipient $user, MessageContract $message, Closure $callback = null): ReceiptContract
    {
        $view = $message->getView();
        $data = $message->getData() ?: [];
        $subject = $message->getSubject() ?: '';

        // In order to pass a Closure as "use" we need to actually convert
        // it into Serializable Closure, otherwise Laravel would throw an
        // exception.
        $callback = $callback instanceof Closure
                        ? new SerializableClosure($callback)
                        : $callback;

        $receipt = $this->mailer->push($view, $data, $this->createMessageCallback($user, $subject, $callback));

        return $receipt->usingQueue($this->isUsingQueue());
    }
99560
public static function log(LoggerInterface $logger = null, $message, $context = [])
    {
        if ($logger) {
            $logger->warning($message, $context);
        } else {
            $replace = [];
            foreach ($context as $k => $v) {
                if (is_scalar($v)) {
                    $replace['{'.$k.'}'] = $v;
                }
            }
            @trigger_error(strtr($message, $replace), E_USER_WARNING);
        }
    }
971661
public int deleteLogs(String topic, String password) {
        if (!config.getAuthentication().auth(password)) {
            return -1;
        }
        int value = 0;
        synchronized (logCreationLock) {
            Pool<Integer, Log> parts = logs.remove(topic);
            if (parts != null) {
                List<Log> deleteLogs = new ArrayList<Log>(parts.values());
                for (Log log : deleteLogs) {
                    log.delete();
                    value++;
                }
            }
            if (config.getEnableZookeeper()) {
                topicRegisterTasks.add(new TopicTask(TopicTask.TaskType.DELETE, topic));
            }
        }
        return value;
    }