1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* AppserverIo\Provisioning\Api\Node\ProvisionerNode |
5
|
|
|
* |
6
|
|
|
* NOTICE OF LICENSE |
7
|
|
|
* |
8
|
|
|
* This source file is subject to the Open Software License (OSL 3.0) |
9
|
|
|
* that is available through the world-wide-web at this URL: |
10
|
|
|
* http://opensource.org/licenses/osl-3.0.php |
11
|
|
|
* |
12
|
|
|
* PHP version 5 |
13
|
|
|
* |
14
|
|
|
* @author Tim Wagner <[email protected]> |
15
|
|
|
* @copyright 2018 TechDivision GmbH <[email protected]> |
16
|
|
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) |
17
|
|
|
* @link https://github.com/appserver-io/provisioning |
18
|
|
|
* @link http://www.appserver.io |
19
|
|
|
*/ |
20
|
|
|
|
21
|
|
|
namespace AppserverIo\Provisioning\Api\Node; |
22
|
|
|
|
23
|
|
|
use AppserverIo\Description\Annotations as DI; |
24
|
|
|
use AppserverIo\Description\Api\Node\AbstractNode; |
25
|
|
|
use AppserverIo\Provisioning\Configuration\ProvisionerConfigurationInterface; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* DTO to transfer the provisioner information. |
29
|
|
|
* |
30
|
|
|
* @author Tim Wagner <[email protected]> |
31
|
|
|
* @copyright 2018 TechDivision GmbH <[email protected]> |
32
|
|
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) |
33
|
|
|
* @link https://github.com/appserver-io/provisioning |
34
|
|
|
* @link http://www.appserver.io |
35
|
|
|
*/ |
36
|
|
|
class ProvisionerNode extends AbstractNode implements ProvisionerConfigurationInterface |
37
|
|
|
{ |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* The provisioner name. |
41
|
|
|
* |
42
|
|
|
* @var string |
43
|
|
|
* @DI\Mapping(nodeType="string") |
44
|
|
|
*/ |
45
|
|
|
protected $name; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* The provisioner type. |
49
|
|
|
* |
50
|
|
|
* @var string |
51
|
|
|
* @DI\Mapping(nodeType="string") |
52
|
|
|
*/ |
53
|
|
|
protected $type; |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* The managers factory class name. |
57
|
|
|
* |
58
|
|
|
* @var string |
59
|
|
|
* @DI\Mapping(nodeType="string") |
60
|
|
|
*/ |
61
|
|
|
protected $factory; |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* Initializes the provisioner node with the necessary data. |
65
|
|
|
* |
66
|
|
|
* @param string $name The provisioner name |
67
|
|
|
* @param string $type The provisioner type |
68
|
|
|
* @param string $factory The provisioners factory class name |
69
|
|
|
*/ |
70
|
|
|
public function __construct($name = '', $type = '', $factory = '') |
71
|
|
|
{ |
72
|
|
|
|
73
|
|
|
// initialize the UUID |
74
|
|
|
$this->setUuid($this->newUuid()); |
75
|
|
|
|
76
|
|
|
// set the data |
77
|
|
|
$this->name = $name; |
78
|
|
|
$this->type = $type; |
79
|
|
|
$this->factory = $factory; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* Returns the nodes primary key, the name by default. |
84
|
|
|
* |
85
|
|
|
* @return string The nodes primary key |
86
|
|
|
* @see \AppserverIo\Description\Api\Node\AbstractNode::getPrimaryKey() |
87
|
|
|
*/ |
88
|
|
|
public function getPrimaryKey() |
89
|
|
|
{ |
90
|
|
|
return $this->getName(); |
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
/** |
94
|
|
|
* Returns the provisioner type. |
95
|
|
|
* |
96
|
|
|
* @return string The provisioner type |
97
|
|
|
*/ |
98
|
|
|
public function getType() |
99
|
|
|
{ |
100
|
|
|
return $this->type; |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* Returns the provisioner name. |
105
|
|
|
* |
106
|
|
|
* @return string The provisioner name |
107
|
|
|
*/ |
108
|
|
|
public function getName() |
109
|
|
|
{ |
110
|
|
|
return $this->name; |
111
|
|
|
} |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* Returns the factory class name. |
115
|
|
|
* |
116
|
|
|
* @return string The factory class name |
117
|
|
|
*/ |
118
|
|
|
public function getFactory() |
119
|
|
|
{ |
120
|
|
|
return $this->factory; |
121
|
|
|
} |
122
|
|
|
} |
123
|
|
|
|