OssShipperConfig.php
3.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
class Aliyun_Log_Models_OssShipperConfig{
private $ossBucket;
private $ossPrefix;
private $bufferInterval = 300;
private $bufferSize;
private $compressType;
private $roleArn;
private $pathFormat;
private $storage;
/**
* @return mixed
*/
public function getRoleArn()
{
return $this->roleArn;
}
/**
* @param mixed $roleArn
*/
public function setRoleArn($roleArn)
{
$this->roleArn = $roleArn;
}
/**
* @return mixed
*/
public function getPathFormat()
{
return $this->pathFormat;
}
/**
* @param mixed $pathFormat
*/
public function setPathFormat($pathFormat)
{
$this->pathFormat = $pathFormat;
}
/**
* @return mixed
*/
public function getStorage()
{
return $this->storage;
}
/**
* @param mixed $storage
*/
public function setStorage($storage)
{
$this->storage = $storage;
}
/**
* @return mixed
*/
public function getOssBucket()
{
return $this->ossBucket;
}
/**
* @param mixed $ossBucket
*/
public function setOssBucket($ossBucket)
{
$this->ossBucket = $ossBucket;
}
/**
* @return mixed
*/
public function getOssPrefix()
{
return $this->ossPrefix;
}
/**
* @param mixed $ossPrefix
*/
public function setOssPrefix($ossPrefix)
{
$this->ossPrefix = $ossPrefix;
}
/**
* @return mixed
*/
public function getBufferInterval()
{
return $this->bufferInterval;
}
/**
* @param mixed $bufferInterval
*/
public function setBufferInterval($bufferInterval)
{
$this->bufferInterval = $bufferInterval;
}
/**
* @return mixed
*/
public function getBufferSize()
{
return $this->bufferSize;
}
/**
* @param mixed $bufferSize
*/
public function setBufferSize($bufferSize)
{
if($bufferSize > 256 || $bufferSize < 5){
throw new Exception("buffSize is not valide, must between 5 and 256");
}
$this->bufferSize = $bufferSize;
}
/**
* @return mixed
*/
public function getCompressType()
{
return $this->compressType;
}
/**
* @param mixed $compressType
*/
public function setCompressType($compressType)
{
$this->compressType = $compressType;
}
public function to_json_object() {
$json = array(
'ossBucket' => $this->ossBucket,
'ossPrefix' => $this->ossPrefix,
'bufferInterval' => $this->bufferInterval,
'bufferSize' => $this->bufferSize,
'compressType' => $this->compressType,
'roleArn' => $this->roleArn,
'pathFormat' => $this->pathFormat,
'storage' => $this->storage->to_json_object()
);
if($this->storage->getFormat() == 'json'){
unset($json['storage']);
}
return $json;
}
}