|
| 1 | +/* Copyright 2019 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.payload.flow; |
| 17 | + |
| 18 | +import org.openkilda.messaging.Utils; |
| 19 | + |
| 20 | +import com.fasterxml.jackson.annotation.JsonCreator; |
| 21 | +import com.fasterxml.jackson.annotation.JsonInclude; |
| 22 | +import com.fasterxml.jackson.annotation.JsonProperty; |
| 23 | +import lombok.Data; |
| 24 | +import lombok.EqualsAndHashCode; |
| 25 | + |
| 26 | +@Data |
| 27 | +@EqualsAndHashCode(callSuper = true) |
| 28 | +@JsonInclude(JsonInclude.Include.NON_NULL) |
| 29 | +public class FlowCreatePayload extends FlowPayload { |
| 30 | + |
| 31 | + @JsonProperty("diverse-flowid") |
| 32 | + private String diverseFlowId; |
| 33 | + |
| 34 | + /** |
| 35 | + * Instance constructor. |
| 36 | + * |
| 37 | + * @param id flow id |
| 38 | + * @param source flow source |
| 39 | + * @param destination flow destination |
| 40 | + * @param maximumBandwidth flow maximum bandwidth |
| 41 | + * @param ignoreBandwidth should ignore bandwidth in path computation |
| 42 | + * @param periodicPings enable periodic flow pings |
| 43 | + * @param description flow description |
| 44 | + * @param lastUpdated flow last updated timestamp |
| 45 | + * @param diverseFlowId make new flow diverse with FlowId |
| 46 | + * @param status flow status |
| 47 | + */ |
| 48 | + @JsonCreator |
| 49 | + public FlowCreatePayload(@JsonProperty(Utils.FLOW_ID) String id, |
| 50 | + @JsonProperty("source") FlowEndpointPayload source, |
| 51 | + @JsonProperty("destination") FlowEndpointPayload destination, |
| 52 | + @JsonProperty("maximum-bandwidth") long maximumBandwidth, |
| 53 | + @JsonProperty("ignore_bandwidth") Boolean ignoreBandwidth, |
| 54 | + @JsonProperty("periodic-pings") Boolean periodicPings, |
| 55 | + @JsonProperty("description") String description, |
| 56 | + @JsonProperty("last-updated") String lastUpdated, |
| 57 | + @JsonProperty("diverse-flowid") String diverseFlowId, |
| 58 | + @JsonProperty("status") String status) { |
| 59 | + super(id, source, destination, maximumBandwidth, ignoreBandwidth, periodicPings, description, |
| 60 | + lastUpdated, status); |
| 61 | + this.diverseFlowId = diverseFlowId; |
| 62 | + } |
| 63 | +} |
0 commit comments