Open Kilda Java Documentation
DeleteRulesAction.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.command.switches;
17 
21 public enum DeleteRulesAction {
22  // Drop all rules
24 
25  // Drop all rules, add back in the base default rules
27 
28  // Don't drop the default rules, but do drop everything else
30 
31  // Drop all non-base rules (ie IGNORE), and add base rules back (eg overwrite)
33 
34  // Drop just the default / base drop rule
36 
37  // Drop just the verification (broadcast) rule only
39 
40  // Drop just the verification (unicast) rule only
42 
43  // Drop all default rules (ie a combination of the above)
45 
46  // Drop the default, add them back .. presumably a good way to ensure the defaults are there
48 
49  public boolean defaultRulesToBeRemoved() {
50  return this == DROP_ALL || this == DROP_ALL_ADD_DEFAULTS || this == REMOVE_DEFAULTS
51  || this == REMOVE_ADD_DEFAULTS;
52  }
53 
54  public boolean nonDefaultRulesToBeRemoved() {
55  return this == DROP_ALL || this == DROP_ALL_ADD_DEFAULTS || this == IGNORE_DEFAULTS
56  || this == OVERWRITE_DEFAULTS;
57  }
58 
59  public boolean defaultRulesToBeInstalled() {
60  return this == DROP_ALL_ADD_DEFAULTS || this == REMOVE_ADD_DEFAULTS || this == OVERWRITE_DEFAULTS;
61  }
62 }
63