2 * Copyright (C) 2014 Cisco Systems, Inc.
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
8 * Authors : Thomas Bachman
10 package org.opendaylight.groupbasedpolicy.renderer.opflex.lib.messages;
12 import java.util.List;
14 import org.opendaylight.groupbasedpolicy.jsonrpc.RpcMessage;
15 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
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;
24 public class PolicyUpdateRequest extends RpcMessage {
26 public static final String UPDATE_MESSAGE = "policy_update";
28 static public class Params {
29 private List<ManagedObject> replace;
30 private List<ManagedObject> merge_children;
31 private List<Uri> delete_uri;
32 public List<ManagedObject> getReplace() {
35 public void setReplace(List<ManagedObject> replace) {
36 this.replace = replace;
38 public List<ManagedObject> getMerge_children() {
39 return merge_children;
41 public void setMerge_children(List<ManagedObject> merge_children) {
42 this.merge_children = merge_children;
44 public List<Uri> getDelete_uri() {
47 public void setDelete_uri(List<Uri> delete_uri) {
48 this.delete_uri = delete_uri;
52 private String method;
53 private List<Params> params;
59 public JsonNode getId() {
64 public void setId(JsonNode id) {
69 public String getMethod() {
74 public void setMethod(String method) {
78 public List<Params> getParams() {
82 public void setParams(List<Params> params) {
87 public String getName() {
92 public void setName(String name) {
96 public PolicyUpdateRequest(String name) {
100 public PolicyUpdateRequest() {
101 this.name = UPDATE_MESSAGE;
102 this.method = UPDATE_MESSAGE;
106 * Minimal check on validity of message
107 * @return true if message has passed validity check
111 public boolean valid() {
114 if (params.get(0) == null)