FOSSology  4.4.0
Open Source License Compliance by Open Source Software
agent-unpack.php
Go to the documentation of this file.
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2008-2013 Hewlett-Packard Development Company, L.P.
4  SPDX-FileCopyrightText: © 2015 Siemens AG
5 
6  SPDX-License-Identifier: GPL-2.0-only
7 */
16 
22 {
23  public function __construct() {
24  $this->Name = "agent_unpack";
25  $this->Title = _("Schedule an Unpack");
26  $this->AgentName = "ununpack";
27 
28  parent::__construct();
29  }
30 
35  function AgentHasResults($uploadId=0)
36  {
37  return CheckARS($uploadId, "ununpack", "Archive unpacker", "ununpack_ars");
38  }
39 
44  public function AgentAdd($jobId, $uploadId, &$errorMsg, $dependencies=[],
45  $arguments=null, $request=null, $unpackArgs=null)
46  {
47 
48  $jobQueueId = \IsAlreadyScheduled($jobId, $this->AgentName, $uploadId);
49  if ($jobQueueId != 0)
50  {
51  return $jobQueueId;
52  }
53 
54  return $this->doAgentAdd($jobId, $uploadId, $errorMsg, $dependencies, $uploadId, $arguments, $request);
55  }
56 }
57 
58 register_plugin(new UnpackAgentPlugin());
doAgentAdd($jobId, $uploadId, &$errorMsg, $dependencies, $jqargs="", $jq_cmd_args=null, $request=null)
UI for ununpack agent to schedule a job.
AgentHasResults($uploadId=0)
AgentAdd($jobId, $uploadId, &$errorMsg, $dependencies=[], $arguments=null, $request=null, $unpackArgs=null)
CheckARS($upload_pk, $AgentName, $AgentDesc, $AgentARSTableName)
Check the ARS table to see if an agent has successfully scanned an upload.
IsAlreadyScheduled($job_pk, $AgentName, $upload_pk)
Check if an agent is already scheduled in a job.
Definition: common-job.php:378