From 9d12c15053c000b48af68a766f69c7ec8b008db6 Mon Sep 17 00:00:00 2001 From: Alexis de Talhouët Date: Tue, 15 Jan 2019 16:17:17 -0500 Subject: Add support for async REST MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ieb53cbd75c2e21355b153611f6490c1b2af6053b Issue-ID: CCSDK-662 Signed-off-by: Alexis de Talhouët --- .../core/api/data/BlueprintProcessorData.kt | 196 ++++++++++----------- 1 file changed, 97 insertions(+), 99 deletions(-) (limited to 'ms/blueprintsprocessor/modules/commons') diff --git a/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorData.kt b/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorData.kt index b0483dc3..438e755c 100644 --- a/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorData.kt +++ b/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorData.kt @@ -1,99 +1,97 @@ -/* - * Copyright © 2017-2018 AT&T Intellectual Property. - * Modifications Copyright © 2018 IBM. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.onap.ccsdk.apps.blueprintsprocessor.core.api.data - -import com.fasterxml.jackson.annotation.JsonFormat -import com.fasterxml.jackson.databind.node.ObjectNode -import io.swagger.annotations.ApiModelProperty -import java.util.* - -/** - * BlueprintProcessorData - * @author Brinda Santh - * DATE : 8/15/2018 - */ - -open class ExecutionServiceInput { - @get:ApiModelProperty(required = true) - lateinit var commonHeader: CommonHeader - @get:ApiModelProperty(required = true) - lateinit var actionIdentifiers: ActionIdentifiers - @get:ApiModelProperty(required = true) - lateinit var payload: ObjectNode -} - -open class ExecutionServiceOutput { - @get:ApiModelProperty(required = true) - lateinit var commonHeader: CommonHeader - @get:ApiModelProperty(required = true) - lateinit var actionIdentifiers: ActionIdentifiers - @get:ApiModelProperty(required = true) - var status: Status = Status() - @get:ApiModelProperty(required = true) - lateinit var payload: ObjectNode -} - -open class ActionIdentifiers { - @get:ApiModelProperty(required = false) - lateinit var blueprintName: String - @get:ApiModelProperty(required = false) - lateinit var blueprintVersion: String - @get:ApiModelProperty(required = true) - lateinit var actionName: String - @get:ApiModelProperty(required = true, allowableValues = "sync, async") - lateinit var mode: String -} - -open class CommonHeader { - @get:ApiModelProperty(required = true, example = "2012-04-23T18:25:43.511Z") - @get:JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") - var timestamp: Date = Date() - @get:ApiModelProperty(required = true) - lateinit var originatorId: String - @get:ApiModelProperty(required = true) - lateinit var requestId: String - @get:ApiModelProperty(required = true) - lateinit var subRequestId: String - @get:ApiModelProperty(required = false) - var flags: Flags? = null -} - -open class Flags { - var isForce: Boolean = false - @get:ApiModelProperty(value = "3600") - var ttl: Int = 3600 -} - -open class Status { - @get:ApiModelProperty(required = true) - var code: Int = 200 - @get:ApiModelProperty(required = true) - var eventType: String = "EVENT-ACTION-RESPONSE" - @get:ApiModelProperty(required = true, example = "2012-04-23T18:25:43.511Z") - @get:JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") - var timestamp: Date = Date() - @get:ApiModelProperty(required = false) - var errorMessage: String? = null - @get:ApiModelProperty(required = true) - var message: String = "success" -} - - - - - +/* + * Copyright © 2017-2018 AT&T Intellectual Property. + * Modifications Copyright © 2018 IBM. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.ccsdk.apps.blueprintsprocessor.core.api.data + +import com.fasterxml.jackson.annotation.JsonFormat +import com.fasterxml.jackson.databind.node.ObjectNode +import io.swagger.annotations.ApiModelProperty +import java.util.* + +/** + * BlueprintProcessorData + * @author Brinda Santh + * DATE : 8/15/2018 + */ + +open class ExecutionServiceInput { + @get:ApiModelProperty(required = true) + lateinit var commonHeader: CommonHeader + @get:ApiModelProperty(required = true) + lateinit var actionIdentifiers: ActionIdentifiers + @get:ApiModelProperty(required = true) + lateinit var payload: ObjectNode +} + +open class ExecutionServiceOutput { + @get:ApiModelProperty(required = true) + lateinit var commonHeader: CommonHeader + @get:ApiModelProperty(required = true) + lateinit var actionIdentifiers: ActionIdentifiers + @get:ApiModelProperty(required = true) + var status: Status = Status() + @get:ApiModelProperty(required = true) + lateinit var payload: ObjectNode +} + +const val ACTION_MODE_ASYNC = "async" +const val ACTION_MODE_SYNC = "sync" + +open class ActionIdentifiers { + @get:ApiModelProperty(required = false) + lateinit var blueprintName: String + @get:ApiModelProperty(required = false) + lateinit var blueprintVersion: String + @get:ApiModelProperty(required = true) + lateinit var actionName: String + @get:ApiModelProperty(required = true, allowableValues = "sync, async") + lateinit var mode: String +} + +open class CommonHeader { + @get:ApiModelProperty(required = true, example = "2012-04-23T18:25:43.511Z") + @get:JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") + var timestamp: Date = Date() + @get:ApiModelProperty(required = true) + lateinit var originatorId: String + @get:ApiModelProperty(required = true) + lateinit var requestId: String + @get:ApiModelProperty(required = true) + lateinit var subRequestId: String + @get:ApiModelProperty(required = false) + var flags: Flags? = null +} + +open class Flags { + var isForce: Boolean = false + @get:ApiModelProperty(value = "3600") + var ttl: Int = 3600 +} + +open class Status { + @get:ApiModelProperty(required = true) + var code: Int = 200 + @get:ApiModelProperty(required = true) + var eventType: String = "EVENT-ACTION-RESPONSE" + @get:ApiModelProperty(required = true, example = "2012-04-23T18:25:43.511Z") + @get:JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") + var timestamp: Date = Date() + @get:ApiModelProperty(required = false) + var errorMessage: String? = null + @get:ApiModelProperty(required = true) + var message: String = "success" +} -- cgit 1.2.3-korg