Open Kilda Java Documentation
FlowRerouteRequest.java
Go to the documentation of this file.
1 /* Copyright 2017 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.command.flow;
17 
20 
21 import com.fasterxml.jackson.annotation.JsonCreator;
22 import com.fasterxml.jackson.annotation.JsonInclude;
23 import com.fasterxml.jackson.annotation.JsonProperty;
24 import lombok.EqualsAndHashCode;
25 import lombok.NonNull;
26 import lombok.Value;
27 
28 @Value
29 @EqualsAndHashCode(callSuper = false)
30 @JsonInclude(JsonInclude.Include.NON_NULL)
31 public class FlowRerouteRequest extends CommandData {
35  private static final long serialVersionUID = 1L;
36 
37  @JsonProperty("flowid")
38  protected String flowId;
39 
40  @JsonProperty("operation")
41  private FlowOperation operation;
42 
46  @JsonProperty("force")
47  private boolean force;
48 
49  public FlowRerouteRequest(String flowId) {
50  this(flowId, false);
51  }
52 
53  public FlowRerouteRequest(String flowId, boolean force) {
54  this(flowId, FlowOperation.UPDATE, force);
55  }
56 
57  @JsonCreator
58  public FlowRerouteRequest(@NonNull @JsonProperty("flowid") String flowId,
59  @NonNull @JsonProperty("operation") FlowOperation operation,
60  @JsonProperty("force") boolean force) {
61  this.flowId = flowId;
62  this.operation = operation;
63  this.force = force;
64  }
65 }
FlowRerouteRequest(@NonNull @JsonProperty("flowid") String flowId, @NonNull @JsonProperty("operation") FlowOperation operation, @JsonProperty("force") boolean force)