FOSSology  4.4.0
Open Source License Compliance by Open Source Software
Agent.php
Go to the documentation of this file.
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2023 Akash Kumar Sah <akashsah2003@gmail.com>
4  SPDX-License-Identifier: GPL-2.0-only
5 */
10 namespace Fossology\UI\Api\Models;
11 
13 
14 class Agent
15 {
25  private $uploadId;
30  private $agentName;
35  private $currentAgentId;
45  private $isAgentRunning;
46 
53  {
54  $this->successfulAgents = $successfulAgents;
55  $this->uploadId = $uploadId;
56  $this->agentName = $agentName;
57  $this->currentAgentId = $currentAgentId;
58  $this->currentAgentRev = $currentAgentRev;
59  }
60 
64  public function getSuccessfulAgents()
65  {
67  }
68 
72  public function getUploadId()
73  {
74  return $this->uploadId;
75  }
76 
80  public function getAgentName()
81  {
82  return $this->agentName;
83  }
84 
88  public function getCurrentAgentId()
89  {
90  return $this->currentAgentId;
91  }
92 
96  public function getCurrentAgentRev()
97  {
99  }
100 
104  public function getIsAgentRunning()
105  {
106  return $this->isAgentRunning;
107  }
108 
109 
115  public function getJSON($version=ApiVersion::V1)
116  {
117  return json_encode($this->getArray($version));
118  }
119 
125  public function getArray($version=ApiVersion::V1)
126  {
127  return [
128  'successfulAgents' => $this->getSuccessfulAgents(),
129  'uploadId' => $this->getUploadId(),
130  'agentName' => $this->getAgentName(),
131  'currentAgentId' => $this->getCurrentAgentId(),
132  'currentAgentRev' => $this->getCurrentAgentRev(),
133  'isAgentRunning' => $this->getIsAgentRunning()
134  ];
135  }
136 
141  {
142  $this->successfulAgents = $successfulAgents;
143  }
144 
148  public function setUploadId($uploadId)
149  {
150  $this->uploadId = $uploadId;
151  }
152 
156  public function setAgentName($agentName)
157  {
158  $this->agentName = $agentName;
159  }
160 
165  {
166  $this->currentAgentId = $currentAgentId;
167  }
168 
173  {
174  $this->currentAgentRev = $currentAgentRev;
175  }
176 
180  public function setIsAgentRunning($isAgentRunning)
181  {
182  $this->isAgentRunning = $isAgentRunning;
183  }
184 }
setCurrentAgentId($currentAgentId)
Definition: Agent.php:164
setSuccessfulAgents($successfulAgents)
Definition: Agent.php:140
__construct($successfulAgents, $uploadId, $agentName, $currentAgentId, $currentAgentRev, $isAgentRunning)
Definition: Agent.php:52
setIsAgentRunning($isAgentRunning)
Definition: Agent.php:180
getJSON($version=ApiVersion::V1)
Definition: Agent.php:115
getArray($version=ApiVersion::V1)
Definition: Agent.php:125
setCurrentAgentRev($currentAgentRev)
Definition: Agent.php:172