Feature uses features-parent as parent
[groupbasedpolicy.git] / renderers / opflex / src / main / java / org / opendaylight / groupbasedpolicy / renderer / opflex / lib / messages / EndpointResolveRequest.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.List;
13
14 import org.opendaylight.groupbasedpolicy.renderer.opflex.jsonrpc.RpcMessage;
15 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
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 EndpointResolveRequest extends RpcMessage {
25
26     public static final String EP_RESOLVE_REQUEST_MESSAGE = "endpoint_resolve";
27
28     static public class Params {
29
30         private String subject;
31         private Uri endpoint_uri;
32         private EndpointIdentity endpoint_ident;
33         private int prr;
34
35         public String getSubject() {
36             return subject;
37         }
38
39         public void setSubject(String subject) {
40             this.subject = subject;
41         }
42
43         public Uri getEndpoint_uri() {
44             return endpoint_uri;
45         }
46
47         public void setEndpoint_uri(Uri endpoint_uri) {
48             this.endpoint_uri = endpoint_uri;
49         }
50
51         public EndpointIdentity getEndpoint_ident() {
52             return endpoint_ident;
53         }
54
55         public void setEndpoint_ident(EndpointIdentity endpoint_ident) {
56             this.endpoint_ident = endpoint_ident;
57         }
58
59         public int getPrr() {
60             return prr;
61         }
62
63         public void setPrr(int prr) {
64             this.prr = prr;
65         }
66     }
67
68     private JsonNode id;
69     private String method;
70     private List<Params> params;
71
72     @JsonIgnore
73     private String name;
74
75     @Override
76     public JsonNode getId() {
77         return id;
78     }
79
80     @Override
81     public void setId(JsonNode id) {
82         this.id = id;
83     }
84
85     @Override
86     public String getMethod() {
87         return method;
88     }
89
90     @Override
91     public void setMethod(String method) {
92         this.method = method;
93     }
94
95     public List<Params> getParams() {
96         return this.params;
97     }
98
99     public void setParams(List<Params> params) {
100         this.params = params;
101     }
102
103     @Override
104     public String getName() {
105         return this.name;
106     }
107
108     @Override
109     public void setName(String name) {
110         this.name = name;
111     }
112
113     public EndpointResolveRequest(String name) {
114         this.name = name;
115     }
116
117     public EndpointResolveRequest() {
118         this.name = EP_RESOLVE_REQUEST_MESSAGE;
119     }
120
121     /**
122      * Minimal check on validity of message
123      * 
124      * @return true if message has passed validity check
125      */
126     @JsonIgnore
127     @Override
128     public boolean valid() {
129         if (params == null)
130             return false;
131         if (params.get(0) == null)
132             return false;
133         return true;
134     }
135 }