487fe46bc2d2a1469bdcaa0a9d263ccf79a189fa
[alto.git] / alto-commons / src / main / java / org / opendaylight / alto / commons / types / rfc7285 / RFC7285Endpoint.java
1 /*
2  * Copyright (c) 2015 Yale University and others.  All rights reserved.
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
9 package org.opendaylight.alto.commons.types.rfc7285;
10
11 import com.fasterxml.jackson.annotation.JsonProperty;
12 import com.fasterxml.jackson.annotation.JsonIgnore;
13
14 import java.util.List;
15 import java.util.ArrayList;
16 import java.util.Map;
17 import java.util.LinkedHashMap;
18
19
20 public class RFC7285Endpoint {
21
22     public static class AddressGroup extends Extensible {
23
24         @JsonIgnore
25         public static final String IPV4_LABEL = "ipv4";
26
27         @JsonIgnore
28         public static final String IPV6_LABEL = "ipv6";
29
30         @JsonProperty(IPV4_LABEL)
31         public List<String> ipv4 = new ArrayList<String>();
32
33         @JsonProperty(IPV6_LABEL)
34         public List<String> ipv6 = new ArrayList<String>();
35
36     }
37
38     public static class PropertyRequest {
39
40         @JsonProperty(value="properties")
41         public List<String> properties;
42
43         @JsonProperty(value="endpoints")
44         public List<String> endpoints;
45     }
46
47     public static class PropertyResponse {
48
49         public static class Meta extends Extensible {
50
51             @JsonProperty("dependent-vtags")
52             public List<RFC7285VersionTag> netmap_tags = new ArrayList<RFC7285VersionTag>();
53
54         }
55
56         @JsonProperty("meta")
57         public Meta meta = new Meta();
58
59         @JsonProperty("endpoint-properties")
60         public Map<String, Map<String, Object>> answer
61                             = new LinkedHashMap<String, Map<String, Object>>();
62     }
63
64     public static class CostRequest {
65
66         @JsonProperty("cost-type")
67         public RFC7285CostType costType = new RFC7285CostType();
68
69         @JsonProperty("endpoints")
70         public RFC7285QueryPairs endpoints = new RFC7285QueryPairs();
71     }
72
73     public static class CostResponse {
74
75         public static class Meta extends Extensible {
76
77             @JsonProperty("cost-type")
78             public RFC7285CostType costType = new RFC7285CostType();
79
80         }
81
82         @JsonProperty("meta")
83         public Meta meta = new Meta();
84
85         @JsonProperty("endpoint-cost-map")
86         public Map<String, Map<String, Object>> answer
87                             = new LinkedHashMap<String, Map<String, Object>>();
88     }
89 }