FOSSology  4.5.1
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  $this->isAgentRunning = $isAgentRunning;
60  }
61 
65  public function getSuccessfulAgents()
66  {
68  }
69 
73  public function getUploadId()
74  {
75  return $this->uploadId;
76  }
77 
81  public function getAgentName()
82  {
83  return $this->agentName;
84  }
85 
89  public function getCurrentAgentId()
90  {
91  return $this->currentAgentId;
92  }
93 
97  public function getCurrentAgentRev()
98  {
100  }
101 
105  public function getIsAgentRunning()
106  {
107  return $this->isAgentRunning;
108  }
109 
110 
116  public function getJSON($version=ApiVersion::V1)
117  {
118  return json_encode($this->getArray($version));
119  }
120 
126  public function getArray($version=ApiVersion::V1)
127  {
128  return [
129  'successfulAgents' => $this->getSuccessfulAgents(),
130  'uploadId' => $this->getUploadId(),
131  'agentName' => $this->getAgentName(),
132  'currentAgentId' => $this->getCurrentAgentId(),
133  'currentAgentRev' => $this->getCurrentAgentRev(),
134  'isAgentRunning' => $this->getIsAgentRunning()
135  ];
136  }
137 
142  {
143  $this->successfulAgents = $successfulAgents;
144  }
145 
149  public function setUploadId($uploadId)
150  {
151  $this->uploadId = $uploadId;
152  }
153 
157  public function setAgentName($agentName)
158  {
159  $this->agentName = $agentName;
160  }
161 
166  {
167  $this->currentAgentId = $currentAgentId;
168  }
169 
174  {
175  $this->currentAgentRev = $currentAgentRev;
176  }
177 
181  public function setIsAgentRunning($isAgentRunning)
182  {
183  $this->isAgentRunning = $isAgentRunning;
184  }
185 }
setCurrentAgentId($currentAgentId)
Definition: Agent.php:165
setSuccessfulAgents($successfulAgents)
Definition: Agent.php:141
__construct($successfulAgents, $uploadId, $agentName, $currentAgentId, $currentAgentRev, $isAgentRunning)
Definition: Agent.php:52
setIsAgentRunning($isAgentRunning)
Definition: Agent.php:181
getJSON($version=ApiVersion::V1)
Definition: Agent.php:116
getArray($version=ApiVersion::V1)
Definition: Agent.php:126
setCurrentAgentRev($currentAgentRev)
Definition: Agent.php:173