2 * Copyright © 2017-2018 AT&T Intellectual Property.
3 * Modifications Copyright © 2018 IBM.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 package org.onap.ccsdk.cds.blueprintsprocessor.core.api.data
20 import com.fasterxml.jackson.annotation.JsonFormat
21 import com.fasterxml.jackson.databind.JsonNode
22 import com.fasterxml.jackson.databind.node.ObjectNode
23 import io.swagger.annotations.ApiModelProperty
27 * BlueprintProcessorData
28 * @author Brinda Santh
32 open class ExecutionServiceInput {
33 @get:ApiModelProperty(required = true)
34 lateinit var commonHeader: CommonHeader
35 @get:ApiModelProperty(required = true)
36 lateinit var actionIdentifiers: ActionIdentifiers
37 @get:ApiModelProperty(required = true)
38 lateinit var payload: ObjectNode
39 var stepData: StepData? = null
42 open class ExecutionServiceOutput {
43 @get:ApiModelProperty(required = true)
44 lateinit var commonHeader: CommonHeader
45 @get:ApiModelProperty(required = true)
46 lateinit var actionIdentifiers: ActionIdentifiers
47 @get:ApiModelProperty(required = true)
48 lateinit var status: Status
49 @get:ApiModelProperty(required = true)
50 lateinit var payload: ObjectNode
51 var stepData: StepData? = null
54 const val ACTION_MODE_ASYNC = "async"
55 const val ACTION_MODE_SYNC = "sync"
57 open class ActionIdentifiers {
58 @get:ApiModelProperty(required = false)
59 lateinit var blueprintName: String
60 @get:ApiModelProperty(required = false)
61 lateinit var blueprintVersion: String
62 @get:ApiModelProperty(required = true)
63 lateinit var actionName: String
64 @get:ApiModelProperty(required = true, allowableValues = "sync, async")
65 lateinit var mode: String
68 open class CommonHeader {
69 @get:ApiModelProperty(required = true, example = "2012-04-23T18:25:43.511Z")
70 @get:JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
71 var timestamp: Date = Date()
72 @get:ApiModelProperty(required = true)
73 lateinit var originatorId: String
74 @get:ApiModelProperty(required = true)
75 lateinit var requestId: String
76 @get:ApiModelProperty(required = true)
77 lateinit var subRequestId: String
78 @get:ApiModelProperty(required = false)
79 var flags: Flags? = null
83 var isForce: Boolean = false
84 @get:ApiModelProperty(value = "3600")
89 @get:ApiModelProperty(required = true)
91 @get:ApiModelProperty(required = true)
92 var eventType: String = ""
93 @get:ApiModelProperty(required = true, example = "2012-04-23T18:25:43.511Z")
94 @get:JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
95 var timestamp: Date = Date()
96 @get:ApiModelProperty(required = false)
97 var errorMessage: String? = null
98 @get:ApiModelProperty(required = true)
99 var message: String = "success"
102 open class StepData {
103 lateinit var name: String
104 var properties: MutableMap<String, JsonNode> = mutableMapOf()