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.ArrayList;
13 import java.util.List;
15 import org.opendaylight.groupbasedpolicy.jsonrpc.RpcMessage;
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 IdentityRequest extends RpcMessage {
26 public static final String IDENTITY_MESSAGE = "send_identity";
27 public static final String OPFLEX_PROTOCOL_VERSION = "1.0";
29 static public class Params {
30 private final String proto_version;
32 private String domain;
33 private List<String> my_role;
34 public String getName() {
38 public void setName(String name) {
43 this.proto_version = OPFLEX_PROTOCOL_VERSION;
44 my_role = new ArrayList<String>();
47 public String getProto_version() {
51 public String getDomain() {
55 public void setDomain(String domain) {
59 public List<String> getMy_role() {
63 public void setMy_role(List<String> my_role) {
64 this.my_role = my_role;
70 private String method;
71 private List<Params> params;
77 public JsonNode getId() {
82 public void setId(JsonNode id) {
87 public String getMethod() {
92 public void setMethod(String method) {
96 public List<Params> getParams() {
100 public void setParams(List<Params> params) {
101 this.params = params;
105 public String getName() {
110 public void setName(String name) {
114 public IdentityRequest(String name) {
118 public IdentityRequest() {
119 this.name = IDENTITY_MESSAGE;
120 this.method = IDENTITY_MESSAGE;
124 * Minimal check on validity of message
125 * @return true if message has passed validity check
129 public boolean valid() {
132 if (params.get(0) == null)