Feature uses features-parent as parent
[groupbasedpolicy.git] / renderers / opflex / src / main / java / org / opendaylight / groupbasedpolicy / renderer / opflex / lib / messages / PolicyResolveResponse.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
16 import com.fasterxml.jackson.annotation.JsonIgnore;
17 import com.fasterxml.jackson.databind.JsonNode;
18 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
19 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
20
21 @JsonSerialize
22 @JsonDeserialize
23 public class PolicyResolveResponse extends RpcMessage {
24
25     public static final String POLICY_MESSAGE_RESPONSE = "policy_resolve_response";
26
27     static public class Result {
28
29         private List<ManagedObject> policy;
30
31         public List<ManagedObject> getPolicy() {
32             return policy;
33         }
34
35         public void setPolicy(List<ManagedObject> policy) {
36             this.policy = policy;
37         }
38     }
39
40     private JsonNode id;
41     private Result result;
42     private OpflexError error;
43
44     @JsonIgnore
45     private String name;
46     @JsonIgnore
47     private String method;
48
49     @Override
50     public JsonNode getId() {
51         return id;
52     }
53
54     @Override
55     public void setId(JsonNode id) {
56         this.id = id;
57     }
58
59     public OpflexError getError() {
60         return error;
61     }
62
63     public void setError(OpflexError error) {
64         this.error = error;
65     }
66
67     @Override
68     public String getMethod() {
69         return null;
70     }
71
72     @Override
73     public void setMethod(String method) {}
74
75     public Result getResult() {
76         return this.result;
77     }
78
79     public void setResult(Result result) {
80         this.result = result;
81     }
82
83     public PolicyResolveResponse(String name) {
84         this.name = name;
85     }
86
87     public PolicyResolveResponse() {
88         this.name = POLICY_MESSAGE_RESPONSE;
89     }
90
91     @Override
92     public String getName() {
93         return this.name;
94     }
95
96     @Override
97     public void setName(String name) {
98         this.name = name;
99     }
100
101     @JsonIgnore
102     @Override
103     public boolean valid() {
104         return true;
105     }
106
107 }