0f975c24c54509997007559009ef918ddd94f68f
[ccsdk/oran.git] /
1 /*-
2  * ========================LICENSE_START=================================
3  * ONAP : ccsdk oran
4  * ======================================================================
5  * Copyright (C) 2019-2020 Nordix Foundation. All rights reserved.
6  * ======================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ========================LICENSE_END===================================
19  */
20
21 package org.onap.ccsdk.oran.a1policymanagementservice.controllers.v2;
22
23 import com.fasterxml.jackson.annotation.JsonProperty;
24 import com.google.gson.annotations.SerializedName;
25
26 import io.swagger.v3.oas.annotations.media.Schema;
27
28 @Schema(name = "service_registration_info_v2", description = "Information for one service")
29 public class ServiceRegistrationInfo {
30
31     @Schema(description = "identity of the service", required = true)
32     @SerializedName("service_id")
33     @JsonProperty("service_id")
34     public String serviceId = "";
35
36     @Schema(description = "keep alive interval for the service. This is used to enable optional heartbeat supervision of the service. "
37             + "If set (> 0) the registered service should regularly invoke a 'keepalive' REST call. "
38             + "When a service fails to invoke this 'keepalive' call within the configured time, the service is considered unavailable. "
39             + "An unavailable service will be automatically deregistered and its policies will be deleted. "
40             + "Value 0 means timeout supervision is disabled.")
41     @SerializedName("keep_alive_interval_seconds")
42     @JsonProperty("keep_alive_interval_seconds")
43     public long keepAliveIntervalSeconds = 0;
44
45     @Schema(description = "callback for notifying of Near-RT RIC state changes", required = false)
46     @SerializedName("callback_url")
47     @JsonProperty("callback_url")
48     public String callbackUrl = "";
49
50     public ServiceRegistrationInfo() {}
51
52     public ServiceRegistrationInfo(String id, long keepAliveIntervalSeconds, String callbackUrl) {
53         this.serviceId = id;
54         this.keepAliveIntervalSeconds = keepAliveIntervalSeconds;
55         this.callbackUrl = callbackUrl;
56     }
57
58 }