Open Kilda Java Documentation
RemoveFlow.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 
18 import static org.openkilda.messaging.Utils.FLOW_ID;
20 
23 
24 import com.fasterxml.jackson.annotation.JsonCreator;
25 import com.fasterxml.jackson.annotation.JsonInclude;
26 import com.fasterxml.jackson.annotation.JsonProperty;
27 import com.fasterxml.jackson.annotation.JsonPropertyOrder;
28 import lombok.Value;
29 
33 @Value
34 @JsonInclude(JsonInclude.Include.NON_NULL)
35 @JsonPropertyOrder({
36  "command",
37  TRANSACTION_ID,
38  FLOW_ID,
39  "cookie",
40  "switch_id",
41  "meter_id"})
42 public class RemoveFlow extends BaseFlow {
43 
44  @JsonProperty("meter_id")
45  private Long meterId;
46 
47  @JsonProperty("criteria")
48  private DeleteRulesCriteria criteria;
49 
61  @JsonCreator
62  public RemoveFlow(@JsonProperty(TRANSACTION_ID) Long transactionId,
63  @JsonProperty(FLOW_ID) String flowId,
64  @JsonProperty("cookie") Long cookie,
65  @JsonProperty("switch_id") SwitchId switchId,
66  @JsonProperty("meter_id") Long meterId,
67  @JsonProperty("criteria") DeleteRulesCriteria criteria) {
68  super(transactionId, flowId, cookie, switchId);
69 
70  if (meterId != null && meterId < 0L) {
71  throw new IllegalArgumentException("need to set non negative meter_id");
72  }
73  this.meterId = meterId;
74  this.criteria = criteria;
75  }
76 }
RemoveFlow(@JsonProperty(TRANSACTION_ID) Long transactionId, @JsonProperty(FLOW_ID) String flowId, @JsonProperty("cookie") Long cookie, @JsonProperty("switch_id") SwitchId switchId, @JsonProperty("meter_id") Long meterId, @JsonProperty("criteria") DeleteRulesCriteria criteria)
Definition: RemoveFlow.java:62
static final String TRANSACTION_ID
Definition: Utils.java:39
static final String FLOW_ID
Definition: Utils.java:61