Open Kilda Java Documentation
UniFlowVerificationResponse.java
Go to the documentation of this file.
1 /* Copyright 2018 Telstra Open Source
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 package org.openkilda.messaging.info.flow;
17 
20 
21 import com.fasterxml.jackson.annotation.JsonCreator;
22 import com.fasterxml.jackson.annotation.JsonIgnore;
23 import com.fasterxml.jackson.annotation.JsonInclude;
24 import com.fasterxml.jackson.annotation.JsonProperty;
25 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
26 import lombok.Value;
27 
28 import java.util.UUID;
29 
30 @Value
31 @JsonSerialize
32 @JsonInclude(JsonInclude.Include.NON_NULL)
33 public class UniFlowVerificationResponse extends InfoData {
34  @JsonProperty("ping_success")
35  private boolean pingSuccess;
36 
37  @JsonProperty("error")
38  private FlowVerificationErrorCode error;
39 
40  @JsonProperty("measures")
41  private VerificationMeasures measures;
42 
43  @JsonProperty("request")
44  private UniFlowVerificationRequest request;
45 
46  @JsonCreator
48  @JsonProperty("ping_success") boolean pingSuccess,
49  @JsonProperty("error") FlowVerificationErrorCode error,
50  @JsonProperty("network_latency") VerificationMeasures measures,
51  @JsonProperty("request") UniFlowVerificationRequest request) {
52  this.pingSuccess = pingSuccess;
53  this.error = error;
54  this.measures = measures;
55  this.request = request;
56  }
57 
59  this(true, null, measures, request);
60  }
61 
64  this(false, error, null, request);
65  }
66 
67  @JsonIgnore
68  public String getFlowId() {
69  return getRequest().getFlowId();
70  }
71 
72  @JsonIgnore
73  public UUID getPacketId() {
74  return getRequest().getPacketId();
75  }
76 }
UniFlowVerificationResponse( @JsonProperty("ping_success") boolean pingSuccess, @JsonProperty("error") FlowVerificationErrorCode error, @JsonProperty("network_latency") VerificationMeasures measures, @JsonProperty("request") UniFlowVerificationRequest request)
UniFlowVerificationResponse(UniFlowVerificationRequest request, FlowVerificationErrorCode error)
UniFlowVerificationResponse(UniFlowVerificationRequest request, VerificationMeasures measures)