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.renderer.opflex.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 {
31 private final String proto_version;
33 private String domain;
34 private List<String> my_role;
36 public String getName() {
40 public void setName(String name) {
45 this.proto_version = OPFLEX_PROTOCOL_VERSION;
46 my_role = new ArrayList<String>();
49 public String getProto_version() {
53 public String getDomain() {
57 public void setDomain(String domain) {
61 public List<String> getMy_role() {
65 public void setMy_role(List<String> my_role) {
66 this.my_role = my_role;
72 private String method;
73 private List<Params> params;
79 public JsonNode getId() {
84 public void setId(JsonNode id) {
89 public String getMethod() {
94 public void setMethod(String method) {
98 public List<Params> getParams() {
102 public void setParams(List<Params> params) {
103 this.params = params;
107 public String getName() {
112 public void setName(String name) {
116 public IdentityRequest(String name) {
120 public IdentityRequest() {
121 this.name = IDENTITY_MESSAGE;
122 this.method = IDENTITY_MESSAGE;
126 * Minimal check on validity of message
128 * @return true if message has passed validity check
132 public boolean valid() {
135 if (params.get(0) == null)