Open Kilda Java Documentation
ConnectModeRequest.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 
18  import com.fasterxml.jackson.annotation.JsonInclude;
20 
21 import static com.google.common.base.MoreObjects.toStringHelper;
22 import static org.openkilda.messaging.Utils.TIMESTAMP;
23 
30 @JsonInclude(JsonInclude.Include.NON_NULL)
31 public class ConnectModeRequest extends CommandData {
32 
36  public enum Mode {
37  AUTO, // Default rules will be added automatically, with no traffic evaluation
38  SAFE, // Default rules will be added "safely" .. ie evaluate network traffic
39  MANUAL // No default rules will be added when a switch connects
40  }
41 
42  private Mode mode;
43 
49  public ConnectModeRequest(Mode mode) {
50  this.mode = mode;
51  }
52 
53  public Mode getMode() {
54  return mode;
55  }
56 
57  @Override
58  public String toString() {
59  return toStringHelper(this)
60  .add(TIMESTAMP, timestamp)
61  .add("mode", mode)
62  .toString();
63  }
64 }
static final String TIMESTAMP
Definition: Utils.java:35