FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
agent-unpack.php
Go to the documentation of this file.
1 <?php
2 /***********************************************************
3  Copyright (C) 2008-2013 Hewlett-Packard Development Company, L.P.
4  Copyright (C) 2015 Siemens
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License
8  version 2 as published by the Free Software Foundation.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License along
16  with this program; if not, write to the Free Software Foundation, Inc.,
17  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 ***********************************************************/
26 
32 {
33  public function __construct() {
34  $this->Name = "agent_unpack";
35  $this->Title = _("Schedule an Unpack");
36  $this->AgentName = "ununpack";
37 
38  parent::__construct();
39  }
40 
45  function AgentHasResults($uploadId=0)
46  {
47  return CheckARS($uploadId, "ununpack", "Archive unpacker", "ununpack_ars");
48  }
49 
54  public function AgentAdd($jobId, $uploadId, &$errorMsg, $dependencies=array(), $arguments=null)
55  {
56 
57  $jobQueueId = \IsAlreadyScheduled($jobId, $this->AgentName, $uploadId);
58  if ($jobQueueId != 0)
59  {
60  return $jobQueueId;
61  }
62 
63  return $this->doAgentAdd($jobId, $uploadId, $errorMsg, $dependencies, $uploadId, $arguments);
64  }
65 }
66 
67 register_plugin(new UnpackAgentPlugin());
IsAlreadyScheduled($job_pk, $AgentName, $upload_pk)
Check if an agent is already scheduled in a job.
Definition: common-job.php:380
UI for ununpack agent to schedule a job.
AgentAdd($jobId, $uploadId, &$errorMsg, $dependencies=array(), $arguments=null)
CheckARS($upload_pk, $AgentName, $AgentDesc, $AgentARSTableName)
Check the ARS table to see if an agent has successfully scanned an upload.
AgentHasResults($uploadId=0)
doAgentAdd($jobId, $uploadId, &$errorMsg, $dependencies, $jqargs="", $jq_cmd_args=null)