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