Committed by
Ray Milkey
Use LF as line separator
Change-Id: I99e78013813e85ea69acb35c8b74252a7b5d7329
Showing
34 changed files
with
2022 additions
and
2022 deletions
1 | -/* | 1 | +/* |
2 | - * Copyright 2015 Open Networking Laboratory | 2 | + * Copyright 2015 Open Networking Laboratory |
3 | - * | 3 | + * |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | - * you may not use this file except in compliance with the License. | 5 | + * you may not use this file except in compliance with the License. |
6 | - * You may obtain a copy of the License at | 6 | + * You may obtain a copy of the License at |
7 | - * | 7 | + * |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | - * | 9 | + * |
10 | - * Unless required by applicable law or agreed to in writing, software | 10 | + * Unless required by applicable law or agreed to in writing, software |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | - * See the License for the specific language governing permissions and | 13 | + * See the License for the specific language governing permissions and |
14 | - * limitations under the License. | 14 | + * limitations under the License. |
15 | - */ | 15 | + */ |
16 | -package org.onosproject.vtnrsc; | 16 | +package org.onosproject.vtnrsc; |
17 | - | 17 | + |
18 | -import org.onlab.packet.IpAddress; | 18 | +import org.onlab.packet.IpAddress; |
19 | - | 19 | + |
20 | -/** | 20 | +/** |
21 | - * The continuous IP address range between the start address and the end address for the allocation pools. | 21 | + * The continuous IP address range between the start address and the end address for the allocation pools. |
22 | - */ | 22 | + */ |
23 | -public interface AllocationPool { | 23 | +public interface AllocationPool { |
24 | - | 24 | + |
25 | - /** | 25 | + /** |
26 | - * The start address for the allocation pool. | 26 | + * The start address for the allocation pool. |
27 | - * | 27 | + * |
28 | - * @return startIp | 28 | + * @return startIp |
29 | - */ | 29 | + */ |
30 | - IpAddress startIp(); | 30 | + IpAddress startIp(); |
31 | - | 31 | + |
32 | - /** | 32 | + /** |
33 | - * The end address for the allocation pool. | 33 | + * The end address for the allocation pool. |
34 | - * | 34 | + * |
35 | - * @return endIp | 35 | + * @return endIp |
36 | - */ | 36 | + */ |
37 | - IpAddress endIp(); | 37 | + IpAddress endIp(); |
38 | -} | 38 | +} | ... | ... |
1 | -/* | 1 | +/* |
2 | - * Copyright 2015 Open Networking Laboratory | 2 | + * Copyright 2015 Open Networking Laboratory |
3 | - * | 3 | + * |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | - * you may not use this file except in compliance with the License. | 5 | + * you may not use this file except in compliance with the License. |
6 | - * You may obtain a copy of the License at | 6 | + * You may obtain a copy of the License at |
7 | - * | 7 | + * |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | - * | 9 | + * |
10 | - * Unless required by applicable law or agreed to in writing, software | 10 | + * Unless required by applicable law or agreed to in writing, software |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | - * See the License for the specific language governing permissions and | 13 | + * See the License for the specific language governing permissions and |
14 | - * limitations under the License. | 14 | + * limitations under the License. |
15 | - */ | 15 | + */ |
16 | -package org.onosproject.vtnrsc; | 16 | +package org.onosproject.vtnrsc; |
17 | - | 17 | + |
18 | -import static com.google.common.base.MoreObjects.toStringHelper; | 18 | +import static com.google.common.base.MoreObjects.toStringHelper; |
19 | -import static com.google.common.base.Preconditions.checkNotNull; | 19 | +import static com.google.common.base.Preconditions.checkNotNull; |
20 | - | 20 | + |
21 | -import java.util.Objects; | 21 | +import java.util.Objects; |
22 | - | 22 | + |
23 | -import org.onlab.packet.IpAddress; | 23 | +import org.onlab.packet.IpAddress; |
24 | -import org.onlab.packet.MacAddress; | 24 | +import org.onlab.packet.MacAddress; |
25 | - | 25 | + |
26 | -/** | 26 | +/** |
27 | - * Immutable representation of a allowed address pair. | 27 | + * Immutable representation of a allowed address pair. |
28 | - */ | 28 | + */ |
29 | -public final class AllowedAddressPair { | 29 | +public final class AllowedAddressPair { |
30 | - private final IpAddress ip; | 30 | + private final IpAddress ip; |
31 | - private final MacAddress mac; | 31 | + private final MacAddress mac; |
32 | - // Public construction is prohibited | 32 | + // Public construction is prohibited |
33 | - private AllowedAddressPair(IpAddress ip, MacAddress mac) { | 33 | + private AllowedAddressPair(IpAddress ip, MacAddress mac) { |
34 | - checkNotNull(ip, "IpAddress cannot be null"); | 34 | + checkNotNull(ip, "IpAddress cannot be null"); |
35 | - checkNotNull(mac, "MacAddress cannot be null"); | 35 | + checkNotNull(mac, "MacAddress cannot be null"); |
36 | - this.ip = ip; | 36 | + this.ip = ip; |
37 | - this.mac = mac; | 37 | + this.mac = mac; |
38 | - } | 38 | + } |
39 | - /** | 39 | + /** |
40 | - * Returns the AllowedAddressPair ip address. | 40 | + * Returns the AllowedAddressPair ip address. |
41 | - * | 41 | + * |
42 | - * @return ip address | 42 | + * @return ip address |
43 | - */ | 43 | + */ |
44 | - public IpAddress ip() { | 44 | + public IpAddress ip() { |
45 | - return ip; | 45 | + return ip; |
46 | - } | 46 | + } |
47 | - | 47 | + |
48 | - /** | 48 | + /** |
49 | - * Returns the AllowedAddressPair MAC address. | 49 | + * Returns the AllowedAddressPair MAC address. |
50 | - * | 50 | + * |
51 | - * @return MAC address | 51 | + * @return MAC address |
52 | - */ | 52 | + */ |
53 | - public MacAddress mac() { | 53 | + public MacAddress mac() { |
54 | - return mac; | 54 | + return mac; |
55 | - } | 55 | + } |
56 | - | 56 | + |
57 | - | 57 | + |
58 | - /** | 58 | + /** |
59 | - * Creates a allowedAddressPair using the supplied ipAddress & | 59 | + * Creates a allowedAddressPair using the supplied ipAddress & |
60 | - * macAddress. | 60 | + * macAddress. |
61 | - * | 61 | + * |
62 | - * @param ip IP address | 62 | + * @param ip IP address |
63 | - * @param mac MAC address | 63 | + * @param mac MAC address |
64 | - * @return AllowedAddressPair | 64 | + * @return AllowedAddressPair |
65 | - */ | 65 | + */ |
66 | - public static AllowedAddressPair allowedAddressPair(IpAddress ip, | 66 | + public static AllowedAddressPair allowedAddressPair(IpAddress ip, |
67 | - MacAddress mac) { | 67 | + MacAddress mac) { |
68 | - return new AllowedAddressPair(ip, mac); | 68 | + return new AllowedAddressPair(ip, mac); |
69 | - } | 69 | + } |
70 | - | 70 | + |
71 | - @Override | 71 | + @Override |
72 | - public int hashCode() { | 72 | + public int hashCode() { |
73 | - return Objects.hash(ip, mac); | 73 | + return Objects.hash(ip, mac); |
74 | - } | 74 | + } |
75 | - | 75 | + |
76 | - @Override | 76 | + @Override |
77 | - public boolean equals(Object obj) { | 77 | + public boolean equals(Object obj) { |
78 | - if (this == obj) { | 78 | + if (this == obj) { |
79 | - return true; | 79 | + return true; |
80 | - } | 80 | + } |
81 | - if (obj instanceof AllowedAddressPair) { | 81 | + if (obj instanceof AllowedAddressPair) { |
82 | - final AllowedAddressPair that = (AllowedAddressPair) obj; | 82 | + final AllowedAddressPair that = (AllowedAddressPair) obj; |
83 | - return Objects.equals(this.ip, that.ip) | 83 | + return Objects.equals(this.ip, that.ip) |
84 | - && Objects.equals(this.mac, that.mac); | 84 | + && Objects.equals(this.mac, that.mac); |
85 | - } | 85 | + } |
86 | - return false; | 86 | + return false; |
87 | - } | 87 | + } |
88 | - | 88 | + |
89 | - @Override | 89 | + @Override |
90 | - public String toString() { | 90 | + public String toString() { |
91 | - return toStringHelper(this).add("ip", ip).add("mac", mac).toString(); | 91 | + return toStringHelper(this).add("ip", ip).add("mac", mac).toString(); |
92 | - } | 92 | + } |
93 | - | 93 | + |
94 | -} | 94 | +} | ... | ... |
1 | -/* | 1 | +/* |
2 | - * Copyright 2015 Open Networking Laboratory | 2 | + * Copyright 2015 Open Networking Laboratory |
3 | - * | 3 | + * |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | - * you may not use this file except in compliance with the License. | 5 | + * you may not use this file except in compliance with the License. |
6 | - * You may obtain a copy of the License at | 6 | + * You may obtain a copy of the License at |
7 | - * | 7 | + * |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | - * | 9 | + * |
10 | - * Unless required by applicable law or agreed to in writing, software | 10 | + * Unless required by applicable law or agreed to in writing, software |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | - * See the License for the specific language governing permissions and | 13 | + * See the License for the specific language governing permissions and |
14 | - * limitations under the License. | 14 | + * limitations under the License. |
15 | - */ | 15 | + */ |
16 | -package org.onosproject.vtnrsc; | 16 | +package org.onosproject.vtnrsc; |
17 | - | 17 | + |
18 | -import static com.google.common.base.Preconditions.checkNotNull; | 18 | +import static com.google.common.base.Preconditions.checkNotNull; |
19 | - | 19 | + |
20 | -import java.util.Objects; | 20 | +import java.util.Objects; |
21 | - | 21 | + |
22 | -public final class BindingHostId { | 22 | +public final class BindingHostId { |
23 | - private final String bindingHostId; | 23 | + private final String bindingHostId; |
24 | - | 24 | + |
25 | - // Public construction is prohibited | 25 | + // Public construction is prohibited |
26 | - private BindingHostId(String bindingHostId) { | 26 | + private BindingHostId(String bindingHostId) { |
27 | - checkNotNull(bindingHostId, "BindingHosttId cannot be null"); | 27 | + checkNotNull(bindingHostId, "BindingHosttId cannot be null"); |
28 | - this.bindingHostId = bindingHostId; | 28 | + this.bindingHostId = bindingHostId; |
29 | - } | 29 | + } |
30 | - | 30 | + |
31 | - /** | 31 | + /** |
32 | - * Creates a BindingHostId identifier. | 32 | + * Creates a BindingHostId identifier. |
33 | - * | 33 | + * |
34 | - * @param bindingHostId the bindingHostId identifier | 34 | + * @param bindingHostId the bindingHostId identifier |
35 | - * @return the bindingHostId identifier | 35 | + * @return the bindingHostId identifier |
36 | - */ | 36 | + */ |
37 | - public static BindingHostId bindingHostId(String bindingHostId) { | 37 | + public static BindingHostId bindingHostId(String bindingHostId) { |
38 | - return new BindingHostId(bindingHostId); | 38 | + return new BindingHostId(bindingHostId); |
39 | - } | 39 | + } |
40 | - | 40 | + |
41 | - /** | 41 | + /** |
42 | - * Returns the bindingHostId identifier. | 42 | + * Returns the bindingHostId identifier. |
43 | - * | 43 | + * |
44 | - * @return the bindingHostId identifier | 44 | + * @return the bindingHostId identifier |
45 | - */ | 45 | + */ |
46 | - public String bindingHostId() { | 46 | + public String bindingHostId() { |
47 | - return bindingHostId; | 47 | + return bindingHostId; |
48 | - } | 48 | + } |
49 | - | 49 | + |
50 | - @Override | 50 | + @Override |
51 | - public int hashCode() { | 51 | + public int hashCode() { |
52 | - return Objects.hash(bindingHostId); | 52 | + return Objects.hash(bindingHostId); |
53 | - } | 53 | + } |
54 | - | 54 | + |
55 | - @Override | 55 | + @Override |
56 | - public boolean equals(Object obj) { | 56 | + public boolean equals(Object obj) { |
57 | - if (this == obj) { | 57 | + if (this == obj) { |
58 | - return true; | 58 | + return true; |
59 | - } | 59 | + } |
60 | - if (obj instanceof BindingHostId) { | 60 | + if (obj instanceof BindingHostId) { |
61 | - final BindingHostId that = (BindingHostId) obj; | 61 | + final BindingHostId that = (BindingHostId) obj; |
62 | - return this.getClass() == that.getClass() | 62 | + return this.getClass() == that.getClass() |
63 | - && Objects.equals(this.bindingHostId, that.bindingHostId); | 63 | + && Objects.equals(this.bindingHostId, that.bindingHostId); |
64 | - } | 64 | + } |
65 | - return false; | 65 | + return false; |
66 | - } | 66 | + } |
67 | - | 67 | + |
68 | - @Override | 68 | + @Override |
69 | - public String toString() { | 69 | + public String toString() { |
70 | - return bindingHostId; | 70 | + return bindingHostId; |
71 | - } | 71 | + } |
72 | -} | 72 | +} | ... | ... |
1 | -/* | 1 | +/* |
2 | - * Copyright 2015 Open Networking Laboratory | 2 | + * Copyright 2015 Open Networking Laboratory |
3 | - * | 3 | + * |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | - * you may not use this file except in compliance with the License. | 5 | + * you may not use this file except in compliance with the License. |
6 | - * You may obtain a copy of the License at | 6 | + * You may obtain a copy of the License at |
7 | - * | 7 | + * |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | - * | 9 | + * |
10 | - * Unless required by applicable law or agreed to in writing, software | 10 | + * Unless required by applicable law or agreed to in writing, software |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | - * See the License for the specific language governing permissions and | 13 | + * See the License for the specific language governing permissions and |
14 | - * limitations under the License. | 14 | + * limitations under the License. |
15 | - */ | 15 | + */ |
16 | -package org.onosproject.vtnrsc; | 16 | +package org.onosproject.vtnrsc; |
17 | - | 17 | + |
18 | -import static com.google.common.base.MoreObjects.toStringHelper; | 18 | +import static com.google.common.base.MoreObjects.toStringHelper; |
19 | -import static com.google.common.base.Preconditions.checkNotNull; | 19 | +import static com.google.common.base.Preconditions.checkNotNull; |
20 | -import java.util.Objects; | 20 | +import java.util.Objects; |
21 | - | 21 | + |
22 | -import org.onlab.packet.IpAddress; | 22 | +import org.onlab.packet.IpAddress; |
23 | - | 23 | + |
24 | -/** | 24 | +/** |
25 | - * The continuous IP address range between the start address and the end address | 25 | + * The continuous IP address range between the start address and the end address |
26 | - * for the allocation pools. | 26 | + * for the allocation pools. |
27 | - */ | 27 | + */ |
28 | -public final class DefaultAllocationPool implements AllocationPool { | 28 | +public final class DefaultAllocationPool implements AllocationPool { |
29 | - | 29 | + |
30 | - private final IpAddress startIp; | 30 | + private final IpAddress startIp; |
31 | - private final IpAddress endIp; | 31 | + private final IpAddress endIp; |
32 | - | 32 | + |
33 | - /** | 33 | + /** |
34 | - * Creates an AllocationPool by using the start IP address and the end IP | 34 | + * Creates an AllocationPool by using the start IP address and the end IP |
35 | - * address. | 35 | + * address. |
36 | - * | 36 | + * |
37 | - * @param startIp the start IP address of the allocation pool | 37 | + * @param startIp the start IP address of the allocation pool |
38 | - * @param endIp the end IP address of the allocation pool | 38 | + * @param endIp the end IP address of the allocation pool |
39 | - */ | 39 | + */ |
40 | - public DefaultAllocationPool(IpAddress startIp, IpAddress endIp) { | 40 | + public DefaultAllocationPool(IpAddress startIp, IpAddress endIp) { |
41 | - checkNotNull(startIp, "StartIp cannot be null"); | 41 | + checkNotNull(startIp, "StartIp cannot be null"); |
42 | - checkNotNull(endIp, "EndIp cannot be null"); | 42 | + checkNotNull(endIp, "EndIp cannot be null"); |
43 | - this.startIp = startIp; | 43 | + this.startIp = startIp; |
44 | - this.endIp = endIp; | 44 | + this.endIp = endIp; |
45 | - } | 45 | + } |
46 | - | 46 | + |
47 | - @Override | 47 | + @Override |
48 | - public IpAddress startIp() { | 48 | + public IpAddress startIp() { |
49 | - return startIp; | 49 | + return startIp; |
50 | - } | 50 | + } |
51 | - | 51 | + |
52 | - @Override | 52 | + @Override |
53 | - public IpAddress endIp() { | 53 | + public IpAddress endIp() { |
54 | - return endIp; | 54 | + return endIp; |
55 | - } | 55 | + } |
56 | - | 56 | + |
57 | - @Override | 57 | + @Override |
58 | - public int hashCode() { | 58 | + public int hashCode() { |
59 | - return Objects.hash(startIp, endIp); | 59 | + return Objects.hash(startIp, endIp); |
60 | - } | 60 | + } |
61 | - | 61 | + |
62 | - @Override | 62 | + @Override |
63 | - public boolean equals(Object obj) { | 63 | + public boolean equals(Object obj) { |
64 | - if (this == obj) { | 64 | + if (this == obj) { |
65 | - return true; | 65 | + return true; |
66 | - } | 66 | + } |
67 | - if (obj instanceof DefaultAllocationPool) { | 67 | + if (obj instanceof DefaultAllocationPool) { |
68 | - final DefaultAllocationPool other = (DefaultAllocationPool) obj; | 68 | + final DefaultAllocationPool other = (DefaultAllocationPool) obj; |
69 | - return Objects.equals(this.startIp, other.startIp) | 69 | + return Objects.equals(this.startIp, other.startIp) |
70 | - && Objects.equals(this.endIp, other.endIp); | 70 | + && Objects.equals(this.endIp, other.endIp); |
71 | - } | 71 | + } |
72 | - return false; | 72 | + return false; |
73 | - } | 73 | + } |
74 | - | 74 | + |
75 | - @Override | 75 | + @Override |
76 | - public String toString() { | 76 | + public String toString() { |
77 | - return toStringHelper(this).add("startIp", startIp).add("endIp", endIp) | 77 | + return toStringHelper(this).add("startIp", startIp).add("endIp", endIp) |
78 | - .toString(); | 78 | + .toString(); |
79 | - } | 79 | + } |
80 | -} | 80 | +} |
81 | - | 81 | + | ... | ... |
1 | -/* | 1 | +/* |
2 | - * Copyright 2015 Open Networking Laboratory | 2 | + * Copyright 2015 Open Networking Laboratory |
3 | - * | 3 | + * |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | - * you may not use this file except in compliance with the License. | 5 | + * you may not use this file except in compliance with the License. |
6 | - * You may obtain a copy of the License at | 6 | + * You may obtain a copy of the License at |
7 | - * | 7 | + * |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | - * | 9 | + * |
10 | - * Unless required by applicable law or agreed to in writing, software | 10 | + * Unless required by applicable law or agreed to in writing, software |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | - * See the License for the specific language governing permissions and | 13 | + * See the License for the specific language governing permissions and |
14 | - * limitations under the License. | 14 | + * limitations under the License. |
15 | - */ | 15 | + */ |
16 | -package org.onosproject.vtnrsc; | 16 | +package org.onosproject.vtnrsc; |
17 | - | 17 | + |
18 | -import static com.google.common.base.MoreObjects.toStringHelper; | 18 | +import static com.google.common.base.MoreObjects.toStringHelper; |
19 | - | 19 | + |
20 | -import java.util.Objects; | 20 | +import java.util.Objects; |
21 | - | 21 | + |
22 | -import org.onlab.packet.IpAddress; | 22 | +import org.onlab.packet.IpAddress; |
23 | -import org.onlab.packet.IpPrefix; | 23 | +import org.onlab.packet.IpPrefix; |
24 | - | 24 | + |
25 | -/** | 25 | +/** |
26 | - * Host route dictionaries for the subnet. | 26 | + * Host route dictionaries for the subnet. |
27 | - */ | 27 | + */ |
28 | -public final class DefaultHostRoute implements HostRoute { | 28 | +public final class DefaultHostRoute implements HostRoute { |
29 | - | 29 | + |
30 | - private final IpAddress nexthop; | 30 | + private final IpAddress nexthop; |
31 | - private final IpPrefix destination; | 31 | + private final IpPrefix destination; |
32 | - | 32 | + |
33 | - /** | 33 | + /** |
34 | - * | 34 | + * |
35 | - * Creates a DefaultHostRoute by using the next hop and the destination. | 35 | + * Creates a DefaultHostRoute by using the next hop and the destination. |
36 | - * | 36 | + * |
37 | - * @param nexthop of the DefaultHostRoute | 37 | + * @param nexthop of the DefaultHostRoute |
38 | - * @param destination of the DefaultHostRoute | 38 | + * @param destination of the DefaultHostRoute |
39 | - */ | 39 | + */ |
40 | - public DefaultHostRoute(IpAddress nexthop, IpPrefix destination) { | 40 | + public DefaultHostRoute(IpAddress nexthop, IpPrefix destination) { |
41 | - this.nexthop = nexthop; | 41 | + this.nexthop = nexthop; |
42 | - this.destination = destination; | 42 | + this.destination = destination; |
43 | - } | 43 | + } |
44 | - | 44 | + |
45 | - @Override | 45 | + @Override |
46 | - public IpAddress nexthop() { | 46 | + public IpAddress nexthop() { |
47 | - return nexthop; | 47 | + return nexthop; |
48 | - } | 48 | + } |
49 | - | 49 | + |
50 | - @Override | 50 | + @Override |
51 | - public IpPrefix destination() { | 51 | + public IpPrefix destination() { |
52 | - return destination; | 52 | + return destination; |
53 | - } | 53 | + } |
54 | - | 54 | + |
55 | - @Override | 55 | + @Override |
56 | - public String toString() { | 56 | + public String toString() { |
57 | - return toStringHelper(this).add("nexthop", nexthop) | 57 | + return toStringHelper(this).add("nexthop", nexthop) |
58 | - .add("destination", destination).toString(); | 58 | + .add("destination", destination).toString(); |
59 | - } | 59 | + } |
60 | - | 60 | + |
61 | - @Override | 61 | + @Override |
62 | - public int hashCode() { | 62 | + public int hashCode() { |
63 | - return Objects.hash(nexthop, destination); | 63 | + return Objects.hash(nexthop, destination); |
64 | - } | 64 | + } |
65 | - | 65 | + |
66 | - @Override | 66 | + @Override |
67 | - public boolean equals(Object obj) { | 67 | + public boolean equals(Object obj) { |
68 | - if (this == obj) { | 68 | + if (this == obj) { |
69 | - return true; | 69 | + return true; |
70 | - } | 70 | + } |
71 | - if (obj instanceof DefaultHostRoute) { | 71 | + if (obj instanceof DefaultHostRoute) { |
72 | - final DefaultHostRoute other = (DefaultHostRoute) obj; | 72 | + final DefaultHostRoute other = (DefaultHostRoute) obj; |
73 | - return Objects.equals(this.nexthop, other.nexthop) | 73 | + return Objects.equals(this.nexthop, other.nexthop) |
74 | - && Objects.equals(this.destination, other.destination); | 74 | + && Objects.equals(this.destination, other.destination); |
75 | - } | 75 | + } |
76 | - return false; | 76 | + return false; |
77 | - } | 77 | + } |
78 | - | 78 | + |
79 | -} | 79 | +} | ... | ... |
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 | -/* | 1 | +/* |
2 | - * Copyright 2015 Open Networking Laboratory | 2 | + * Copyright 2015 Open Networking Laboratory |
3 | - * | 3 | + * |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | - * you may not use this file except in compliance with the License. | 5 | + * you may not use this file except in compliance with the License. |
6 | - * You may obtain a copy of the License at | 6 | + * You may obtain a copy of the License at |
7 | - * | 7 | + * |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | - * | 9 | + * |
10 | - * Unless required by applicable law or agreed to in writing, software | 10 | + * Unless required by applicable law or agreed to in writing, software |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | - * See the License for the specific language governing permissions and | 13 | + * See the License for the specific language governing permissions and |
14 | - * limitations under the License. | 14 | + * limitations under the License. |
15 | - */ | 15 | + */ |
16 | -package org.onosproject.vtnrsc; | 16 | +package org.onosproject.vtnrsc; |
17 | - | 17 | + |
18 | -import static com.google.common.base.MoreObjects.toStringHelper; | 18 | +import static com.google.common.base.MoreObjects.toStringHelper; |
19 | -import static com.google.common.base.Preconditions.checkNotNull; | 19 | +import static com.google.common.base.Preconditions.checkNotNull; |
20 | - | 20 | + |
21 | -import java.util.Objects; | 21 | +import java.util.Objects; |
22 | - | 22 | + |
23 | -import org.onlab.packet.IpAddress; | 23 | +import org.onlab.packet.IpAddress; |
24 | - | 24 | + |
25 | -/** | 25 | +/** |
26 | - * Immutable representation of a IP address for the port, Include the IP address | 26 | + * Immutable representation of a IP address for the port, Include the IP address |
27 | - * and subnet identity. | 27 | + * and subnet identity. |
28 | - */ | 28 | + */ |
29 | -public final class FixedIp { | 29 | +public final class FixedIp { |
30 | - private final SubnetId subnetId; | 30 | + private final SubnetId subnetId; |
31 | - private final IpAddress ip; | 31 | + private final IpAddress ip; |
32 | - // Public construction is prohibited | 32 | + // Public construction is prohibited |
33 | - private FixedIp(SubnetId subnetId, IpAddress ip) { | 33 | + private FixedIp(SubnetId subnetId, IpAddress ip) { |
34 | - checkNotNull(subnetId, "SubnetId cannot be null"); | 34 | + checkNotNull(subnetId, "SubnetId cannot be null"); |
35 | - checkNotNull(ip, "IpAddress cannot be null"); | 35 | + checkNotNull(ip, "IpAddress cannot be null"); |
36 | - this.subnetId = subnetId; | 36 | + this.subnetId = subnetId; |
37 | - this.ip = ip; | 37 | + this.ip = ip; |
38 | - } | 38 | + } |
39 | - | 39 | + |
40 | - /** | 40 | + /** |
41 | - * Returns the FixedIp subnet identifier. | 41 | + * Returns the FixedIp subnet identifier. |
42 | - * | 42 | + * |
43 | - * @return subnet identifier | 43 | + * @return subnet identifier |
44 | - */ | 44 | + */ |
45 | - public SubnetId subnetId() { | 45 | + public SubnetId subnetId() { |
46 | - return subnetId; | 46 | + return subnetId; |
47 | - } | 47 | + } |
48 | - | 48 | + |
49 | - /** | 49 | + /** |
50 | - * Returns the FixedIp IP address. | 50 | + * Returns the FixedIp IP address. |
51 | - * | 51 | + * |
52 | - * @return IP address | 52 | + * @return IP address |
53 | - */ | 53 | + */ |
54 | - public IpAddress ip() { | 54 | + public IpAddress ip() { |
55 | - return ip; | 55 | + return ip; |
56 | - } | 56 | + } |
57 | - | 57 | + |
58 | - /** | 58 | + /** |
59 | - * Creates a fixed ip using the supplied fixedIp. | 59 | + * Creates a fixed ip using the supplied fixedIp. |
60 | - * | 60 | + * |
61 | - * @param subnetId subnet identity | 61 | + * @param subnetId subnet identity |
62 | - * @param ip IP address | 62 | + * @param ip IP address |
63 | - * @return FixedIp | 63 | + * @return FixedIp |
64 | - */ | 64 | + */ |
65 | - public static FixedIp fixedIp(SubnetId subnetId, IpAddress ip) { | 65 | + public static FixedIp fixedIp(SubnetId subnetId, IpAddress ip) { |
66 | - return new FixedIp(subnetId, ip); | 66 | + return new FixedIp(subnetId, ip); |
67 | - } | 67 | + } |
68 | - | 68 | + |
69 | - @Override | 69 | + @Override |
70 | - public int hashCode() { | 70 | + public int hashCode() { |
71 | - return Objects.hash(subnetId, ip); | 71 | + return Objects.hash(subnetId, ip); |
72 | - } | 72 | + } |
73 | - | 73 | + |
74 | - @Override | 74 | + @Override |
75 | - public boolean equals(Object obj) { | 75 | + public boolean equals(Object obj) { |
76 | - if (this == obj) { | 76 | + if (this == obj) { |
77 | - return true; | 77 | + return true; |
78 | - } | 78 | + } |
79 | - if (obj instanceof FixedIp) { | 79 | + if (obj instanceof FixedIp) { |
80 | - final FixedIp that = (FixedIp) obj; | 80 | + final FixedIp that = (FixedIp) obj; |
81 | - return Objects.equals(this.subnetId, that.subnetId) | 81 | + return Objects.equals(this.subnetId, that.subnetId) |
82 | - && Objects.equals(this.ip, that.ip); | 82 | + && Objects.equals(this.ip, that.ip); |
83 | - } | 83 | + } |
84 | - return false; | 84 | + return false; |
85 | - } | 85 | + } |
86 | - | 86 | + |
87 | - @Override | 87 | + @Override |
88 | - public String toString() { | 88 | + public String toString() { |
89 | - return toStringHelper(this).add("subnetId", subnetId).add("ip", ip) | 89 | + return toStringHelper(this).add("subnetId", subnetId).add("ip", ip) |
90 | - .toString(); | 90 | + .toString(); |
91 | - } | 91 | + } |
92 | - | 92 | + |
93 | -} | 93 | +} | ... | ... |
1 | -/* | 1 | +/* |
2 | - * Copyright 2015 Open Networking Laboratory | 2 | + * Copyright 2015 Open Networking Laboratory |
3 | - * | 3 | + * |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | - * you may not use this file except in compliance with the License. | 5 | + * you may not use this file except in compliance with the License. |
6 | - * You may obtain a copy of the License at | 6 | + * You may obtain a copy of the License at |
7 | - * | 7 | + * |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | - * | 9 | + * |
10 | - * Unless required by applicable law or agreed to in writing, software | 10 | + * Unless required by applicable law or agreed to in writing, software |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | - * See the License for the specific language governing permissions and | 13 | + * See the License for the specific language governing permissions and |
14 | - * limitations under the License. | 14 | + * limitations under the License. |
15 | - */ | 15 | + */ |
16 | -package org.onosproject.vtnrsc; | 16 | +package org.onosproject.vtnrsc; |
17 | - | 17 | + |
18 | -import org.onlab.packet.IpAddress; | 18 | +import org.onlab.packet.IpAddress; |
19 | -import org.onlab.packet.IpPrefix; | 19 | +import org.onlab.packet.IpPrefix; |
20 | - | 20 | + |
21 | -/** | 21 | +/** |
22 | - * Host route dictionaries for the subnet. | 22 | + * Host route dictionaries for the subnet. |
23 | - */ | 23 | + */ |
24 | -public interface HostRoute { | 24 | +public interface HostRoute { |
25 | - | 25 | + |
26 | - /** | 26 | + /** |
27 | - * Returns the next hop address. | 27 | + * Returns the next hop address. |
28 | - * | 28 | + * |
29 | - * @return next hop address | 29 | + * @return next hop address |
30 | - */ | 30 | + */ |
31 | - IpAddress nexthop(); | 31 | + IpAddress nexthop(); |
32 | - | 32 | + |
33 | - /** | 33 | + /** |
34 | - * Returns the destination address. | 34 | + * Returns the destination address. |
35 | - * | 35 | + * |
36 | - * @return destination address | 36 | + * @return destination address |
37 | - */ | 37 | + */ |
38 | - IpPrefix destination(); | 38 | + IpPrefix destination(); |
39 | -} | 39 | +} | ... | ... |
1 | -/* | 1 | +/* |
2 | - * Copyright 2015 Open Networking Laboratory | 2 | + * Copyright 2015 Open Networking Laboratory |
3 | - * | 3 | + * |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | - * you may not use this file except in compliance with the License. | 5 | + * you may not use this file except in compliance with the License. |
6 | - * You may obtain a copy of the License at | 6 | + * You may obtain a copy of the License at |
7 | - * | 7 | + * |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | - * | 9 | + * |
10 | - * Unless required by applicable law or agreed to in writing, software | 10 | + * Unless required by applicable law or agreed to in writing, software |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | - * See the License for the specific language governing permissions and | 13 | + * See the License for the specific language governing permissions and |
14 | - * limitations under the License. | 14 | + * limitations under the License. |
15 | - */ | 15 | + */ |
16 | -package org.onosproject.vtnrsc; | 16 | +package org.onosproject.vtnrsc; |
17 | - | 17 | + |
18 | -import java.util.Objects; | 18 | +import java.util.Objects; |
19 | - | 19 | + |
20 | -import static com.google.common.base.Preconditions.checkNotNull; | 20 | +import static com.google.common.base.Preconditions.checkNotNull; |
21 | - | 21 | + |
22 | -/** | 22 | +/** |
23 | - * Immutable representation of a physical network identity. | 23 | + * Immutable representation of a physical network identity. |
24 | - */ | 24 | + */ |
25 | -public final class PhysicalNetwork { | 25 | +public final class PhysicalNetwork { |
26 | - | 26 | + |
27 | - private final String physicalNetwork; | 27 | + private final String physicalNetwork; |
28 | - | 28 | + |
29 | - // Public construction is prohibited | 29 | + // Public construction is prohibited |
30 | - private PhysicalNetwork(String physicalNetwork) { | 30 | + private PhysicalNetwork(String physicalNetwork) { |
31 | - checkNotNull(physicalNetwork, "PhysicalNetwork cannot be null"); | 31 | + checkNotNull(physicalNetwork, "PhysicalNetwork cannot be null"); |
32 | - this.physicalNetwork = physicalNetwork; | 32 | + this.physicalNetwork = physicalNetwork; |
33 | - } | 33 | + } |
34 | - | 34 | + |
35 | - /** | 35 | + /** |
36 | - * Creates a PhysicalNetwork object. | 36 | + * Creates a PhysicalNetwork object. |
37 | - * | 37 | + * |
38 | - * @param physicalNetwork physical network | 38 | + * @param physicalNetwork physical network |
39 | - * @return physical network | 39 | + * @return physical network |
40 | - */ | 40 | + */ |
41 | - public static PhysicalNetwork physicalNetwork(String physicalNetwork) { | 41 | + public static PhysicalNetwork physicalNetwork(String physicalNetwork) { |
42 | - return new PhysicalNetwork(physicalNetwork); | 42 | + return new PhysicalNetwork(physicalNetwork); |
43 | - } | 43 | + } |
44 | - | 44 | + |
45 | - /** | 45 | + /** |
46 | - * Returns a physicalNetwork. | 46 | + * Returns a physicalNetwork. |
47 | - * | 47 | + * |
48 | - * @return physical network | 48 | + * @return physical network |
49 | - */ | 49 | + */ |
50 | - public String physicalNetwork() { | 50 | + public String physicalNetwork() { |
51 | - return physicalNetwork; | 51 | + return physicalNetwork; |
52 | - } | 52 | + } |
53 | - | 53 | + |
54 | - @Override | 54 | + @Override |
55 | - public int hashCode() { | 55 | + public int hashCode() { |
56 | - return Objects.hash(physicalNetwork); | 56 | + return Objects.hash(physicalNetwork); |
57 | - } | 57 | + } |
58 | - | 58 | + |
59 | - @Override | 59 | + @Override |
60 | - public boolean equals(Object obj) { | 60 | + public boolean equals(Object obj) { |
61 | - if (this == obj) { | 61 | + if (this == obj) { |
62 | - return true; | 62 | + return true; |
63 | - } | 63 | + } |
64 | - if (obj instanceof PhysicalNetwork) { | 64 | + if (obj instanceof PhysicalNetwork) { |
65 | - final PhysicalNetwork that = (PhysicalNetwork) obj; | 65 | + final PhysicalNetwork that = (PhysicalNetwork) obj; |
66 | - return this.getClass() == that.getClass() | 66 | + return this.getClass() == that.getClass() |
67 | - && Objects.equals(this.physicalNetwork, | 67 | + && Objects.equals(this.physicalNetwork, |
68 | - that.physicalNetwork); | 68 | + that.physicalNetwork); |
69 | - } | 69 | + } |
70 | - return false; | 70 | + return false; |
71 | - } | 71 | + } |
72 | - | 72 | + |
73 | - @Override | 73 | + @Override |
74 | - public String toString() { | 74 | + public String toString() { |
75 | - return physicalNetwork; | 75 | + return physicalNetwork; |
76 | - } | 76 | + } |
77 | - | 77 | + |
78 | -} | 78 | +} | ... | ... |
1 | -/* | 1 | +/* |
2 | - * Copyright 2015 Open Networking Laboratory | 2 | + * Copyright 2015 Open Networking Laboratory |
3 | - * | 3 | + * |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | - * you may not use this file except in compliance with the License. | 5 | + * you may not use this file except in compliance with the License. |
6 | - * You may obtain a copy of the License at | 6 | + * You may obtain a copy of the License at |
7 | - * | 7 | + * |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | - * | 9 | + * |
10 | - * Unless required by applicable law or agreed to in writing, software | 10 | + * Unless required by applicable law or agreed to in writing, software |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | - * See the License for the specific language governing permissions and | 13 | + * See the License for the specific language governing permissions and |
14 | - * limitations under the License. | 14 | + * limitations under the License. |
15 | - */ | 15 | + */ |
16 | -package org.onosproject.vtnrsc; | 16 | +package org.onosproject.vtnrsc; |
17 | - | 17 | + |
18 | -import java.util.Objects; | 18 | +import java.util.Objects; |
19 | - | 19 | + |
20 | -import static com.google.common.base.MoreObjects.toStringHelper; | 20 | +import static com.google.common.base.MoreObjects.toStringHelper; |
21 | -import static com.google.common.base.Preconditions.checkNotNull; | 21 | +import static com.google.common.base.Preconditions.checkNotNull; |
22 | - | 22 | + |
23 | -/** | 23 | +/** |
24 | - * Immutable representation of a security group. | 24 | + * Immutable representation of a security group. |
25 | - */ | 25 | + */ |
26 | -public final class SecurityGroup { | 26 | +public final class SecurityGroup { |
27 | - private final String securityGroup; | 27 | + private final String securityGroup; |
28 | - | 28 | + |
29 | - /** | 29 | + /** |
30 | - * Returns the securityGroup. | 30 | + * Returns the securityGroup. |
31 | - * | 31 | + * |
32 | - * @return securityGroup | 32 | + * @return securityGroup |
33 | - */ | 33 | + */ |
34 | - public String securityGroup() { | 34 | + public String securityGroup() { |
35 | - return securityGroup; | 35 | + return securityGroup; |
36 | - } | 36 | + } |
37 | - // Public construction is prohibited | 37 | + // Public construction is prohibited |
38 | - private SecurityGroup(String securityGroup) { | 38 | + private SecurityGroup(String securityGroup) { |
39 | - checkNotNull(securityGroup, "SecurityGroup cannot be null"); | 39 | + checkNotNull(securityGroup, "SecurityGroup cannot be null"); |
40 | - this.securityGroup = securityGroup; | 40 | + this.securityGroup = securityGroup; |
41 | - } | 41 | + } |
42 | - | 42 | + |
43 | - /** | 43 | + /** |
44 | - * Creates a securityGroup using the supplied securityGroup. | 44 | + * Creates a securityGroup using the supplied securityGroup. |
45 | - * | 45 | + * |
46 | - * @param securityGroup security group | 46 | + * @param securityGroup security group |
47 | - * @return securityGroup | 47 | + * @return securityGroup |
48 | - */ | 48 | + */ |
49 | - public static SecurityGroup securityGroup(String securityGroup) { | 49 | + public static SecurityGroup securityGroup(String securityGroup) { |
50 | - return new SecurityGroup(securityGroup); | 50 | + return new SecurityGroup(securityGroup); |
51 | - } | 51 | + } |
52 | - | 52 | + |
53 | - @Override | 53 | + @Override |
54 | - public int hashCode() { | 54 | + public int hashCode() { |
55 | - return Objects.hash(securityGroup); | 55 | + return Objects.hash(securityGroup); |
56 | - } | 56 | + } |
57 | - | 57 | + |
58 | - @Override | 58 | + @Override |
59 | - public boolean equals(Object obj) { | 59 | + public boolean equals(Object obj) { |
60 | - if (this == obj) { | 60 | + if (this == obj) { |
61 | - return true; | 61 | + return true; |
62 | - } | 62 | + } |
63 | - if (obj instanceof SecurityGroup) { | 63 | + if (obj instanceof SecurityGroup) { |
64 | - final SecurityGroup that = (SecurityGroup) obj; | 64 | + final SecurityGroup that = (SecurityGroup) obj; |
65 | - return this.getClass() == that.getClass() | 65 | + return this.getClass() == that.getClass() |
66 | - && Objects.equals(this.securityGroup, that.securityGroup); | 66 | + && Objects.equals(this.securityGroup, that.securityGroup); |
67 | - } | 67 | + } |
68 | - return false; | 68 | + return false; |
69 | - } | 69 | + } |
70 | - | 70 | + |
71 | - @Override | 71 | + @Override |
72 | - public String toString() { | 72 | + public String toString() { |
73 | - return toStringHelper(this).add("securityGroup", securityGroup) | 73 | + return toStringHelper(this).add("securityGroup", securityGroup) |
74 | - .toString(); | 74 | + .toString(); |
75 | - } | 75 | + } |
76 | - | 76 | + |
77 | -} | 77 | +} | ... | ... |
1 | -/* | 1 | +/* |
2 | - * Copyright 2015 Open Networking Laboratory | 2 | + * Copyright 2015 Open Networking Laboratory |
3 | - * | 3 | + * |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | - * you may not use this file except in compliance with the License. | 5 | + * you may not use this file except in compliance with the License. |
6 | - * You may obtain a copy of the License at | 6 | + * You may obtain a copy of the License at |
7 | - * | 7 | + * |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | - * | 9 | + * |
10 | - * Unless required by applicable law or agreed to in writing, software | 10 | + * Unless required by applicable law or agreed to in writing, software |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | - * See the License for the specific language governing permissions and | 13 | + * See the License for the specific language governing permissions and |
14 | - * limitations under the License. | 14 | + * limitations under the License. |
15 | - */ | 15 | + */ |
16 | -package org.onosproject.vtnrsc; | 16 | +package org.onosproject.vtnrsc; |
17 | - | 17 | + |
18 | -import java.util.Objects; | 18 | +import java.util.Objects; |
19 | - | 19 | + |
20 | -import static com.google.common.base.Preconditions.checkNotNull; | 20 | +import static com.google.common.base.Preconditions.checkNotNull; |
21 | - | 21 | + |
22 | -/** | 22 | +/** |
23 | - * Immutable representation of a Segmentation identifier. | 23 | + * Immutable representation of a Segmentation identifier. |
24 | - */ | 24 | + */ |
25 | -public final class SegmentationId { | 25 | +public final class SegmentationId { |
26 | - | 26 | + |
27 | - private final String segmentationId; | 27 | + private final String segmentationId; |
28 | - | 28 | + |
29 | - // Public construction is prohibited | 29 | + // Public construction is prohibited |
30 | - private SegmentationId(String segmentationId) { | 30 | + private SegmentationId(String segmentationId) { |
31 | - checkNotNull(segmentationId, "SegmentationId cannot be null"); | 31 | + checkNotNull(segmentationId, "SegmentationId cannot be null"); |
32 | - this.segmentationId = segmentationId; | 32 | + this.segmentationId = segmentationId; |
33 | - } | 33 | + } |
34 | - | 34 | + |
35 | - /** | 35 | + /** |
36 | - * Creates a SegmentationId object. | 36 | + * Creates a SegmentationId object. |
37 | - * | 37 | + * |
38 | - * @param segmentationId segmentation identifier | 38 | + * @param segmentationId segmentation identifier |
39 | - * @return SegmentationId | 39 | + * @return SegmentationId |
40 | - */ | 40 | + */ |
41 | - public static SegmentationId segmentationId(String segmentationId) { | 41 | + public static SegmentationId segmentationId(String segmentationId) { |
42 | - return new SegmentationId(segmentationId); | 42 | + return new SegmentationId(segmentationId); |
43 | - } | 43 | + } |
44 | - | 44 | + |
45 | - /** | 45 | + /** |
46 | - * Returns the segmentation identifier. | 46 | + * Returns the segmentation identifier. |
47 | - * | 47 | + * |
48 | - * @return segmentationId | 48 | + * @return segmentationId |
49 | - */ | 49 | + */ |
50 | - public String segmentationId() { | 50 | + public String segmentationId() { |
51 | - return segmentationId; | 51 | + return segmentationId; |
52 | - } | 52 | + } |
53 | - | 53 | + |
54 | - @Override | 54 | + @Override |
55 | - public int hashCode() { | 55 | + public int hashCode() { |
56 | - return Objects.hash(segmentationId); | 56 | + return Objects.hash(segmentationId); |
57 | - } | 57 | + } |
58 | - | 58 | + |
59 | - @Override | 59 | + @Override |
60 | - public boolean equals(Object obj) { | 60 | + public boolean equals(Object obj) { |
61 | - if (this == obj) { | 61 | + if (this == obj) { |
62 | - return true; | 62 | + return true; |
63 | - } | 63 | + } |
64 | - if (obj instanceof SegmentationId) { | 64 | + if (obj instanceof SegmentationId) { |
65 | - final SegmentationId that = (SegmentationId) obj; | 65 | + final SegmentationId that = (SegmentationId) obj; |
66 | - return this.getClass() == that.getClass() | 66 | + return this.getClass() == that.getClass() |
67 | - && Objects.equals(this.segmentationId, that.segmentationId); | 67 | + && Objects.equals(this.segmentationId, that.segmentationId); |
68 | - } | 68 | + } |
69 | - return false; | 69 | + return false; |
70 | - } | 70 | + } |
71 | - | 71 | + |
72 | - @Override | 72 | + @Override |
73 | - public String toString() { | 73 | + public String toString() { |
74 | - return segmentationId; | 74 | + return segmentationId; |
75 | - } | 75 | + } |
76 | - | 76 | + |
77 | -} | 77 | +} | ... | ... |
1 | -/* | 1 | +/* |
2 | - * Copyright 2015 Open Networking Laboratory | 2 | + * Copyright 2015 Open Networking Laboratory |
3 | - * | 3 | + * |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | - * you may not use this file except in compliance with the License. | 5 | + * you may not use this file except in compliance with the License. |
6 | - * You may obtain a copy of the License at | 6 | + * You may obtain a copy of the License at |
7 | - * | 7 | + * |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | - * | 9 | + * |
10 | - * Unless required by applicable law or agreed to in writing, software | 10 | + * Unless required by applicable law or agreed to in writing, software |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | - * See the License for the specific language governing permissions and | 13 | + * See the License for the specific language governing permissions and |
14 | - * limitations under the License. | 14 | + * limitations under the License. |
15 | - */ | 15 | + */ |
16 | -package org.onosproject.vtnrsc; | 16 | +package org.onosproject.vtnrsc; |
17 | - | 17 | + |
18 | -import org.onlab.packet.IpAddress; | 18 | +import org.onlab.packet.IpAddress; |
19 | -import org.onlab.packet.IpAddress.Version; | 19 | +import org.onlab.packet.IpAddress.Version; |
20 | -import org.onlab.packet.IpPrefix; | 20 | +import org.onlab.packet.IpPrefix; |
21 | - | 21 | + |
22 | -/** | 22 | +/** |
23 | - * Representation of a subnet. | 23 | + * Representation of a subnet. |
24 | - */ | 24 | + */ |
25 | -public interface Subnet { | 25 | +public interface Subnet { |
26 | - | 26 | + |
27 | - /** | 27 | + /** |
28 | - * Coarse classification of the type of the ipV6Mode. | 28 | + * Coarse classification of the type of the ipV6Mode. |
29 | - */ | 29 | + */ |
30 | - public enum Mode { | 30 | + public enum Mode { |
31 | - DHCPV6_STATEFUL, DHCPV6_STATELESS, SLAAC | 31 | + DHCPV6_STATEFUL, DHCPV6_STATELESS, SLAAC |
32 | - } | 32 | + } |
33 | - | 33 | + |
34 | - /** | 34 | + /** |
35 | - * Returns the subnet identifier. | 35 | + * Returns the subnet identifier. |
36 | - * | 36 | + * |
37 | - * @return identifier | 37 | + * @return identifier |
38 | - */ | 38 | + */ |
39 | - SubnetId id(); | 39 | + SubnetId id(); |
40 | - | 40 | + |
41 | - /** | 41 | + /** |
42 | - * Returns the name of the subnet. | 42 | + * Returns the name of the subnet. |
43 | - * | 43 | + * |
44 | - * @return subnetName | 44 | + * @return subnetName |
45 | - */ | 45 | + */ |
46 | - String subnetName(); | 46 | + String subnetName(); |
47 | - | 47 | + |
48 | - /** | 48 | + /** |
49 | - * Returns the network identifier. | 49 | + * Returns the network identifier. |
50 | - * | 50 | + * |
51 | - * @return the network identifier | 51 | + * @return the network identifier |
52 | - */ | 52 | + */ |
53 | - TenantNetworkId networkId(); | 53 | + TenantNetworkId networkId(); |
54 | - | 54 | + |
55 | - /** | 55 | + /** |
56 | - * Returns tenant identifier. | 56 | + * Returns tenant identifier. |
57 | - * | 57 | + * |
58 | - * @return the tenant identifier | 58 | + * @return the tenant identifier |
59 | - */ | 59 | + */ |
60 | - TenantId tenantId(); | 60 | + TenantId tenantId(); |
61 | - | 61 | + |
62 | - /** | 62 | + /** |
63 | - * Returns the IP version, which is 4 or 6. | 63 | + * Returns the IP version, which is 4 or 6. |
64 | - * | 64 | + * |
65 | - * @return ipVersion | 65 | + * @return ipVersion |
66 | - */ | 66 | + */ |
67 | - Version ipVersion(); | 67 | + Version ipVersion(); |
68 | - | 68 | + |
69 | - /** | 69 | + /** |
70 | - * Returns the cidr. | 70 | + * Returns the cidr. |
71 | - * | 71 | + * |
72 | - * @return cidr | 72 | + * @return cidr |
73 | - */ | 73 | + */ |
74 | - IpPrefix cidr(); | 74 | + IpPrefix cidr(); |
75 | - | 75 | + |
76 | - /** | 76 | + /** |
77 | - * Returns the gateway IP address. | 77 | + * Returns the gateway IP address. |
78 | - * | 78 | + * |
79 | - * @return gatewayIp | 79 | + * @return gatewayIp |
80 | - */ | 80 | + */ |
81 | - IpAddress gatewayIp(); | 81 | + IpAddress gatewayIp(); |
82 | - | 82 | + |
83 | - /** | 83 | + /** |
84 | - * Returns true if DHCP is enabled and return false if DHCP is disabled. | 84 | + * Returns true if DHCP is enabled and return false if DHCP is disabled. |
85 | - * | 85 | + * |
86 | - * @return true or false | 86 | + * @return true or false |
87 | - */ | 87 | + */ |
88 | - boolean dhcpEnabled(); | 88 | + boolean dhcpEnabled(); |
89 | - | 89 | + |
90 | - /** | 90 | + /** |
91 | - * Indicates whether this tenantNetwork is shared across all tenants. By | 91 | + * Indicates whether this tenantNetwork is shared across all tenants. By |
92 | - * default, only administrative user can change this value. | 92 | + * default, only administrative user can change this value. |
93 | - * | 93 | + * |
94 | - * @return true or false | 94 | + * @return true or false |
95 | - */ | 95 | + */ |
96 | - boolean shared(); | 96 | + boolean shared(); |
97 | - | 97 | + |
98 | - /** | 98 | + /** |
99 | - * Returns a collection of hostRoutes. | 99 | + * Returns a collection of hostRoutes. |
100 | - * | 100 | + * |
101 | - * @return a collection of hostRoutes | 101 | + * @return a collection of hostRoutes |
102 | - */ | 102 | + */ |
103 | - Iterable<HostRoute> hostRoutes(); | 103 | + Iterable<HostRoute> hostRoutes(); |
104 | - | 104 | + |
105 | - /** | 105 | + /** |
106 | - * Returns the ipV6AddressMode. A valid value is dhcpv6-stateful, | 106 | + * Returns the ipV6AddressMode. A valid value is dhcpv6-stateful, |
107 | - * dhcpv6-stateless, or slaac. | 107 | + * dhcpv6-stateless, or slaac. |
108 | - * | 108 | + * |
109 | - * @return ipV6AddressMode whose value is dhcpv6-stateful, dhcpv6-stateless | 109 | + * @return ipV6AddressMode whose value is dhcpv6-stateful, dhcpv6-stateless |
110 | - * or slaac | 110 | + * or slaac |
111 | - */ | 111 | + */ |
112 | - Mode ipV6AddressMode(); | 112 | + Mode ipV6AddressMode(); |
113 | - | 113 | + |
114 | - /** | 114 | + /** |
115 | - * Returns the ipV6RaMode.A valid value is dhcpv6-stateful, | 115 | + * Returns the ipV6RaMode.A valid value is dhcpv6-stateful, |
116 | - * dhcpv6-stateless, or slaac. | 116 | + * dhcpv6-stateless, or slaac. |
117 | - * | 117 | + * |
118 | - * @return ipV6RaMode whose value is dhcpv6-stateful, dhcpv6-stateless or | 118 | + * @return ipV6RaMode whose value is dhcpv6-stateful, dhcpv6-stateless or |
119 | - * slaac | 119 | + * slaac |
120 | - */ | 120 | + */ |
121 | - Mode ipV6RaMode(); | 121 | + Mode ipV6RaMode(); |
122 | - | 122 | + |
123 | - /** | 123 | + /** |
124 | - * Returns a collection of allocation_pools. | 124 | + * Returns a collection of allocation_pools. |
125 | - * | 125 | + * |
126 | - * @return a collection of allocationPools | 126 | + * @return a collection of allocationPools |
127 | - */ | 127 | + */ |
128 | - Iterable<AllocationPool> allocationPools(); | 128 | + Iterable<AllocationPool> allocationPools(); |
129 | -} | 129 | +} | ... | ... |
1 | -/* | 1 | +/* |
2 | - * Copyright 2015 Open Networking Laboratory | 2 | + * Copyright 2015 Open Networking Laboratory |
3 | - * | 3 | + * |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | - * you may not use this file except in compliance with the License. | 5 | + * you may not use this file except in compliance with the License. |
6 | - * You may obtain a copy of the License at | 6 | + * You may obtain a copy of the License at |
7 | - * | 7 | + * |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | - * | 9 | + * |
10 | - * Unless required by applicable law or agreed to in writing, software | 10 | + * Unless required by applicable law or agreed to in writing, software |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | - * See the License for the specific language governing permissions and | 13 | + * See the License for the specific language governing permissions and |
14 | - * limitations under the License. | 14 | + * limitations under the License. |
15 | - */ | 15 | + */ |
16 | -package org.onosproject.vtnrsc; | 16 | +package org.onosproject.vtnrsc; |
17 | - | 17 | + |
18 | -import static com.google.common.base.Preconditions.checkNotNull; | 18 | +import static com.google.common.base.Preconditions.checkNotNull; |
19 | - | 19 | + |
20 | -import java.util.Objects; | 20 | +import java.util.Objects; |
21 | - | 21 | + |
22 | -/** | 22 | +/** |
23 | - * Immutable representation of a subnet identifier. | 23 | + * Immutable representation of a subnet identifier. |
24 | - */ | 24 | + */ |
25 | -public final class SubnetId { | 25 | +public final class SubnetId { |
26 | - | 26 | + |
27 | - private final String subnetId; | 27 | + private final String subnetId; |
28 | - | 28 | + |
29 | - // Public construction is prohibited | 29 | + // Public construction is prohibited |
30 | - private SubnetId(String subnetId) { | 30 | + private SubnetId(String subnetId) { |
31 | - checkNotNull(subnetId, "SubnetId cannot be null"); | 31 | + checkNotNull(subnetId, "SubnetId cannot be null"); |
32 | - this.subnetId = subnetId; | 32 | + this.subnetId = subnetId; |
33 | - } | 33 | + } |
34 | - | 34 | + |
35 | - /** | 35 | + /** |
36 | - * Creates a Subnet identifier. | 36 | + * Creates a Subnet identifier. |
37 | - * | 37 | + * |
38 | - * @param subnetId the subnet identifier | 38 | + * @param subnetId the subnet identifier |
39 | - * @return the subnet identifier | 39 | + * @return the subnet identifier |
40 | - */ | 40 | + */ |
41 | - public static SubnetId subnetId(String subnetId) { | 41 | + public static SubnetId subnetId(String subnetId) { |
42 | - return new SubnetId(subnetId); | 42 | + return new SubnetId(subnetId); |
43 | - } | 43 | + } |
44 | - | 44 | + |
45 | - /** | 45 | + /** |
46 | - * Returns the subnet identifier. | 46 | + * Returns the subnet identifier. |
47 | - * | 47 | + * |
48 | - * @return the subnet identifier | 48 | + * @return the subnet identifier |
49 | - */ | 49 | + */ |
50 | - public String subnetId() { | 50 | + public String subnetId() { |
51 | - return subnetId; | 51 | + return subnetId; |
52 | - } | 52 | + } |
53 | - | 53 | + |
54 | - @Override | 54 | + @Override |
55 | - public int hashCode() { | 55 | + public int hashCode() { |
56 | - return Objects.hash(subnetId); | 56 | + return Objects.hash(subnetId); |
57 | - } | 57 | + } |
58 | - | 58 | + |
59 | - @Override | 59 | + @Override |
60 | - public boolean equals(Object obj) { | 60 | + public boolean equals(Object obj) { |
61 | - if (this == obj) { | 61 | + if (this == obj) { |
62 | - return true; | 62 | + return true; |
63 | - } | 63 | + } |
64 | - if (obj instanceof SubnetId) { | 64 | + if (obj instanceof SubnetId) { |
65 | - final SubnetId that = (SubnetId) obj; | 65 | + final SubnetId that = (SubnetId) obj; |
66 | - return this.getClass() == that.getClass() | 66 | + return this.getClass() == that.getClass() |
67 | - && Objects.equals(this.subnetId, that.subnetId); | 67 | + && Objects.equals(this.subnetId, that.subnetId); |
68 | - } | 68 | + } |
69 | - return false; | 69 | + return false; |
70 | - } | 70 | + } |
71 | - | 71 | + |
72 | - @Override | 72 | + @Override |
73 | - public String toString() { | 73 | + public String toString() { |
74 | - return subnetId; | 74 | + return subnetId; |
75 | - } | 75 | + } |
76 | -} | 76 | +} | ... | ... |
1 | -/* | 1 | +/* |
2 | - * Copyright 2015 Open Networking Laboratory | 2 | + * Copyright 2015 Open Networking Laboratory |
3 | - * | 3 | + * |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | - * you may not use this file except in compliance with the License. | 5 | + * you may not use this file except in compliance with the License. |
6 | - * You may obtain a copy of the License at | 6 | + * You may obtain a copy of the License at |
7 | - * | 7 | + * |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | - * | 9 | + * |
10 | - * Unless required by applicable law or agreed to in writing, software | 10 | + * Unless required by applicable law or agreed to in writing, software |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | - * See the License for the specific language governing permissions and | 13 | + * See the License for the specific language governing permissions and |
14 | - * limitations under the License. | 14 | + * limitations under the License. |
15 | - */ | 15 | + */ |
16 | -package org.onosproject.vtnrsc; | 16 | +package org.onosproject.vtnrsc; |
17 | - | 17 | + |
18 | -import java.util.Objects; | 18 | +import java.util.Objects; |
19 | - | 19 | + |
20 | -import static com.google.common.base.Preconditions.checkNotNull; | 20 | +import static com.google.common.base.Preconditions.checkNotNull; |
21 | - | 21 | + |
22 | -/** | 22 | +/** |
23 | - * Immutable representation of a tenant identifier. | 23 | + * Immutable representation of a tenant identifier. |
24 | - */ | 24 | + */ |
25 | -public final class TenantId { | 25 | +public final class TenantId { |
26 | - | 26 | + |
27 | - private final String tenantId; | 27 | + private final String tenantId; |
28 | - | 28 | + |
29 | - // Public construction is prohibited | 29 | + // Public construction is prohibited |
30 | - private TenantId(String tenantId) { | 30 | + private TenantId(String tenantId) { |
31 | - this.tenantId = tenantId; | 31 | + this.tenantId = tenantId; |
32 | - } | 32 | + } |
33 | - | 33 | + |
34 | - /** | 34 | + /** |
35 | - * Creates a network id using the tenantid. | 35 | + * Creates a network id using the tenantid. |
36 | - * | 36 | + * |
37 | - * @param tenantid network String | 37 | + * @param tenantid network String |
38 | - * @return TenantId | 38 | + * @return TenantId |
39 | - */ | 39 | + */ |
40 | - public static TenantId tenantId(String tenantid) { | 40 | + public static TenantId tenantId(String tenantid) { |
41 | - checkNotNull(tenantid, "Tenantid can not be null"); | 41 | + checkNotNull(tenantid, "Tenantid can not be null"); |
42 | - return new TenantId(tenantid); | 42 | + return new TenantId(tenantid); |
43 | - } | 43 | + } |
44 | - | 44 | + |
45 | - /** | 45 | + /** |
46 | - * Returns the tenant identifier. | 46 | + * Returns the tenant identifier. |
47 | - * | 47 | + * |
48 | - * @return the tenant identifier | 48 | + * @return the tenant identifier |
49 | - */ | 49 | + */ |
50 | - public String tenantId() { | 50 | + public String tenantId() { |
51 | - return tenantId; | 51 | + return tenantId; |
52 | - } | 52 | + } |
53 | - | 53 | + |
54 | - @Override | 54 | + @Override |
55 | - public int hashCode() { | 55 | + public int hashCode() { |
56 | - return Objects.hash(tenantId); | 56 | + return Objects.hash(tenantId); |
57 | - } | 57 | + } |
58 | - | 58 | + |
59 | - @Override | 59 | + @Override |
60 | - public boolean equals(Object obj) { | 60 | + public boolean equals(Object obj) { |
61 | - if (this == obj) { | 61 | + if (this == obj) { |
62 | - return true; | 62 | + return true; |
63 | - } | 63 | + } |
64 | - if (obj instanceof TenantId) { | 64 | + if (obj instanceof TenantId) { |
65 | - final TenantId that = (TenantId) obj; | 65 | + final TenantId that = (TenantId) obj; |
66 | - return this.getClass() == that.getClass() | 66 | + return this.getClass() == that.getClass() |
67 | - && Objects.equals(this.tenantId, that.tenantId); | 67 | + && Objects.equals(this.tenantId, that.tenantId); |
68 | - } | 68 | + } |
69 | - return false; | 69 | + return false; |
70 | - } | 70 | + } |
71 | - | 71 | + |
72 | - @Override | 72 | + @Override |
73 | - public String toString() { | 73 | + public String toString() { |
74 | - return tenantId; | 74 | + return tenantId; |
75 | - } | 75 | + } |
76 | - | 76 | + |
77 | -} | 77 | +} | ... | ... |
1 | -/* | 1 | +/* |
2 | - * Copyright 2015 Open Networking Laboratory | 2 | + * Copyright 2015 Open Networking Laboratory |
3 | - * | 3 | + * |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | - * you may not use this file except in compliance with the License. | 5 | + * you may not use this file except in compliance with the License. |
6 | - * You may obtain a copy of the License at | 6 | + * You may obtain a copy of the License at |
7 | - * | 7 | + * |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | - * | 9 | + * |
10 | - * Unless required by applicable law or agreed to in writing, software | 10 | + * Unless required by applicable law or agreed to in writing, software |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | - * See the License for the specific language governing permissions and | 13 | + * See the License for the specific language governing permissions and |
14 | - * limitations under the License. | 14 | + * limitations under the License. |
15 | - */ | 15 | + */ |
16 | -package org.onosproject.vtnrsc; | 16 | +package org.onosproject.vtnrsc; |
17 | - | 17 | + |
18 | -/** | 18 | +/** |
19 | - * Representation of the tenantNetwork. | 19 | + * Representation of the tenantNetwork. |
20 | - */ | 20 | + */ |
21 | -public interface TenantNetwork { | 21 | +public interface TenantNetwork { |
22 | - | 22 | + |
23 | - /** | 23 | + /** |
24 | - * Coarse classification of the state of the tenantNetwork. | 24 | + * Coarse classification of the state of the tenantNetwork. |
25 | - */ | 25 | + */ |
26 | - public enum State { | 26 | + public enum State { |
27 | - /** | 27 | + /** |
28 | - * Signifies that a tenantNetwork is currently active.This state means | 28 | + * Signifies that a tenantNetwork is currently active.This state means |
29 | - * that this network is available. | 29 | + * that this network is available. |
30 | - */ | 30 | + */ |
31 | - ACTIVE, | 31 | + ACTIVE, |
32 | - /** | 32 | + /** |
33 | - * Signifies that a tenantNetwork is currently built. | 33 | + * Signifies that a tenantNetwork is currently built. |
34 | - */ | 34 | + */ |
35 | - BUILD, | 35 | + BUILD, |
36 | - /** | 36 | + /** |
37 | - * Signifies that a tenantNetwork is currently unavailable. | 37 | + * Signifies that a tenantNetwork is currently unavailable. |
38 | - */ | 38 | + */ |
39 | - DOWN, | 39 | + DOWN, |
40 | - /** | 40 | + /** |
41 | - * Signifies that a tenantNetwork is currently error. | 41 | + * Signifies that a tenantNetwork is currently error. |
42 | - */ | 42 | + */ |
43 | - ERROR | 43 | + ERROR |
44 | - } | 44 | + } |
45 | - | 45 | + |
46 | - /** | 46 | + /** |
47 | - * Coarse classification of the type of the tenantNetwork. | 47 | + * Coarse classification of the type of the tenantNetwork. |
48 | - */ | 48 | + */ |
49 | - public enum Type { | 49 | + public enum Type { |
50 | - /** | 50 | + /** |
51 | - * Signifies that a tenantNetwork is local. | 51 | + * Signifies that a tenantNetwork is local. |
52 | - */ | 52 | + */ |
53 | - LOCAL | 53 | + LOCAL |
54 | - } | 54 | + } |
55 | - | 55 | + |
56 | - /** | 56 | + /** |
57 | - * Returns the tenantNetwork identifier. | 57 | + * Returns the tenantNetwork identifier. |
58 | - * | 58 | + * |
59 | - * @return tenantNetwork identifier | 59 | + * @return tenantNetwork identifier |
60 | - */ | 60 | + */ |
61 | - TenantNetworkId id(); | 61 | + TenantNetworkId id(); |
62 | - | 62 | + |
63 | - /** | 63 | + /** |
64 | - * Returns the tenantNetwork name. | 64 | + * Returns the tenantNetwork name. |
65 | - * | 65 | + * |
66 | - * @return tenantNetwork name | 66 | + * @return tenantNetwork name |
67 | - */ | 67 | + */ |
68 | - String name(); | 68 | + String name(); |
69 | - | 69 | + |
70 | - /** | 70 | + /** |
71 | - * Returns the administrative state of the tenantNetwork,which is up(true) | 71 | + * Returns the administrative state of the tenantNetwork,which is up(true) |
72 | - * or down(false). | 72 | + * or down(false). |
73 | - * | 73 | + * |
74 | - * @return true or false | 74 | + * @return true or false |
75 | - */ | 75 | + */ |
76 | - boolean adminStateUp(); | 76 | + boolean adminStateUp(); |
77 | - | 77 | + |
78 | - /** | 78 | + /** |
79 | - * Returns the tenantNetwork state. | 79 | + * Returns the tenantNetwork state. |
80 | - * | 80 | + * |
81 | - * @return tenant network state | 81 | + * @return tenant network state |
82 | - */ | 82 | + */ |
83 | - State state(); | 83 | + State state(); |
84 | - | 84 | + |
85 | - /** | 85 | + /** |
86 | - * Indicates whether this tenantNetwork is shared across all tenants. By | 86 | + * Indicates whether this tenantNetwork is shared across all tenants. By |
87 | - * default,only administrative user can change this value. | 87 | + * default,only administrative user can change this value. |
88 | - * | 88 | + * |
89 | - * @return true or false | 89 | + * @return true or false |
90 | - */ | 90 | + */ |
91 | - boolean shared(); | 91 | + boolean shared(); |
92 | - | 92 | + |
93 | - /** | 93 | + /** |
94 | - * Returns the UUID of the tenant that will own the tenantNetwork. This | 94 | + * Returns the UUID of the tenant that will own the tenantNetwork. This |
95 | - * tenant can be different from the tenant that makes the create | 95 | + * tenant can be different from the tenant that makes the create |
96 | - * tenantNetwork request. | 96 | + * tenantNetwork request. |
97 | - * | 97 | + * |
98 | - * @return the tenant identifier | 98 | + * @return the tenant identifier |
99 | - */ | 99 | + */ |
100 | - TenantId tenantId(); | 100 | + TenantId tenantId(); |
101 | - | 101 | + |
102 | - /** | 102 | + /** |
103 | - * Returns the routerExternal.Indicates whether this network is externally | 103 | + * Returns the routerExternal.Indicates whether this network is externally |
104 | - * accessible. | 104 | + * accessible. |
105 | - * | 105 | + * |
106 | - * @return true or false | 106 | + * @return true or false |
107 | - */ | 107 | + */ |
108 | - boolean routerExternal(); | 108 | + boolean routerExternal(); |
109 | - | 109 | + |
110 | - /** | 110 | + /** |
111 | - * Returns the tenantNetwork Type. | 111 | + * Returns the tenantNetwork Type. |
112 | - * | 112 | + * |
113 | - * @return tenantNetwork Type | 113 | + * @return tenantNetwork Type |
114 | - */ | 114 | + */ |
115 | - Type type(); | 115 | + Type type(); |
116 | - | 116 | + |
117 | - /** | 117 | + /** |
118 | - * Returns the tenantNetwork physical network. | 118 | + * Returns the tenantNetwork physical network. |
119 | - * | 119 | + * |
120 | - * @return tenantNetwork physical network | 120 | + * @return tenantNetwork physical network |
121 | - */ | 121 | + */ |
122 | - PhysicalNetwork physicalNetwork(); | 122 | + PhysicalNetwork physicalNetwork(); |
123 | - | 123 | + |
124 | - /** | 124 | + /** |
125 | - * Returns the tenantNetwork segmentation id. | 125 | + * Returns the tenantNetwork segmentation id. |
126 | - * | 126 | + * |
127 | - * @return tenantNetwork segmentation id | 127 | + * @return tenantNetwork segmentation id |
128 | - */ | 128 | + */ |
129 | - SegmentationId segmentationId(); | 129 | + SegmentationId segmentationId(); |
130 | -} | 130 | +} | ... | ... |
1 | -/* | 1 | +/* |
2 | - * Copyright 2015 Open Networking Laboratory | 2 | + * Copyright 2015 Open Networking Laboratory |
3 | - * | 3 | + * |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | - * you may not use this file except in compliance with the License. | 5 | + * you may not use this file except in compliance with the License. |
6 | - * You may obtain a copy of the License at | 6 | + * You may obtain a copy of the License at |
7 | - * | 7 | + * |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | - * | 9 | + * |
10 | - * Unless required by applicable law or agreed to in writing, software | 10 | + * Unless required by applicable law or agreed to in writing, software |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | - * See the License for the specific language governing permissions and | 13 | + * See the License for the specific language governing permissions and |
14 | - * limitations under the License. | 14 | + * limitations under the License. |
15 | - */ | 15 | + */ |
16 | -package org.onosproject.vtnrsc; | 16 | +package org.onosproject.vtnrsc; |
17 | - | 17 | + |
18 | -import java.util.Objects; | 18 | +import java.util.Objects; |
19 | -import static com.google.common.base.Preconditions.checkNotNull; | 19 | +import static com.google.common.base.Preconditions.checkNotNull; |
20 | - | 20 | + |
21 | -/** | 21 | +/** |
22 | - * Immutable representation of a tenantNetwork identity. | 22 | + * Immutable representation of a tenantNetwork identity. |
23 | - */ | 23 | + */ |
24 | -public final class TenantNetworkId { | 24 | +public final class TenantNetworkId { |
25 | - | 25 | + |
26 | - private final String networkId; | 26 | + private final String networkId; |
27 | - | 27 | + |
28 | - // Public construction is prohibited | 28 | + // Public construction is prohibited |
29 | - private TenantNetworkId(String networkId) { | 29 | + private TenantNetworkId(String networkId) { |
30 | - this.networkId = networkId; | 30 | + this.networkId = networkId; |
31 | - } | 31 | + } |
32 | - | 32 | + |
33 | - /** | 33 | + /** |
34 | - * Creates a TenantNetwork identifier. | 34 | + * Creates a TenantNetwork identifier. |
35 | - * | 35 | + * |
36 | - * @param networkId tenantNetwork identify string | 36 | + * @param networkId tenantNetwork identify string |
37 | - * @return the attached tenantNetwork identifier | 37 | + * @return the attached tenantNetwork identifier |
38 | - */ | 38 | + */ |
39 | - public static TenantNetworkId networkId(String networkId) { | 39 | + public static TenantNetworkId networkId(String networkId) { |
40 | - checkNotNull(networkId, "Networkid cannot be null"); | 40 | + checkNotNull(networkId, "Networkid cannot be null"); |
41 | - return new TenantNetworkId(networkId); | 41 | + return new TenantNetworkId(networkId); |
42 | - } | 42 | + } |
43 | - | 43 | + |
44 | - /** | 44 | + /** |
45 | - * Returns tenantNetwork identifier. | 45 | + * Returns tenantNetwork identifier. |
46 | - * | 46 | + * |
47 | - * @return the tenantNetwork identifier | 47 | + * @return the tenantNetwork identifier |
48 | - */ | 48 | + */ |
49 | - public String networkId() { | 49 | + public String networkId() { |
50 | - return networkId; | 50 | + return networkId; |
51 | - } | 51 | + } |
52 | - | 52 | + |
53 | - @Override | 53 | + @Override |
54 | - public int hashCode() { | 54 | + public int hashCode() { |
55 | - return Objects.hash(networkId); | 55 | + return Objects.hash(networkId); |
56 | - } | 56 | + } |
57 | - | 57 | + |
58 | - @Override | 58 | + @Override |
59 | - public boolean equals(Object obj) { | 59 | + public boolean equals(Object obj) { |
60 | - if (this == obj) { | 60 | + if (this == obj) { |
61 | - return true; | 61 | + return true; |
62 | - } | 62 | + } |
63 | - if (obj instanceof TenantNetworkId) { | 63 | + if (obj instanceof TenantNetworkId) { |
64 | - final TenantNetworkId that = (TenantNetworkId) obj; | 64 | + final TenantNetworkId that = (TenantNetworkId) obj; |
65 | - return this.getClass() == that.getClass() | 65 | + return this.getClass() == that.getClass() |
66 | - && Objects.equals(this.networkId, that.networkId); | 66 | + && Objects.equals(this.networkId, that.networkId); |
67 | - } | 67 | + } |
68 | - return false; | 68 | + return false; |
69 | - } | 69 | + } |
70 | - | 70 | + |
71 | - @Override | 71 | + @Override |
72 | - public String toString() { | 72 | + public String toString() { |
73 | - return networkId; | 73 | + return networkId; |
74 | - } | 74 | + } |
75 | - | 75 | + |
76 | -} | 76 | +} | ... | ... |
1 | -/* | 1 | +/* |
2 | - * Copyright 2015 Open Networking Laboratory | 2 | + * Copyright 2015 Open Networking Laboratory |
3 | - * | 3 | + * |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | - * you may not use this file except in compliance with the License. | 5 | + * you may not use this file except in compliance with the License. |
6 | - * You may obtain a copy of the License at | 6 | + * You may obtain a copy of the License at |
7 | - * | 7 | + * |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | - * | 9 | + * |
10 | - * Unless required by applicable law or agreed to in writing, software | 10 | + * Unless required by applicable law or agreed to in writing, software |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | - * See the License for the specific language governing permissions and | 13 | + * See the License for the specific language governing permissions and |
14 | - * limitations under the License. | 14 | + * limitations under the License. |
15 | - */ | 15 | + */ |
16 | -package org.onosproject.vtnrsc; | 16 | +package org.onosproject.vtnrsc; |
17 | - | 17 | + |
18 | -import java.util.Collection; | 18 | +import java.util.Collection; |
19 | -import java.util.Set; | 19 | +import java.util.Set; |
20 | - | 20 | + |
21 | -import org.onlab.packet.MacAddress; | 21 | +import org.onlab.packet.MacAddress; |
22 | -import org.onosproject.net.DeviceId; | 22 | +import org.onosproject.net.DeviceId; |
23 | - | 23 | + |
24 | -/** | 24 | +/** |
25 | - * Representation of the VirtualPort. | 25 | + * Representation of the VirtualPort. |
26 | - */ | 26 | + */ |
27 | -public interface VirtualPort { | 27 | +public interface VirtualPort { |
28 | - /** | 28 | + /** |
29 | - * Coarse classification of the type of the virtual port. | 29 | + * Coarse classification of the type of the virtual port. |
30 | - */ | 30 | + */ |
31 | - public enum State { | 31 | + public enum State { |
32 | - /** | 32 | + /** |
33 | - * Signifies that a virtualPort is currently active,This state mean that | 33 | + * Signifies that a virtualPort is currently active,This state mean that |
34 | - * this virtualPort is available. | 34 | + * this virtualPort is available. |
35 | - */ | 35 | + */ |
36 | - ACTIVE, | 36 | + ACTIVE, |
37 | - /** | 37 | + /** |
38 | - * Signifies that a virtualPort is currently unavailable. | 38 | + * Signifies that a virtualPort is currently unavailable. |
39 | - */ | 39 | + */ |
40 | - DOWN | 40 | + DOWN |
41 | - } | 41 | + } |
42 | - | 42 | + |
43 | - /** | 43 | + /** |
44 | - * Returns the virtualPort identifier. | 44 | + * Returns the virtualPort identifier. |
45 | - * | 45 | + * |
46 | - * @return virtualPort identifier | 46 | + * @return virtualPort identifier |
47 | - */ | 47 | + */ |
48 | - VirtualPortId portId(); | 48 | + VirtualPortId portId(); |
49 | - | 49 | + |
50 | - /** | 50 | + /** |
51 | - * Returns the network identifier. | 51 | + * Returns the network identifier. |
52 | - * | 52 | + * |
53 | - * @return tenantNetwork identifier | 53 | + * @return tenantNetwork identifier |
54 | - */ | 54 | + */ |
55 | - TenantNetworkId networkId(); | 55 | + TenantNetworkId networkId(); |
56 | - | 56 | + |
57 | - /** | 57 | + /** |
58 | - * Returns the symbolic name for the virtualPort. | 58 | + * Returns the symbolic name for the virtualPort. |
59 | - * | 59 | + * |
60 | - * @return virtualPort name | 60 | + * @return virtualPort name |
61 | - */ | 61 | + */ |
62 | - String name(); | 62 | + String name(); |
63 | - | 63 | + |
64 | - /** | 64 | + /** |
65 | - * Returns the administrative status of the port,which is up(true) or | 65 | + * Returns the administrative status of the port,which is up(true) or |
66 | - * down(false). | 66 | + * down(false). |
67 | - * | 67 | + * |
68 | - * @return true if the administrative status of the port is up | 68 | + * @return true if the administrative status of the port is up |
69 | - */ | 69 | + */ |
70 | - boolean adminStateUp(); | 70 | + boolean adminStateUp(); |
71 | - | 71 | + |
72 | - /** | 72 | + /** |
73 | - * Returns the state. | 73 | + * Returns the state. |
74 | - * | 74 | + * |
75 | - * @return state | 75 | + * @return state |
76 | - */ | 76 | + */ |
77 | - State state(); | 77 | + State state(); |
78 | - | 78 | + |
79 | - /** | 79 | + /** |
80 | - * Returns the MAC address. | 80 | + * Returns the MAC address. |
81 | - * | 81 | + * |
82 | - * @return MAC Address | 82 | + * @return MAC Address |
83 | - */ | 83 | + */ |
84 | - MacAddress macAddress(); | 84 | + MacAddress macAddress(); |
85 | - | 85 | + |
86 | - /** | 86 | + /** |
87 | - * Returns the port tenantId. | 87 | + * Returns the port tenantId. |
88 | - * | 88 | + * |
89 | - * @return port tenantId | 89 | + * @return port tenantId |
90 | - */ | 90 | + */ |
91 | - TenantId tenantId(); | 91 | + TenantId tenantId(); |
92 | - | 92 | + |
93 | - /** | 93 | + /** |
94 | - * Returns the device identifier. | 94 | + * Returns the device identifier. |
95 | - * | 95 | + * |
96 | - * @return deviceId | 96 | + * @return deviceId |
97 | - */ | 97 | + */ |
98 | - DeviceId deviceId(); | 98 | + DeviceId deviceId(); |
99 | - | 99 | + |
100 | - /** | 100 | + /** |
101 | - * Returns the identifier of the entity that uses this port. | 101 | + * Returns the identifier of the entity that uses this port. |
102 | - * | 102 | + * |
103 | - * @return deviceOwner | 103 | + * @return deviceOwner |
104 | - */ | 104 | + */ |
105 | - String deviceOwner(); | 105 | + String deviceOwner(); |
106 | - | 106 | + |
107 | - /** | 107 | + /** |
108 | - * Returns the virtualPort allowedAddressPairs. | 108 | + * Returns the virtualPort allowedAddressPairs. |
109 | - * | 109 | + * |
110 | - * @return virtualPort allowedAddressPairs | 110 | + * @return virtualPort allowedAddressPairs |
111 | - */ | 111 | + */ |
112 | - Collection<AllowedAddressPair> allowedAddressPairs(); | 112 | + Collection<AllowedAddressPair> allowedAddressPairs(); |
113 | - | 113 | + |
114 | - /** | 114 | + /** |
115 | - * Returns set of IP addresses for the port, include the IP addresses and subnet | 115 | + * Returns set of IP addresses for the port, include the IP addresses and subnet |
116 | - * identity. | 116 | + * identity. |
117 | - * | 117 | + * |
118 | - * @return FixedIps Set of fixedIp | 118 | + * @return FixedIps Set of fixedIp |
119 | - */ | 119 | + */ |
120 | - Set<FixedIp> fixedIps(); | 120 | + Set<FixedIp> fixedIps(); |
121 | - | 121 | + |
122 | - /** | 122 | + /** |
123 | - * Returns the virtualPort bindinghostId. | 123 | + * Returns the virtualPort bindinghostId. |
124 | - * | 124 | + * |
125 | - * @return virtualPort bindinghostId | 125 | + * @return virtualPort bindinghostId |
126 | - */ | 126 | + */ |
127 | - BindingHostId bindingHostId(); | 127 | + BindingHostId bindingHostId(); |
128 | - | 128 | + |
129 | - /** | 129 | + /** |
130 | - * Returns the virtualPort bindingVnicType. | 130 | + * Returns the virtualPort bindingVnicType. |
131 | - * | 131 | + * |
132 | - * @return virtualPort bindingVnicType | 132 | + * @return virtualPort bindingVnicType |
133 | - */ | 133 | + */ |
134 | - String bindingVnicType(); | 134 | + String bindingVnicType(); |
135 | - | 135 | + |
136 | - /** | 136 | + /** |
137 | - * Returns the virtualPort bindingVifType. | 137 | + * Returns the virtualPort bindingVifType. |
138 | - * | 138 | + * |
139 | - * @return virtualPort bindingVifType | 139 | + * @return virtualPort bindingVifType |
140 | - */ | 140 | + */ |
141 | - String bindingVifType(); | 141 | + String bindingVifType(); |
142 | - | 142 | + |
143 | - /** | 143 | + /** |
144 | - * Returns the virtualPort bindingvifDetail. | 144 | + * Returns the virtualPort bindingvifDetail. |
145 | - * | 145 | + * |
146 | - * @return virtualPort bindingvifDetail | 146 | + * @return virtualPort bindingvifDetail |
147 | - */ | 147 | + */ |
148 | - String bindingVifDetails(); | 148 | + String bindingVifDetails(); |
149 | - | 149 | + |
150 | - /** | 150 | + /** |
151 | - * Returns the security groups. | 151 | + * Returns the security groups. |
152 | - * | 152 | + * |
153 | - * @return port security groups | 153 | + * @return port security groups |
154 | - */ | 154 | + */ |
155 | - Iterable<SecurityGroup> securityGroups(); | 155 | + Iterable<SecurityGroup> securityGroups(); |
156 | -} | 156 | +} | ... | ... |
1 | -/* | 1 | +/* |
2 | - * Copyright 2015 Open Networking Laboratory | 2 | + * Copyright 2015 Open Networking Laboratory |
3 | - * | 3 | + * |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | - * you may not use this file except in compliance with the License. | 5 | + * you may not use this file except in compliance with the License. |
6 | - * You may obtain a copy of the License at | 6 | + * You may obtain a copy of the License at |
7 | - * | 7 | + * |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | - * | 9 | + * |
10 | - * Unless required by applicable law or agreed to in writing, software | 10 | + * Unless required by applicable law or agreed to in writing, software |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | - * See the License for the specific language governing permissions and | 13 | + * See the License for the specific language governing permissions and |
14 | - * limitations under the License. | 14 | + * limitations under the License. |
15 | - */ | 15 | + */ |
16 | -package org.onosproject.vtnrsc; | 16 | +package org.onosproject.vtnrsc; |
17 | - | 17 | + |
18 | -import static com.google.common.base.Preconditions.checkNotNull; | 18 | +import static com.google.common.base.Preconditions.checkNotNull; |
19 | - | 19 | + |
20 | -import java.util.Objects; | 20 | +import java.util.Objects; |
21 | - | 21 | + |
22 | -/** | 22 | +/** |
23 | - * Immutable representation of a virtual port identifier. | 23 | + * Immutable representation of a virtual port identifier. |
24 | - */ | 24 | + */ |
25 | -public final class VirtualPortId { | 25 | +public final class VirtualPortId { |
26 | - private final String portId; | 26 | + private final String portId; |
27 | - // Public construction is prohibited | 27 | + // Public construction is prohibited |
28 | - private VirtualPortId(String virtualPortId) { | 28 | + private VirtualPortId(String virtualPortId) { |
29 | - checkNotNull(virtualPortId, "VirtualPortId cannot be null"); | 29 | + checkNotNull(virtualPortId, "VirtualPortId cannot be null"); |
30 | - this.portId = virtualPortId; | 30 | + this.portId = virtualPortId; |
31 | - } | 31 | + } |
32 | - | 32 | + |
33 | - public String portId() { | 33 | + public String portId() { |
34 | - return portId; | 34 | + return portId; |
35 | - } | 35 | + } |
36 | - | 36 | + |
37 | - /** | 37 | + /** |
38 | - * Creates a virtualPort id using the supplied portId. | 38 | + * Creates a virtualPort id using the supplied portId. |
39 | - * | 39 | + * |
40 | - * @param portId virtualport identifier | 40 | + * @param portId virtualport identifier |
41 | - * @return VirtualPortId | 41 | + * @return VirtualPortId |
42 | - */ | 42 | + */ |
43 | - public static VirtualPortId portId(String portId) { | 43 | + public static VirtualPortId portId(String portId) { |
44 | - return new VirtualPortId(portId); | 44 | + return new VirtualPortId(portId); |
45 | - } | 45 | + } |
46 | - | 46 | + |
47 | - @Override | 47 | + @Override |
48 | - public int hashCode() { | 48 | + public int hashCode() { |
49 | - return Objects.hash(portId); | 49 | + return Objects.hash(portId); |
50 | - } | 50 | + } |
51 | - | 51 | + |
52 | - @Override | 52 | + @Override |
53 | - public boolean equals(Object obj) { | 53 | + public boolean equals(Object obj) { |
54 | - if (this == obj) { | 54 | + if (this == obj) { |
55 | - return true; | 55 | + return true; |
56 | - } | 56 | + } |
57 | - if (obj instanceof VirtualPortId) { | 57 | + if (obj instanceof VirtualPortId) { |
58 | - final VirtualPortId that = (VirtualPortId) obj; | 58 | + final VirtualPortId that = (VirtualPortId) obj; |
59 | - return this.getClass() == that.getClass() | 59 | + return this.getClass() == that.getClass() |
60 | - && Objects.equals(this.portId, that.portId); | 60 | + && Objects.equals(this.portId, that.portId); |
61 | - } | 61 | + } |
62 | - return false; | 62 | + return false; |
63 | - } | 63 | + } |
64 | - | 64 | + |
65 | - @Override | 65 | + @Override |
66 | - public String toString() { | 66 | + public String toString() { |
67 | - return portId; | 67 | + return portId; |
68 | - } | 68 | + } |
69 | - | 69 | + |
70 | -} | 70 | +} | ... | ... |
1 | -/* | 1 | +/* |
2 | - * Copyright 2015 Open Networking Laboratory | 2 | + * Copyright 2015 Open Networking Laboratory |
3 | - * | 3 | + * |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | - * you may not use this file except in compliance with the License. | 5 | + * you may not use this file except in compliance with the License. |
6 | - * You may obtain a copy of the License at | 6 | + * You may obtain a copy of the License at |
7 | - * | 7 | + * |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | - * | 9 | + * |
10 | - * Unless required by applicable law or agreed to in writing, software | 10 | + * Unless required by applicable law or agreed to in writing, software |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | - * See the License for the specific language governing permissions and | 13 | + * See the License for the specific language governing permissions and |
14 | - * limitations under the License. | 14 | + * limitations under the License. |
15 | - */ | 15 | + */ |
16 | -package org.onosproject.vtnrsc.subnet; | 16 | +package org.onosproject.vtnrsc.subnet; |
17 | - | 17 | + |
18 | -import org.onosproject.vtnrsc.Subnet; | 18 | +import org.onosproject.vtnrsc.Subnet; |
19 | -import org.onosproject.vtnrsc.SubnetId; | 19 | +import org.onosproject.vtnrsc.SubnetId; |
20 | - | 20 | + |
21 | - | 21 | + |
22 | -/** | 22 | +/** |
23 | - * Service for interacting with the inventory of subnets. | 23 | + * Service for interacting with the inventory of subnets. |
24 | - */ | 24 | + */ |
25 | -public interface SubnetService { | 25 | +public interface SubnetService { |
26 | - /** | 26 | + /** |
27 | - * Returns the subnet with the specified identifier. | 27 | + * Returns the subnet with the specified identifier. |
28 | - * | 28 | + * |
29 | - * @param subnetId subnet identifier | 29 | + * @param subnetId subnet identifier |
30 | - * @return true or false | 30 | + * @return true or false |
31 | - */ | 31 | + */ |
32 | - boolean exists(SubnetId subnetId); | 32 | + boolean exists(SubnetId subnetId); |
33 | - /** | 33 | + /** |
34 | - * Returns a collection of the currently known subnets. | 34 | + * Returns a collection of the currently known subnets. |
35 | - * | 35 | + * |
36 | - * @return iterable collection of subnets | 36 | + * @return iterable collection of subnets |
37 | - */ | 37 | + */ |
38 | - Iterable<Subnet> getSubnets(); | 38 | + Iterable<Subnet> getSubnets(); |
39 | - | 39 | + |
40 | - /** | 40 | + /** |
41 | - * Returns the subnet with the specified identifier. | 41 | + * Returns the subnet with the specified identifier. |
42 | - * | 42 | + * |
43 | - * @param subnetId subnet identifier | 43 | + * @param subnetId subnet identifier |
44 | - * @return subnet or null if one with the given identifier is not known | 44 | + * @return subnet or null if one with the given identifier is not known |
45 | - */ | 45 | + */ |
46 | - Subnet getSubnet(SubnetId subnetId); | 46 | + Subnet getSubnet(SubnetId subnetId); |
47 | - /** | 47 | + /** |
48 | - * Creates new subnets. | 48 | + * Creates new subnets. |
49 | - * | 49 | + * |
50 | - * @param subnets the iterable collection of subnets | 50 | + * @param subnets the iterable collection of subnets |
51 | - * @return true if the identifier subnet has been created right | 51 | + * @return true if the identifier subnet has been created right |
52 | - */ | 52 | + */ |
53 | - boolean createSubnets(Iterable<Subnet> subnets); | 53 | + boolean createSubnets(Iterable<Subnet> subnets); |
54 | - | 54 | + |
55 | - /** | 55 | + /** |
56 | - * Updates existing subnets. | 56 | + * Updates existing subnets. |
57 | - * | 57 | + * |
58 | - * @param subnets the iterable collection of subnets | 58 | + * @param subnets the iterable collection of subnets |
59 | - * @return true if all subnets were updated successfully | 59 | + * @return true if all subnets were updated successfully |
60 | - */ | 60 | + */ |
61 | - boolean updateSubnets(Iterable<Subnet> subnets); | 61 | + boolean updateSubnets(Iterable<Subnet> subnets); |
62 | - | 62 | + |
63 | - /** | 63 | + /** |
64 | - * Administratively removes the specified subnets from the store. | 64 | + * Administratively removes the specified subnets from the store. |
65 | - * | 65 | + * |
66 | - * @param subnetIds the iterable collection of subnets identifier | 66 | + * @param subnetIds the iterable collection of subnets identifier |
67 | - * @return true if remove identifier subnets successfully | 67 | + * @return true if remove identifier subnets successfully |
68 | - */ | 68 | + */ |
69 | - boolean removeSubnets(Iterable<SubnetId> subnetIds); | 69 | + boolean removeSubnets(Iterable<SubnetId> subnetIds); |
70 | - | 70 | + |
71 | - | 71 | + |
72 | -} | 72 | +} | ... | ... |
This diff is collapsed. Click to expand it.
1 | -/* | 1 | +/* |
2 | - * Copyright 2015 Open Networking Laboratory | 2 | + * Copyright 2015 Open Networking Laboratory |
3 | - * | 3 | + * |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | - * you may not use this file except in compliance with the License. | 5 | + * you may not use this file except in compliance with the License. |
6 | - * You may obtain a copy of the License at | 6 | + * You may obtain a copy of the License at |
7 | - * | 7 | + * |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | - * | 9 | + * |
10 | - * Unless required by applicable law or agreed to in writing, software | 10 | + * Unless required by applicable law or agreed to in writing, software |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | - * See the License for the specific language governing permissions and | 13 | + * See the License for the specific language governing permissions and |
14 | - * limitations under the License. | 14 | + * limitations under the License. |
15 | - */ | 15 | + */ |
16 | -package org.onosproject.vtnrsc.tenantnetwork; | 16 | +package org.onosproject.vtnrsc.tenantnetwork; |
17 | - | 17 | + |
18 | -import org.onosproject.vtnrsc.TenantNetwork; | 18 | +import org.onosproject.vtnrsc.TenantNetwork; |
19 | -import org.onosproject.vtnrsc.TenantNetworkId; | 19 | +import org.onosproject.vtnrsc.TenantNetworkId; |
20 | - | 20 | + |
21 | -/** | 21 | +/** |
22 | - * Service for interacting with the inventory of tenantNetwork. | 22 | + * Service for interacting with the inventory of tenantNetwork. |
23 | - */ | 23 | + */ |
24 | -public interface TenantNetworkService { | 24 | +public interface TenantNetworkService { |
25 | - | 25 | + |
26 | - /** | 26 | + /** |
27 | - * Returns if the tenantNetwork is existed. | 27 | + * Returns if the tenantNetwork is existed. |
28 | - * | 28 | + * |
29 | - * @param networkId tenantNetwork identifier | 29 | + * @param networkId tenantNetwork identifier |
30 | - * @return true or false if one with the given identifier exists. | 30 | + * @return true or false if one with the given identifier exists. |
31 | - */ | 31 | + */ |
32 | - boolean exists(TenantNetworkId networkId); | 32 | + boolean exists(TenantNetworkId networkId); |
33 | - | 33 | + |
34 | - /** | 34 | + /** |
35 | - * Returns the number of tenantNetwork known to the system. | 35 | + * Returns the number of tenantNetwork known to the system. |
36 | - * | 36 | + * |
37 | - * @return number of tenantNetwork. | 37 | + * @return number of tenantNetwork. |
38 | - */ | 38 | + */ |
39 | - int getNetworkCount(); | 39 | + int getNetworkCount(); |
40 | - | 40 | + |
41 | - /** | 41 | + /** |
42 | - * Returns an iterable collection of the currently known tenantNetwork. | 42 | + * Returns an iterable collection of the currently known tenantNetwork. |
43 | - * | 43 | + * |
44 | - * @return collection of tenantNetwork. | 44 | + * @return collection of tenantNetwork. |
45 | - */ | 45 | + */ |
46 | - Iterable<TenantNetwork> getNetworks(); | 46 | + Iterable<TenantNetwork> getNetworks(); |
47 | - | 47 | + |
48 | - /** | 48 | + /** |
49 | - * Returns the tenantNetwork with the identifier. | 49 | + * Returns the tenantNetwork with the identifier. |
50 | - * | 50 | + * |
51 | - * @param networkId TenantNetwork identifier | 51 | + * @param networkId TenantNetwork identifier |
52 | - * @return TenantNetwork or null if one with the given identifier is not | 52 | + * @return TenantNetwork or null if one with the given identifier is not |
53 | - * known. | 53 | + * known. |
54 | - */ | 54 | + */ |
55 | - TenantNetwork getNetwork(TenantNetworkId networkId); | 55 | + TenantNetwork getNetwork(TenantNetworkId networkId); |
56 | - | 56 | + |
57 | - /** | 57 | + /** |
58 | - * Creates tenantNetworks by networks. | 58 | + * Creates tenantNetworks by networks. |
59 | - * | 59 | + * |
60 | - * @param networks the collection of tenantNetworks | 60 | + * @param networks the collection of tenantNetworks |
61 | - * @return true if all given identifiers created successfully. | 61 | + * @return true if all given identifiers created successfully. |
62 | - */ | 62 | + */ |
63 | - boolean createNetworks(Iterable<TenantNetwork> networks); | 63 | + boolean createNetworks(Iterable<TenantNetwork> networks); |
64 | - | 64 | + |
65 | - /** | 65 | + /** |
66 | - * Updates tenantNetworks by tenantNetworks. | 66 | + * Updates tenantNetworks by tenantNetworks. |
67 | - * | 67 | + * |
68 | - * @param networks the collection of tenantNetworks | 68 | + * @param networks the collection of tenantNetworks |
69 | - * @return true if all given identifiers updated successfully. | 69 | + * @return true if all given identifiers updated successfully. |
70 | - */ | 70 | + */ |
71 | - boolean updateNetworks(Iterable<TenantNetwork> networks); | 71 | + boolean updateNetworks(Iterable<TenantNetwork> networks); |
72 | - | 72 | + |
73 | - /** | 73 | + /** |
74 | - * Deletes tenantNetwork by tenantNetworkIds. | 74 | + * Deletes tenantNetwork by tenantNetworkIds. |
75 | - * | 75 | + * |
76 | - * @param networksIds the collection of tenantNetworkIds | 76 | + * @param networksIds the collection of tenantNetworkIds |
77 | - * @return true if the specified tenantNetworks deleted successfully. | 77 | + * @return true if the specified tenantNetworks deleted successfully. |
78 | - */ | 78 | + */ |
79 | - boolean removeNetworks(Iterable<TenantNetworkId> networksIds); | 79 | + boolean removeNetworks(Iterable<TenantNetworkId> networksIds); |
80 | -} | 80 | +} | ... | ... |
This diff is collapsed. Click to expand it.
1 | -/* | 1 | +/* |
2 | - * Copyright 2015 Open Networking Laboratory | 2 | + * Copyright 2015 Open Networking Laboratory |
3 | - * | 3 | + * |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | - * you may not use this file except in compliance with the License. | 5 | + * you may not use this file except in compliance with the License. |
6 | - * You may obtain a copy of the License at | 6 | + * You may obtain a copy of the License at |
7 | - * | 7 | + * |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | - * | 9 | + * |
10 | - * Unless required by applicable law or agreed to in writing, software | 10 | + * Unless required by applicable law or agreed to in writing, software |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | - * See the License for the specific language governing permissions and | 13 | + * See the License for the specific language governing permissions and |
14 | - * limitations under the License. | 14 | + * limitations under the License. |
15 | - */ | 15 | + */ |
16 | -package org.onosproject.vtnrsc.tunnel; | 16 | +package org.onosproject.vtnrsc.tunnel; |
17 | - | 17 | + |
18 | -import org.onosproject.vtnrsc.Subnet; | 18 | +import org.onosproject.vtnrsc.Subnet; |
19 | -import org.onosproject.vtnrsc.SubnetId; | 19 | +import org.onosproject.vtnrsc.SubnetId; |
20 | - | 20 | + |
21 | - | 21 | + |
22 | -/** | 22 | +/** |
23 | - * Service for interacting with the inventory of subnets. | 23 | + * Service for interacting with the inventory of subnets. |
24 | - */ | 24 | + */ |
25 | -public interface TunnelConfigService { | 25 | +public interface TunnelConfigService { |
26 | - /** | 26 | + /** |
27 | - * Returns the subnet with the specified identifier. | 27 | + * Returns the subnet with the specified identifier. |
28 | - * | 28 | + * |
29 | - * @param subnetId subnet identifier | 29 | + * @param subnetId subnet identifier |
30 | - * @return true or false | 30 | + * @return true or false |
31 | - */ | 31 | + */ |
32 | - boolean exists(SubnetId subnetId); | 32 | + boolean exists(SubnetId subnetId); |
33 | - /** | 33 | + /** |
34 | - * Returns a collection of the currently known subnets. | 34 | + * Returns a collection of the currently known subnets. |
35 | - * | 35 | + * |
36 | - * @return iterable collection of subnets | 36 | + * @return iterable collection of subnets |
37 | - */ | 37 | + */ |
38 | - Iterable<Subnet> getSubnets(); | 38 | + Iterable<Subnet> getSubnets(); |
39 | - | 39 | + |
40 | - /** | 40 | + /** |
41 | - * Returns the subnet with the specified identifier. | 41 | + * Returns the subnet with the specified identifier. |
42 | - * | 42 | + * |
43 | - * @param subnetId subnet identifier | 43 | + * @param subnetId subnet identifier |
44 | - * @return subnet or null if one with the given identifier is not known | 44 | + * @return subnet or null if one with the given identifier is not known |
45 | - */ | 45 | + */ |
46 | - Subnet getSubnet(SubnetId subnetId); | 46 | + Subnet getSubnet(SubnetId subnetId); |
47 | - /** | 47 | + /** |
48 | - * Creates new subnets. | 48 | + * Creates new subnets. |
49 | - * | 49 | + * |
50 | - * @param subnets the iterable collection of subnets | 50 | + * @param subnets the iterable collection of subnets |
51 | - * @return true if the identifier subnet has been created right | 51 | + * @return true if the identifier subnet has been created right |
52 | - */ | 52 | + */ |
53 | - boolean createSubnets(Iterable<Subnet> subnets); | 53 | + boolean createSubnets(Iterable<Subnet> subnets); |
54 | - | 54 | + |
55 | - /** | 55 | + /** |
56 | - * Updates existing subnets. | 56 | + * Updates existing subnets. |
57 | - * | 57 | + * |
58 | - * @param subnets the iterable collection of subnets | 58 | + * @param subnets the iterable collection of subnets |
59 | - * @return true if all subnets were updated successfully | 59 | + * @return true if all subnets were updated successfully |
60 | - */ | 60 | + */ |
61 | - boolean updateSubnets(Iterable<Subnet> subnets); | 61 | + boolean updateSubnets(Iterable<Subnet> subnets); |
62 | - | 62 | + |
63 | - /** | 63 | + /** |
64 | - * Administratively removes the specified subnets from the store. | 64 | + * Administratively removes the specified subnets from the store. |
65 | - * | 65 | + * |
66 | - * @param subnetIds the iterable collection of subnets identifier | 66 | + * @param subnetIds the iterable collection of subnets identifier |
67 | - * @return true if remove identifier subnets successfully | 67 | + * @return true if remove identifier subnets successfully |
68 | - */ | 68 | + */ |
69 | - boolean removeSubnets(Iterable<SubnetId> subnetIds); | 69 | + boolean removeSubnets(Iterable<SubnetId> subnetIds); |
70 | - | 70 | + |
71 | - | 71 | + |
72 | -} | 72 | +} | ... | ... |
This diff is collapsed. Click to expand it.
1 | -/* | 1 | +/* |
2 | - * Copyright 2015 Open Networking Laboratory | 2 | + * Copyright 2015 Open Networking Laboratory |
3 | - * | 3 | + * |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | - * you may not use this file except in compliance with the License. | 5 | + * you may not use this file except in compliance with the License. |
6 | - * You may obtain a copy of the License at | 6 | + * You may obtain a copy of the License at |
7 | - * | 7 | + * |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | - * | 9 | + * |
10 | - * Unless required by applicable law or agreed to in writing, software | 10 | + * Unless required by applicable law or agreed to in writing, software |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | - * See the License for the specific language governing permissions and | 13 | + * See the License for the specific language governing permissions and |
14 | - * limitations under the License. | 14 | + * limitations under the License. |
15 | - */ | 15 | + */ |
16 | -package org.onosproject.vtnrsc.web; | 16 | +package org.onosproject.vtnrsc.web; |
17 | - | 17 | + |
18 | -import static com.google.common.base.Preconditions.checkNotNull; | 18 | +import static com.google.common.base.Preconditions.checkNotNull; |
19 | - | 19 | + |
20 | -import org.onosproject.codec.CodecContext; | 20 | +import org.onosproject.codec.CodecContext; |
21 | -import org.onosproject.codec.JsonCodec; | 21 | +import org.onosproject.codec.JsonCodec; |
22 | -import org.onosproject.vtnrsc.AllocationPool; | 22 | +import org.onosproject.vtnrsc.AllocationPool; |
23 | - | 23 | + |
24 | -import com.fasterxml.jackson.databind.node.ObjectNode; | 24 | +import com.fasterxml.jackson.databind.node.ObjectNode; |
25 | - | 25 | + |
26 | -/** | 26 | +/** |
27 | - * Subnet AllocationPool codec. | 27 | + * Subnet AllocationPool codec. |
28 | - */ | 28 | + */ |
29 | -public final class AllocationPoolsCodec extends JsonCodec<AllocationPool> { | 29 | +public final class AllocationPoolsCodec extends JsonCodec<AllocationPool> { |
30 | - | 30 | + |
31 | - @Override | 31 | + @Override |
32 | - public ObjectNode encode(AllocationPool alocPool, CodecContext context) { | 32 | + public ObjectNode encode(AllocationPool alocPool, CodecContext context) { |
33 | - checkNotNull(alocPool, "AllocationPools cannot be null"); | 33 | + checkNotNull(alocPool, "AllocationPools cannot be null"); |
34 | - ObjectNode result = context.mapper().createObjectNode() | 34 | + ObjectNode result = context.mapper().createObjectNode() |
35 | - .put("start", alocPool.startIp().toString()) | 35 | + .put("start", alocPool.startIp().toString()) |
36 | - .put("end", alocPool.endIp().toString()); | 36 | + .put("end", alocPool.endIp().toString()); |
37 | - return result; | 37 | + return result; |
38 | - } | 38 | + } |
39 | - | 39 | + |
40 | -} | 40 | +} | ... | ... |
1 | -/* | 1 | +/* |
2 | - * Copyright 2015 Open Networking Laboratory | 2 | + * Copyright 2015 Open Networking Laboratory |
3 | - * | 3 | + * |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | - * you may not use this file except in compliance with the License. | 5 | + * you may not use this file except in compliance with the License. |
6 | - * You may obtain a copy of the License at | 6 | + * You may obtain a copy of the License at |
7 | - * | 7 | + * |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | - * | 9 | + * |
10 | - * Unless required by applicable law or agreed to in writing, software | 10 | + * Unless required by applicable law or agreed to in writing, software |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | - * See the License for the specific language governing permissions and | 13 | + * See the License for the specific language governing permissions and |
14 | - * limitations under the License. | 14 | + * limitations under the License. |
15 | - */ | 15 | + */ |
16 | -package org.onosproject.vtnrsc.web; | 16 | +package org.onosproject.vtnrsc.web; |
17 | - | 17 | + |
18 | -import static com.google.common.base.Preconditions.checkNotNull; | 18 | +import static com.google.common.base.Preconditions.checkNotNull; |
19 | - | 19 | + |
20 | -import org.onosproject.codec.CodecContext; | 20 | +import org.onosproject.codec.CodecContext; |
21 | -import org.onosproject.codec.JsonCodec; | 21 | +import org.onosproject.codec.JsonCodec; |
22 | -import org.onosproject.vtnrsc.AllowedAddressPair; | 22 | +import org.onosproject.vtnrsc.AllowedAddressPair; |
23 | - | 23 | + |
24 | -import com.fasterxml.jackson.databind.node.ObjectNode; | 24 | +import com.fasterxml.jackson.databind.node.ObjectNode; |
25 | - | 25 | + |
26 | -/** | 26 | +/** |
27 | - * VirtualPort AllowedAddressPair codec. | 27 | + * VirtualPort AllowedAddressPair codec. |
28 | - */ | 28 | + */ |
29 | -public final class AllowedAddressPairCodec extends JsonCodec<AllowedAddressPair> { | 29 | +public final class AllowedAddressPairCodec extends JsonCodec<AllowedAddressPair> { |
30 | - | 30 | + |
31 | - @Override | 31 | + @Override |
32 | - public ObjectNode encode(AllowedAddressPair alocAddPair, CodecContext context) { | 32 | + public ObjectNode encode(AllowedAddressPair alocAddPair, CodecContext context) { |
33 | - checkNotNull(alocAddPair, "AllowedAddressPair cannot be null"); | 33 | + checkNotNull(alocAddPair, "AllowedAddressPair cannot be null"); |
34 | - ObjectNode result = context.mapper().createObjectNode() | 34 | + ObjectNode result = context.mapper().createObjectNode() |
35 | - .put("ip_address", alocAddPair.ip().toString()) | 35 | + .put("ip_address", alocAddPair.ip().toString()) |
36 | - .put("mac_address", alocAddPair.mac().toString()); | 36 | + .put("mac_address", alocAddPair.mac().toString()); |
37 | - return result; | 37 | + return result; |
38 | - } | 38 | + } |
39 | - | 39 | + |
40 | -} | 40 | +} | ... | ... |
1 | -/* | 1 | +/* |
2 | - * Copyright 2015 Open Networking Laboratory | 2 | + * Copyright 2015 Open Networking Laboratory |
3 | - * | 3 | + * |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | - * you may not use this file except in compliance with the License. | 5 | + * you may not use this file except in compliance with the License. |
6 | - * You may obtain a copy of the License at | 6 | + * You may obtain a copy of the License at |
7 | - * | 7 | + * |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | - * | 9 | + * |
10 | - * Unless required by applicable law or agreed to in writing, software | 10 | + * Unless required by applicable law or agreed to in writing, software |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | - * See the License for the specific language governing permissions and | 13 | + * See the License for the specific language governing permissions and |
14 | - * limitations under the License. | 14 | + * limitations under the License. |
15 | - */ | 15 | + */ |
16 | -package org.onosproject.vtnrsc.web; | 16 | +package org.onosproject.vtnrsc.web; |
17 | - | 17 | + |
18 | -import static com.google.common.base.Preconditions.checkNotNull; | 18 | +import static com.google.common.base.Preconditions.checkNotNull; |
19 | - | 19 | + |
20 | -import org.onosproject.codec.CodecContext; | 20 | +import org.onosproject.codec.CodecContext; |
21 | -import org.onosproject.codec.JsonCodec; | 21 | +import org.onosproject.codec.JsonCodec; |
22 | -import org.onosproject.vtnrsc.FixedIp; | 22 | +import org.onosproject.vtnrsc.FixedIp; |
23 | - | 23 | + |
24 | -import com.fasterxml.jackson.databind.node.ObjectNode; | 24 | +import com.fasterxml.jackson.databind.node.ObjectNode; |
25 | - | 25 | + |
26 | -/** | 26 | +/** |
27 | - * VirtualPort FixedIp codec. | 27 | + * VirtualPort FixedIp codec. |
28 | - */ | 28 | + */ |
29 | -public final class FixedIpCodec extends JsonCodec<FixedIp> { | 29 | +public final class FixedIpCodec extends JsonCodec<FixedIp> { |
30 | - | 30 | + |
31 | - @Override | 31 | + @Override |
32 | - public ObjectNode encode(FixedIp fixIp, CodecContext context) { | 32 | + public ObjectNode encode(FixedIp fixIp, CodecContext context) { |
33 | - checkNotNull(fixIp, "FixedIp cannot be null"); | 33 | + checkNotNull(fixIp, "FixedIp cannot be null"); |
34 | - ObjectNode result = context.mapper().createObjectNode() | 34 | + ObjectNode result = context.mapper().createObjectNode() |
35 | - .put("subnet_id", fixIp.subnetId().toString()) | 35 | + .put("subnet_id", fixIp.subnetId().toString()) |
36 | - .put("ip_address", fixIp.ip().toString()); | 36 | + .put("ip_address", fixIp.ip().toString()); |
37 | - return result; | 37 | + return result; |
38 | - } | 38 | + } |
39 | - | 39 | + |
40 | -} | 40 | +} | ... | ... |
1 | -/* | 1 | +/* |
2 | - * Copyright 2015 Open Networking Laboratory | 2 | + * Copyright 2015 Open Networking Laboratory |
3 | - * | 3 | + * |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | - * you may not use this file except in compliance with the License. | 5 | + * you may not use this file except in compliance with the License. |
6 | - * You may obtain a copy of the License at | 6 | + * You may obtain a copy of the License at |
7 | - * | 7 | + * |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | - * | 9 | + * |
10 | - * Unless required by applicable law or agreed to in writing, software | 10 | + * Unless required by applicable law or agreed to in writing, software |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | - * See the License for the specific language governing permissions and | 13 | + * See the License for the specific language governing permissions and |
14 | - * limitations under the License. | 14 | + * limitations under the License. |
15 | - */ | 15 | + */ |
16 | -package org.onosproject.vtnrsc.web; | 16 | +package org.onosproject.vtnrsc.web; |
17 | - | 17 | + |
18 | -import static com.google.common.base.Preconditions.checkNotNull; | 18 | +import static com.google.common.base.Preconditions.checkNotNull; |
19 | - | 19 | + |
20 | -import org.onosproject.codec.CodecContext; | 20 | +import org.onosproject.codec.CodecContext; |
21 | -import org.onosproject.codec.JsonCodec; | 21 | +import org.onosproject.codec.JsonCodec; |
22 | -import org.onosproject.vtnrsc.HostRoute; | 22 | +import org.onosproject.vtnrsc.HostRoute; |
23 | - | 23 | + |
24 | -import com.fasterxml.jackson.databind.node.ObjectNode; | 24 | +import com.fasterxml.jackson.databind.node.ObjectNode; |
25 | - | 25 | + |
26 | -/** | 26 | +/** |
27 | - * Subnet HostRoute codec. | 27 | + * Subnet HostRoute codec. |
28 | - */ | 28 | + */ |
29 | -public final class HostRoutesCodec extends JsonCodec<HostRoute> { | 29 | +public final class HostRoutesCodec extends JsonCodec<HostRoute> { |
30 | - | 30 | + |
31 | - @Override | 31 | + @Override |
32 | - public ObjectNode encode(HostRoute hostRoute, CodecContext context) { | 32 | + public ObjectNode encode(HostRoute hostRoute, CodecContext context) { |
33 | - checkNotNull(hostRoute, "HostRoute cannot be null"); | 33 | + checkNotNull(hostRoute, "HostRoute cannot be null"); |
34 | - ObjectNode result = context.mapper().createObjectNode() | 34 | + ObjectNode result = context.mapper().createObjectNode() |
35 | - .put("nexthop", hostRoute.nexthop().toString()) | 35 | + .put("nexthop", hostRoute.nexthop().toString()) |
36 | - .put("destination", hostRoute.destination().toString()); | 36 | + .put("destination", hostRoute.destination().toString()); |
37 | - return result; | 37 | + return result; |
38 | - } | 38 | + } |
39 | - | 39 | + |
40 | -} | 40 | +} | ... | ... |
1 | -/* | 1 | +/* |
2 | - * Copyright 2015 Open Networking Laboratory | 2 | + * Copyright 2015 Open Networking Laboratory |
3 | - * | 3 | + * |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | - * you may not use this file except in compliance with the License. | 5 | + * you may not use this file except in compliance with the License. |
6 | - * You may obtain a copy of the License at | 6 | + * You may obtain a copy of the License at |
7 | - * | 7 | + * |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | - * | 9 | + * |
10 | - * Unless required by applicable law or agreed to in writing, software | 10 | + * Unless required by applicable law or agreed to in writing, software |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | - * See the License for the specific language governing permissions and | 13 | + * See the License for the specific language governing permissions and |
14 | - * limitations under the License. | 14 | + * limitations under the License. |
15 | - */ | 15 | + */ |
16 | -package org.onosproject.vtnrsc.web; | 16 | +package org.onosproject.vtnrsc.web; |
17 | - | 17 | + |
18 | -import static com.google.common.base.Preconditions.checkNotNull; | 18 | +import static com.google.common.base.Preconditions.checkNotNull; |
19 | - | 19 | + |
20 | -import org.onosproject.codec.CodecContext; | 20 | +import org.onosproject.codec.CodecContext; |
21 | -import org.onosproject.codec.JsonCodec; | 21 | +import org.onosproject.codec.JsonCodec; |
22 | -import org.onosproject.vtnrsc.SecurityGroup; | 22 | +import org.onosproject.vtnrsc.SecurityGroup; |
23 | - | 23 | + |
24 | -import com.fasterxml.jackson.databind.node.ObjectNode; | 24 | +import com.fasterxml.jackson.databind.node.ObjectNode; |
25 | - | 25 | + |
26 | -/** | 26 | +/** |
27 | - * Virtualport SecurityGroup codec. | 27 | + * Virtualport SecurityGroup codec. |
28 | - */ | 28 | + */ |
29 | -public final class SecurityGroupCodec extends JsonCodec<SecurityGroup> { | 29 | +public final class SecurityGroupCodec extends JsonCodec<SecurityGroup> { |
30 | - | 30 | + |
31 | - @Override | 31 | + @Override |
32 | - public ObjectNode encode(SecurityGroup securGroup, CodecContext context) { | 32 | + public ObjectNode encode(SecurityGroup securGroup, CodecContext context) { |
33 | - checkNotNull(securGroup, "SecurityGroup cannot be null"); | 33 | + checkNotNull(securGroup, "SecurityGroup cannot be null"); |
34 | - ObjectNode result = context.mapper().createObjectNode() | 34 | + ObjectNode result = context.mapper().createObjectNode() |
35 | - .put("security_group", securGroup.securityGroup()); | 35 | + .put("security_group", securGroup.securityGroup()); |
36 | - return result; | 36 | + return result; |
37 | - } | 37 | + } |
38 | - | 38 | + |
39 | -} | 39 | +} | ... | ... |
1 | -/* | 1 | +/* |
2 | - * Copyright 2015 Open Networking Laboratory | 2 | + * Copyright 2015 Open Networking Laboratory |
3 | - * | 3 | + * |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | - * you may not use this file except in compliance with the License. | 5 | + * you may not use this file except in compliance with the License. |
6 | - * You may obtain a copy of the License at | 6 | + * You may obtain a copy of the License at |
7 | - * | 7 | + * |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | - * | 9 | + * |
10 | - * Unless required by applicable law or agreed to in writing, software | 10 | + * Unless required by applicable law or agreed to in writing, software |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | - * See the License for the specific language governing permissions and | 13 | + * See the License for the specific language governing permissions and |
14 | - * limitations under the License. | 14 | + * limitations under the License. |
15 | - */ | 15 | + */ |
16 | -package org.onosproject.vtnrsc.web; | 16 | +package org.onosproject.vtnrsc.web; |
17 | - | 17 | + |
18 | -import static com.google.common.base.Preconditions.checkNotNull; | 18 | +import static com.google.common.base.Preconditions.checkNotNull; |
19 | - | 19 | + |
20 | -import org.onosproject.codec.CodecContext; | 20 | +import org.onosproject.codec.CodecContext; |
21 | -import org.onosproject.codec.JsonCodec; | 21 | +import org.onosproject.codec.JsonCodec; |
22 | -import org.onosproject.vtnrsc.Subnet; | 22 | +import org.onosproject.vtnrsc.Subnet; |
23 | - | 23 | + |
24 | -import com.fasterxml.jackson.databind.node.ObjectNode; | 24 | +import com.fasterxml.jackson.databind.node.ObjectNode; |
25 | - | 25 | + |
26 | -/** | 26 | +/** |
27 | - * Subnet JSON codec. | 27 | + * Subnet JSON codec. |
28 | - */ | 28 | + */ |
29 | -public final class SubnetCodec extends JsonCodec<Subnet> { | 29 | +public final class SubnetCodec extends JsonCodec<Subnet> { |
30 | - @Override | 30 | + @Override |
31 | - public ObjectNode encode(Subnet subnet, CodecContext context) { | 31 | + public ObjectNode encode(Subnet subnet, CodecContext context) { |
32 | - checkNotNull(subnet, "Subnet cannot be null"); | 32 | + checkNotNull(subnet, "Subnet cannot be null"); |
33 | - ObjectNode result = context.mapper().createObjectNode() | 33 | + ObjectNode result = context.mapper().createObjectNode() |
34 | - .put("id", subnet.id().toString()) | 34 | + .put("id", subnet.id().toString()) |
35 | - .put("gateway_ip", subnet.gatewayIp().toString()) | 35 | + .put("gateway_ip", subnet.gatewayIp().toString()) |
36 | - .put("network_id", subnet.networkId().toString()) | 36 | + .put("network_id", subnet.networkId().toString()) |
37 | - .put("name", subnet.subnetName()) | 37 | + .put("name", subnet.subnetName()) |
38 | - .put("ip_version", subnet.ipVersion().toString()) | 38 | + .put("ip_version", subnet.ipVersion().toString()) |
39 | - .put("cidr", subnet.cidr().toString()) | 39 | + .put("cidr", subnet.cidr().toString()) |
40 | - .put("shared", subnet.shared()) | 40 | + .put("shared", subnet.shared()) |
41 | - .put("enabled_dchp", subnet.dhcpEnabled()) | 41 | + .put("enabled_dchp", subnet.dhcpEnabled()) |
42 | - .put("tenant_id", subnet.tenantId().toString()) | 42 | + .put("tenant_id", subnet.tenantId().toString()) |
43 | - .put("ipv6_address_mode", subnet.ipV6AddressMode() == null ? null | 43 | + .put("ipv6_address_mode", subnet.ipV6AddressMode() == null ? null |
44 | - : subnet.ipV6AddressMode().toString()) | 44 | + : subnet.ipV6AddressMode().toString()) |
45 | - .put("ipv6_ra_mode", subnet.ipV6RaMode() == null ? null | 45 | + .put("ipv6_ra_mode", subnet.ipV6RaMode() == null ? null |
46 | - : subnet.ipV6RaMode().toString()); | 46 | + : subnet.ipV6RaMode().toString()); |
47 | - result.set("allocation_pools", new AllocationPoolsCodec().encode(subnet | 47 | + result.set("allocation_pools", new AllocationPoolsCodec().encode(subnet |
48 | - .allocationPools(), context)); | 48 | + .allocationPools(), context)); |
49 | - result.set("host_routes", | 49 | + result.set("host_routes", |
50 | - new HostRoutesCodec().encode(subnet.hostRoutes(), context)); | 50 | + new HostRoutesCodec().encode(subnet.hostRoutes(), context)); |
51 | - return result; | 51 | + return result; |
52 | - } | 52 | + } |
53 | -} | 53 | +} | ... | ... |
1 | -/* | 1 | +/* |
2 | - * Copyright 2015 Open Networking Laboratory | 2 | + * Copyright 2015 Open Networking Laboratory |
3 | - * | 3 | + * |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | - * you may not use this file except in compliance with the License. | 5 | + * you may not use this file except in compliance with the License. |
6 | - * You may obtain a copy of the License at | 6 | + * You may obtain a copy of the License at |
7 | - * | 7 | + * |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | - * | 9 | + * |
10 | - * Unless required by applicable law or agreed to in writing, software | 10 | + * Unless required by applicable law or agreed to in writing, software |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | - * See the License for the specific language governing permissions and | 13 | + * See the License for the specific language governing permissions and |
14 | - * limitations under the License. | 14 | + * limitations under the License. |
15 | - */ | 15 | + */ |
16 | -package org.onosproject.vtnrsc.web; | 16 | +package org.onosproject.vtnrsc.web; |
17 | - | 17 | + |
18 | -import static com.google.common.base.Preconditions.checkNotNull; | 18 | +import static com.google.common.base.Preconditions.checkNotNull; |
19 | - | 19 | + |
20 | -import org.onosproject.codec.CodecContext; | 20 | +import org.onosproject.codec.CodecContext; |
21 | -import org.onosproject.codec.JsonCodec; | 21 | +import org.onosproject.codec.JsonCodec; |
22 | -import org.onosproject.vtnrsc.TenantNetwork; | 22 | +import org.onosproject.vtnrsc.TenantNetwork; |
23 | - | 23 | + |
24 | -import com.fasterxml.jackson.databind.node.ObjectNode; | 24 | +import com.fasterxml.jackson.databind.node.ObjectNode; |
25 | - | 25 | + |
26 | -/** | 26 | +/** |
27 | - * TenantNetwork JSON codec. | 27 | + * TenantNetwork JSON codec. |
28 | - */ | 28 | + */ |
29 | -public final class TenantNetworkCodec extends JsonCodec<TenantNetwork> { | 29 | +public final class TenantNetworkCodec extends JsonCodec<TenantNetwork> { |
30 | - | 30 | + |
31 | - @Override | 31 | + @Override |
32 | - public ObjectNode encode(TenantNetwork network, CodecContext context) { | 32 | + public ObjectNode encode(TenantNetwork network, CodecContext context) { |
33 | - checkNotNull(network, "Network cannot be null"); | 33 | + checkNotNull(network, "Network cannot be null"); |
34 | - ObjectNode result = context.mapper().createObjectNode() | 34 | + ObjectNode result = context.mapper().createObjectNode() |
35 | - .put("id", network.id().toString()) | 35 | + .put("id", network.id().toString()) |
36 | - .put("name", network.name()) | 36 | + .put("name", network.name()) |
37 | - .put("admin_state_up", network.adminStateUp()) | 37 | + .put("admin_state_up", network.adminStateUp()) |
38 | - .put("status", "" + network.state()) | 38 | + .put("status", "" + network.state()) |
39 | - .put("shared", network.shared()) | 39 | + .put("shared", network.shared()) |
40 | - .put("tenant_id", network.tenantId().toString()) | 40 | + .put("tenant_id", network.tenantId().toString()) |
41 | - .put("router:external", network.routerExternal()) | 41 | + .put("router:external", network.routerExternal()) |
42 | - .put("provider:network_type", "" + network.type()) | 42 | + .put("provider:network_type", "" + network.type()) |
43 | - .put("provider:physical_network", network.physicalNetwork().toString()) | 43 | + .put("provider:physical_network", network.physicalNetwork().toString()) |
44 | - .put("provider:segmentation_id", network.segmentationId().toString()); | 44 | + .put("provider:segmentation_id", network.segmentationId().toString()); |
45 | - return result; | 45 | + return result; |
46 | - } | 46 | + } |
47 | -} | 47 | +} | ... | ... |
1 | -/* | 1 | +/* |
2 | - * Copyright 2015 Open Networking Laboratory | 2 | + * Copyright 2015 Open Networking Laboratory |
3 | - * | 3 | + * |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | - * you may not use this file except in compliance with the License. | 5 | + * you may not use this file except in compliance with the License. |
6 | - * You may obtain a copy of the License at | 6 | + * You may obtain a copy of the License at |
7 | - * | 7 | + * |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | - * | 9 | + * |
10 | - * Unless required by applicable law or agreed to in writing, software | 10 | + * Unless required by applicable law or agreed to in writing, software |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | - * See the License for the specific language governing permissions and | 13 | + * See the License for the specific language governing permissions and |
14 | - * limitations under the License. | 14 | + * limitations under the License. |
15 | - */ | 15 | + */ |
16 | -package org.onosproject.vtnrsc.web; | 16 | +package org.onosproject.vtnrsc.web; |
17 | - | 17 | + |
18 | -import static com.google.common.base.Preconditions.checkNotNull; | 18 | +import static com.google.common.base.Preconditions.checkNotNull; |
19 | - | 19 | + |
20 | -import org.onosproject.codec.CodecContext; | 20 | +import org.onosproject.codec.CodecContext; |
21 | -import org.onosproject.codec.JsonCodec; | 21 | +import org.onosproject.codec.JsonCodec; |
22 | -import org.onosproject.vtnrsc.VirtualPort; | 22 | +import org.onosproject.vtnrsc.VirtualPort; |
23 | - | 23 | + |
24 | -import com.fasterxml.jackson.databind.node.ObjectNode; | 24 | +import com.fasterxml.jackson.databind.node.ObjectNode; |
25 | - | 25 | + |
26 | -/** | 26 | +/** |
27 | - * VirtualPort JSON codec. | 27 | + * VirtualPort JSON codec. |
28 | - */ | 28 | + */ |
29 | -public final class VirtualPortCodec extends JsonCodec<VirtualPort> { | 29 | +public final class VirtualPortCodec extends JsonCodec<VirtualPort> { |
30 | - @Override | 30 | + @Override |
31 | - public ObjectNode encode(VirtualPort vPort, CodecContext context) { | 31 | + public ObjectNode encode(VirtualPort vPort, CodecContext context) { |
32 | - checkNotNull(vPort, "VPort cannot be null"); | 32 | + checkNotNull(vPort, "VPort cannot be null"); |
33 | - ObjectNode result = context | 33 | + ObjectNode result = context |
34 | - .mapper() | 34 | + .mapper() |
35 | - .createObjectNode() | 35 | + .createObjectNode() |
36 | - .put("id", vPort.portId().toString()) | 36 | + .put("id", vPort.portId().toString()) |
37 | - .put("network_id", vPort.networkId().toString()) | 37 | + .put("network_id", vPort.networkId().toString()) |
38 | - .put("admin_state_up", vPort.adminStateUp()) | 38 | + .put("admin_state_up", vPort.adminStateUp()) |
39 | - .put("name", vPort.name()) | 39 | + .put("name", vPort.name()) |
40 | - .put("status", vPort.state().toString()) | 40 | + .put("status", vPort.state().toString()) |
41 | - .put("mac_address", vPort.macAddress().toString()) | 41 | + .put("mac_address", vPort.macAddress().toString()) |
42 | - .put("tenant_id", vPort.tenantId().toString()) | 42 | + .put("tenant_id", vPort.tenantId().toString()) |
43 | - .put("device_id", vPort.deviceId().toString()) | 43 | + .put("device_id", vPort.deviceId().toString()) |
44 | - .put("device_owner", vPort.deviceOwner()) | 44 | + .put("device_owner", vPort.deviceOwner()) |
45 | - .put("binding:vnic_type", vPort.bindingVnicType()) | 45 | + .put("binding:vnic_type", vPort.bindingVnicType()) |
46 | - .put("binding:Vif_type", vPort.bindingVifType()) | 46 | + .put("binding:Vif_type", vPort.bindingVifType()) |
47 | - .put("binding:host_id", vPort.bindingHostId().toString()) | 47 | + .put("binding:host_id", vPort.bindingHostId().toString()) |
48 | - .put("binding:vif_details", vPort.bindingVifDetails()); | 48 | + .put("binding:vif_details", vPort.bindingVifDetails()); |
49 | - result.set("allowed_address_pairs", new AllowedAddressPairCodec().encode( | 49 | + result.set("allowed_address_pairs", new AllowedAddressPairCodec().encode( |
50 | - vPort.allowedAddressPairs(), context)); | 50 | + vPort.allowedAddressPairs(), context)); |
51 | - result.set("fixed_ips", new FixedIpCodec().encode( | 51 | + result.set("fixed_ips", new FixedIpCodec().encode( |
52 | - vPort.fixedIps(), context)); | 52 | + vPort.fixedIps(), context)); |
53 | - result.set("security_groups", new SecurityGroupCodec().encode( | 53 | + result.set("security_groups", new SecurityGroupCodec().encode( |
54 | - vPort.securityGroups(), context)); | 54 | + vPort.securityGroups(), context)); |
55 | - return result; | 55 | + return result; |
56 | - } | 56 | + } |
57 | -} | 57 | +} | ... | ... |
-
Please register or login to post a comment