Merge "Added STD sim 2.0.0 tests"
[nonrtric.git] / policy-agent / src / main / java / org / oransc / policyagent / controllers / ServiceRegistrationInfo.java
1 /*-
2  * ========================LICENSE_START=================================
3  * O-RAN-SC
4  * %%
5  * Copyright (C) 2019 Nordix Foundation
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.oransc.policyagent.controllers;
22
23 import com.google.gson.annotations.SerializedName;
24
25 import io.swagger.annotations.ApiModel;
26 import io.swagger.annotations.ApiModelProperty;
27
28 import org.immutables.gson.Gson;
29
30 @Gson.TypeAdapters
31 @ApiModel(value = "ServiceRegistrationInfo")
32 public class ServiceRegistrationInfo {
33
34     @ApiModelProperty(value = "identity of the service", required = true, allowEmptyValue = false)
35     @SerializedName(value = "serviceName", alternate = {"name"})
36
37     public String serviceName = "";
38
39     @ApiModelProperty(
40         value = "keep alive interval for the service. This is a heartbeat supervision of the service, "
41             + "which in regular intevals must invoke a 'keepAlive' REST call. "
42             + "When a service does not invoke this call within the given time, it is considered unavailble. "
43             + "An unavailable service will be automatically deregistered and its policies will be deleted. "
44             + "Value 0 means no timeout supervision.")
45     @SerializedName("keepAliveIntervalSeconds")
46     public long keepAliveIntervalSeconds = 0;
47
48     @ApiModelProperty(value = "callback for notifying of RIC synchronization", required = false, allowEmptyValue = true)
49     @SerializedName("callbackUrl")
50     public String callbackUrl = "";
51
52     public ServiceRegistrationInfo() {
53     }
54
55     public ServiceRegistrationInfo(String name, long keepAliveIntervalSeconds, String callbackUrl) {
56         this.serviceName = name;
57         this.keepAliveIntervalSeconds = keepAliveIntervalSeconds;
58         this.callbackUrl = callbackUrl;
59     }
60
61 }