1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace TreeHouse\Keystone\Client\Model; |
4
|
|
|
|
5
|
|
|
class Tenant |
6
|
|
|
{ |
7
|
|
|
/** |
8
|
|
|
* @var string |
9
|
|
|
*/ |
10
|
|
|
protected $tokenUrl; |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* @var string |
14
|
|
|
*/ |
15
|
|
|
protected $username; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* @var string |
19
|
|
|
*/ |
20
|
|
|
protected $password; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* @var string |
24
|
|
|
*/ |
25
|
|
|
protected $serviceType; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* @var string |
29
|
|
|
*/ |
30
|
|
|
protected $serviceName; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @var string |
34
|
|
|
*/ |
35
|
|
|
protected $tenantName; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @var string |
39
|
|
|
*/ |
40
|
|
|
protected $serviceEndpoint; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @param string $tokenUrl The url where to obtain a token |
44
|
|
|
* @param string $username Username |
45
|
|
|
* @param string $password Password |
46
|
|
|
* @param string $serviceType The type of service |
47
|
|
|
* @param string $serviceName Service name. If left empty, the first matching service type will be used. |
48
|
|
|
* @param string $tenantName Tenant name (optional) |
49
|
|
|
* @param string $serviceEndpoint Service catalog endpoint (defaults to public) |
50
|
|
|
*/ |
51
|
16 |
|
public function __construct($tokenUrl, $username, $password, $serviceType, $serviceName = null, $tenantName = null, |
52
|
|
|
$serviceEndpoint = 'public') |
53
|
|
|
{ |
54
|
16 |
|
$this->tokenUrl = $tokenUrl; |
55
|
16 |
|
$this->username = $username; |
56
|
16 |
|
$this->password = $password; |
57
|
16 |
|
$this->serviceType = $serviceType; |
58
|
16 |
|
$this->serviceName = $serviceName; |
59
|
16 |
|
$this->tenantName = $tenantName; |
60
|
16 |
|
$this->serviceEndpoint = ($serviceEndpoint !== null) ? $serviceEndpoint : 'public'; |
61
|
16 |
|
} |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @return string |
65
|
|
|
*/ |
66
|
11 |
|
public function getTokenUrl() |
67
|
|
|
{ |
68
|
11 |
|
return $this->tokenUrl; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* @return string |
73
|
|
|
*/ |
74
|
5 |
|
public function getUsername() |
75
|
|
|
{ |
76
|
5 |
|
return $this->username; |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* @return string |
81
|
|
|
*/ |
82
|
5 |
|
public function getPassword() |
83
|
|
|
{ |
84
|
5 |
|
return $this->password; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* @return string |
89
|
|
|
*/ |
90
|
10 |
|
public function getServiceType() |
91
|
|
|
{ |
92
|
10 |
|
return $this->serviceType; |
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
/** |
96
|
|
|
* @return string |
97
|
|
|
*/ |
98
|
10 |
|
public function getServiceName() |
99
|
|
|
{ |
100
|
10 |
|
return $this->serviceName; |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* @return string |
105
|
|
|
*/ |
106
|
5 |
|
public function getTenantName() |
107
|
|
|
{ |
108
|
5 |
|
return $this->tenantName; |
109
|
|
|
} |
110
|
|
|
|
111
|
|
|
/** |
112
|
|
|
* @return string |
113
|
|
|
*/ |
114
|
10 |
|
public function getServiceEndpoint() |
115
|
|
|
{ |
116
|
10 |
|
return $this->serviceEndpoint; |
117
|
|
|
} |
118
|
|
|
} |
119
|
|
|
|