424929b8238c54e32b82b4d44c7384cb06bf0cbc
[ccsdk/cds.git] /
1 /*
2  * Copyright © 2018-2019 AT&T Intellectual Property.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization
18
19 import java.io.Serializable
20
21 object MessageActionConstants {
22     const val PRIORITIZE = "prioritize"
23 }
24
25 enum class MessageState(val id: String) {
26     NEW("new"),
27     WAIT("wait"),
28     EXPIRED("expired"),
29     PRIORITIZED("prioritized"),
30     AGGREGATED("aggregated"),
31     COMPLETED("completed"),
32     ERROR("error")
33 }
34
35 open class PrioritizationConfiguration : Serializable {
36     lateinit var expiryConfiguration: ExpiryConfiguration
37     lateinit var shutDownConfiguration: ShutDownConfiguration
38     lateinit var cleanConfiguration: CleanConfiguration
39     var kafkaConfiguration: KafkaConfiguration? = null // Optional Kafka Consumer Configuration
40     var natsConfiguration: NatsConfiguration? = null // Optional NATS Consumer Configuration
41 }
42
43 open class KafkaConfiguration : Serializable {
44     lateinit var inputTopicSelector: String // Consumer Configuration Selector
45     lateinit var expiredTopic: String // Publish Configuration Selector
46     lateinit var outputTopic: String // Publish Configuration Selector
47 }
48
49 open class NatsConfiguration : Serializable {
50     lateinit var connectionSelector: String // Consumer Configuration Selector
51     lateinit var inputSubject: String // Publish Configuration Selector
52     lateinit var expiredSubject: String // Publish Configuration Selector
53     lateinit var outputSubject: String // Publish Configuration Selector
54 }
55
56 open class ExpiryConfiguration : Serializable {
57     var frequencyMilli: Long = 30000L
58     var maxPollRecord: Int = 1000
59 }
60
61 open class ShutDownConfiguration : Serializable {
62     var waitMill: Long = 30000L
63 }
64
65 open class CleanConfiguration : Serializable {
66     var frequencyMilli: Long = 30000L
67     var expiredRecordsHoldDays: Int = 5
68 }
69
70 open class UpdateStateRequest : Serializable {
71     lateinit var id: String
72     var group: String? = null
73     var state: String? = null
74 }
75
76 data class CorrelationCheckResponse(
77     var message: String? = null,
78     var correlated: Boolean = false
79 )
80
81 data class TypeCorrelationKey(val type: String, val correlationId: String)