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