blob: 78d4e442fa1abcba82c3379f78bfd5e9c99006b0 [file] [log] [blame]
Dimitrios Mavrommatisf0c06322017-10-31 23:49:04 -07001/*
2 * Copyright 2017-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.artemis.impl.objects;
18
19import com.fasterxml.jackson.annotation.JsonInclude;
20import com.fasterxml.jackson.annotation.JsonProperty;
21import com.fasterxml.jackson.annotation.JsonPropertyOrder;
22
23import java.io.Serializable;
24
25/**
26 * Messages that are exchanged between the two MOAS entities.
27 */
28@JsonInclude(JsonInclude.Include.NON_NULL)
29@JsonPropertyOrder({
30 "type", "localIp", "localPrefix"
31})
32public class ArtemisMessage implements Serializable {
33
34 @JsonProperty("type")
35 private Type type;
36
37 @JsonProperty("localIp")
38 private String localIp;
39
40 @JsonProperty("localPrefix")
41 private String localPrefix;
42
43 public Type getType() {
44 return type;
45 }
46
47 public void setType(Type type) {
48 this.type = type;
49 }
50
51 public String getLocalIp() {
52 return localIp;
53 }
54
55 public void setLocalIp(String localIp) {
56 this.localIp = localIp;
57 }
58
59 public String getLocalPrefix() {
60 return localPrefix;
61 }
62
63 public void setLocalPrefix(String localPrefix) {
64 this.localPrefix = localPrefix;
65 }
66
67 @Override
68 public String toString() {
69 return "ArtemisMessage{" +
70 "type=" + type +
71 ", localIp=" + localIp +
72 ", localPrefix=" + localPrefix +
73 '}';
74 }
75
76 public enum Type {
77 INITIATE_FROM_CLIENT,
78 INITIATE_FROM_SERVER
79 }
80}