a12680e0766a34968e50d29753d5b68bde1cdcb3
[ccsdk/cds.git] / ms / blueprintsprocessor / modules / commons / rest-lib / src / main / kotlin / org / onap / ccsdk / cds / blueprintsprocessor / rest / BluePrintRestLibData.kt
1 /*
2  * Copyright © 2017-2018 AT&T Intellectual Property.
3  * Modifications Copyright © 2019 Huawei.
4  * Modifications Copyright © 2019 Bell Canada.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19 package org.onap.ccsdk.cds.blueprintsprocessor.rest
20
21 open class RestClientProperties {
22
23     lateinit var type: String
24     lateinit var url: String
25     lateinit var values: Map<String, Any>
26     var connectTimeout: Int = 0
27     var socketTimeout: Int = 0
28     var connectionRequestTimeout: Int = 0
29     var additionalHeaders: Map<String, String>? = null
30 }
31
32 open class SSLRestClientProperties : RestClientProperties() {
33
34     lateinit var keyStoreInstance: String // JKS, PKCS12
35     lateinit var sslTrust: String
36     lateinit var sslTrustPassword: String
37     var sslTrustIgnoreHostname: Boolean = false
38     var sslKey: String? = null
39     var sslKeyPassword: String? = null
40 }
41
42 open class SSLBasicAuthRestClientProperties : SSLRestClientProperties() {
43     lateinit var password: String
44     lateinit var username: String
45 }
46
47 // FIXME("Define token properties")
48 open class SSLTokenAuthRestClientProperties : SSLRestClientProperties() {
49
50     var tokenAuth: TokenAuthRestClientProperties? = null
51 }
52
53 open class BasicAuthRestClientProperties : RestClientProperties() {
54
55     lateinit var password: String
56     lateinit var username: String
57 }
58
59 open class TokenAuthRestClientProperties : RestClientProperties() {
60
61     var token: String? = null
62 }
63
64 open class PolicyManagerRestClientProperties : RestClientProperties() {
65
66     lateinit var env: String
67     lateinit var clientAuth: String
68     lateinit var authorisation: String
69 }