Feature uses features-parent as parent
[groupbasedpolicy.git] / renderers / opflex / src / main / java / org / opendaylight / groupbasedpolicy / renderer / opflex / lib / messages / IdentityResponse.java
1 /*
2  * Copyright (C) 2014 Cisco Systems, Inc.
3  * 
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  * 
8  * Authors : Thomas Bachman
9  */
10 package org.opendaylight.groupbasedpolicy.renderer.opflex.lib.messages;
11
12 import java.util.ArrayList;
13 import java.util.List;
14
15 import org.opendaylight.groupbasedpolicy.renderer.opflex.jsonrpc.RpcMessage;
16
17 import com.fasterxml.jackson.annotation.JsonIgnore;
18 import com.fasterxml.jackson.databind.JsonNode;
19 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
20 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
21
22 @JsonSerialize
23 @JsonDeserialize
24 public class IdentityResponse extends RpcMessage {
25
26     public static final String IDENTITY_MESSAGE_RESPONSE = "send_identity_response";
27
28     static public class Peer {
29
30         private List<String> role;
31         private String connectivity_info;
32
33         public List<String> getRole() {
34             return role;
35         }
36
37         public void setRole(List<String> role) {
38             this.role = role;
39         }
40
41         public String getConnectivity_info() {
42             return connectivity_info;
43         }
44
45         public void setConnectivity_info(String connectivity_info) {
46             this.connectivity_info = connectivity_info;
47         }
48
49         public Peer() {}
50     }
51
52     static public class Result {
53
54         private String name;
55         private String domain;
56         private List<String> my_role;
57         private List<Peer> peers;
58
59         public String getName() {
60             return this.name;
61         }
62
63         public void setName(String name) {
64             this.name = name;
65         }
66
67         public Result() {
68             my_role = new ArrayList<String>();
69         }
70
71         public String getDomain() {
72             return domain;
73         }
74
75         public void setDomain(String domain) {
76             this.domain = domain;
77         }
78
79         public List<String> getMy_role() {
80             return my_role;
81         }
82
83         public void setMy_role(List<String> my_role) {
84             this.my_role = my_role;
85         }
86
87         public List<Peer> getPeers() {
88             return peers;
89         }
90
91         public void setPeers(List<Peer> peers) {
92             this.peers = peers;
93         }
94
95     }
96
97     private JsonNode id;
98     private Result result;
99     private OpflexError error;
100
101     @JsonIgnore
102     private String name;
103     @JsonIgnore
104     private String method;
105
106     @Override
107     public JsonNode getId() {
108         return id;
109     }
110
111     @Override
112     public void setId(JsonNode id) {
113         this.id = id;
114     }
115
116     public OpflexError getError() {
117         return error;
118     }
119
120     public void setError(OpflexError error) {
121         this.error = error;
122     }
123
124     @Override
125     public String getMethod() {
126         return null;
127     }
128
129     @Override
130     public void setMethod(String method) {}
131
132     public Result getResult() {
133         return this.result;
134     }
135
136     public void setResult(Result result) {
137         this.result = result;
138     }
139
140     public IdentityResponse(String name) {
141         this.name = name;
142     }
143
144     public IdentityResponse() {
145         this.name = IDENTITY_MESSAGE_RESPONSE;
146     }
147
148     @Override
149     public String getName() {
150         return this.name;
151     }
152
153     @Override
154     public void setName(String name) {
155         this.name = name;
156     }
157
158     @JsonIgnore
159     @Override
160     public boolean valid() {
161         return true;
162     }
163
164 }