CNlucius
Committed by Gerrit Code Review

ONOS-2622

Fix error of north app and update onos-app-vtnrsc package

Change-Id: I375002ff26d2ab3ada879a92a1d47bcdb8980054
Showing 41 changed files with 2233 additions and 2164 deletions
1 -<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 -<!--
3 - ~ Copyright 2015 Open Networking Laboratory
4 - ~
5 - ~ Licensed under the Apache License, Version 2.0 (the "License");
6 - ~ you may not use this file except in compliance with the License.
7 - ~ You may obtain a copy of the License at
8 - ~
9 - ~ http://www.apache.org/licenses/LICENSE-2.0
10 - ~
11 - ~ Unless required by applicable law or agreed to in writing, software
12 - ~ distributed under the License is distributed on an "AS IS" BASIS,
13 - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 - ~ See the License for the specific language governing permissions and
15 - ~ limitations under the License.
16 - -->
17 -<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="${project.artifactId}-${project.version}">
18 - <repository>mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features</repository>
19 - <feature name="onos-app-vtnrsc" version="@FEATURE-VERSION"
20 - description="ONOS app vtnrsc components">
21 - <feature>onos-api</feature>
22 - <bundle>mvn:org.onosproject/onos-app-vtnrsc/@ONOS-VERSION
23 - </bundle>
24 - </feature>
25 -</features>
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.app.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.app.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 &amp; 59 + * Creates a allowedAddressPair using the supplied ipAddress &amp;
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 +package org.onosproject.vtnrsc;
2 +
3 +import static com.google.common.base.Preconditions.checkNotNull;
4 +
5 +import java.util.Objects;
6 +
7 +public final class BindingHostId {
8 + private final String bindingHostId;
9 +
10 + // Public construction is prohibited
11 + private BindingHostId(String bindingHostId) {
12 + checkNotNull(bindingHostId, "BindingHosttId cannot be null");
13 + this.bindingHostId = bindingHostId;
14 + }
15 +
16 + /**
17 + * Creates a BindingHostId identifier.
18 + *
19 + * @param bindingHostId the bindingHostId identifier
20 + * @return the bindingHostId identifier
21 + */
22 + public static BindingHostId bindingHostId(String bindingHostId) {
23 + return new BindingHostId(bindingHostId);
24 + }
25 +
26 + /**
27 + * Returns the bindingHostId identifier.
28 + *
29 + * @return the bindingHostId identifier
30 + */
31 + public String bindingHostId() {
32 + return bindingHostId;
33 + }
34 +
35 + @Override
36 + public int hashCode() {
37 + return Objects.hash(bindingHostId);
38 + }
39 +
40 + @Override
41 + public boolean equals(Object obj) {
42 + if (this == obj) {
43 + return true;
44 + }
45 + if (obj instanceof BindingHostId) {
46 + final BindingHostId that = (BindingHostId) obj;
47 + return this.getClass() == that.getClass()
48 + && Objects.equals(this.bindingHostId, that.bindingHostId);
49 + }
50 + return false;
51 + }
52 +
53 + @Override
54 + public String toString() {
55 + return bindingHostId;
56 + }
57 +}
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.app.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.app.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 +}
......
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.app.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.app.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.app.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 physicalnetwork 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 network id using the physicalnetwork. 36 + * Creates a PhysicalNetwork object.
37 - * 37 + *
38 - * @param physicalnetwork network String 38 + * @param physicalNetwork physical network
39 - * @return physicalnetwork 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 - * 46 + * Returns a physicalNetwork.
47 - * @return physicalnetwork 47 + *
48 - */ 48 + * @return physical network
49 - public String physicalnetwork() { 49 + */
50 - return physicalnetwork; 50 + public String physicalNetwork() {
51 - } 51 + return physicalNetwork;
52 - 52 + }
53 - @Override 53 +
54 - public int hashCode() { 54 + @Override
55 - return Objects.hash(physicalnetwork); 55 + public int hashCode() {
56 - } 56 + return Objects.hash(physicalNetwork);
57 - 57 + }
58 - @Override 58 +
59 - public boolean equals(Object obj) { 59 + @Override
60 - if (this == obj) { 60 + public boolean equals(Object obj) {
61 - return true; 61 + if (this == obj) {
62 - } 62 + return true;
63 - if (obj instanceof PhysicalNetwork) { 63 + }
64 - final PhysicalNetwork that = (PhysicalNetwork) obj; 64 + if (obj instanceof PhysicalNetwork) {
65 - return this.getClass() == that.getClass() 65 + final PhysicalNetwork that = (PhysicalNetwork) obj;
66 - && Objects.equals(this.physicalnetwork, 66 + return this.getClass() == that.getClass()
67 - that.physicalnetwork); 67 + && Objects.equals(this.physicalNetwork,
68 - } 68 + that.physicalNetwork);
69 - return false; 69 + }
70 - } 70 + return false;
71 - 71 + }
72 - @Override 72 +
73 - public String toString() { 73 + @Override
74 - return physicalnetwork; 74 + public String toString() {
75 - } 75 + return physicalNetwork;
76 - 76 + }
77 -} 77 +
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.app.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.app.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 2014 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.app.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.app.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.app.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 network identity. 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 - * 46 + * Returns the tenant identifier.
47 - * @return tenantid 47 + *
48 - */ 48 + * @return the tenant identifier
49 - public String tenantid() { 49 + */
50 - return tenantid; 50 + public String tenantId() {
51 - } 51 + return tenantId;
52 - 52 + }
53 - @Override 53 +
54 - public int hashCode() { 54 + @Override
55 - return Objects.hash(tenantid); 55 + public int hashCode() {
56 - } 56 + return Objects.hash(tenantId);
57 - 57 + }
58 - @Override 58 +
59 - public boolean equals(Object obj) { 59 + @Override
60 - if (this == obj) { 60 + public boolean equals(Object obj) {
61 - return true; 61 + if (this == obj) {
62 - } 62 + return true;
63 - if (obj instanceof TenantId) { 63 + }
64 - final TenantId that = (TenantId) obj; 64 + if (obj instanceof TenantId) {
65 - return this.getClass() == that.getClass() 65 + final TenantId that = (TenantId) obj;
66 - && Objects.equals(this.tenantid, that.tenantid); 66 + return this.getClass() == that.getClass()
67 - } 67 + && Objects.equals(this.tenantId, that.tenantId);
68 - return false; 68 + }
69 - } 69 + return false;
70 - 70 + }
71 - @Override 71 +
72 - public String toString() { 72 + @Override
73 - return tenantid; 73 + public String toString() {
74 - } 74 + return tenantId;
75 - 75 + }
76 -} 76 +
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.app.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 tenantNetwork 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.app.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.app.vtnrsc; 16 +package org.onosproject.vtnrsc;
17 - 17 +
18 -import java.util.Collection; 18 +import java.util.Collection;
19 - 19 +import java.util.Set;
20 -import org.onlab.packet.MacAddress; 20 +
21 -import org.onosproject.net.DeviceId; 21 +import org.onlab.packet.MacAddress;
22 -import org.onosproject.net.HostId; 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 the IP address for the port, Include the IP address 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 port fixedIps 118 + * @return FixedIps Set of fixedIp
119 - */ 119 + */
120 - 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 - HostId 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.app.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.app.vtnrsc.subnet; 16 +package org.onosproject.vtnrsc.subnet;
17 - 17 +
18 -import org.onosproject.app.vtnrsc.Subnet; 18 +import org.onosproject.vtnrsc.Subnet;
19 -import org.onosproject.app.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 +}
......
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.app.vtnrsc.tenantnetwork; 16 +package org.onosproject.vtnrsc.tenantnetwork;
17 - 17 +
18 -import org.onosproject.app.vtnrsc.TenantNetwork; 18 +import org.onosproject.vtnrsc.TenantNetwork;
19 -import org.onosproject.app.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 networksId the collection of tenantNetworkIds 76 + * @param networksIds the collection of tenantNetworkIds
77 - * @return true if the specified tenantNetwork deleted successfully. 77 + * @return true if the specified tenantNetworks deleted successfully.
78 - */ 78 + */
79 - boolean removeNetworks(Iterable<TenantNetworkId> networksId); 79 + boolean removeNetworks(Iterable<TenantNetworkId> networksIds);
80 -} 80 +}
......
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.app.vtnrsc.tenantnetwork.impl; 16 +package org.onosproject.vtnrsc.tenantnetwork.impl;
17 - 17 +
18 -import static com.google.common.base.Preconditions.checkNotNull; 18 +import static com.google.common.base.Preconditions.checkNotNull;
19 -import static org.slf4j.LoggerFactory.getLogger; 19 +import static org.slf4j.LoggerFactory.getLogger;
20 - 20 +
21 -import java.util.Collections; 21 +import java.util.Collections;
22 - 22 +import java.util.concurrent.ConcurrentHashMap;
23 -import org.apache.felix.scr.annotations.Activate; 23 +
24 -import org.apache.felix.scr.annotations.Component; 24 +import org.apache.felix.scr.annotations.Activate;
25 -import org.apache.felix.scr.annotations.Deactivate; 25 +import org.apache.felix.scr.annotations.Component;
26 -import org.apache.felix.scr.annotations.Reference; 26 +import org.apache.felix.scr.annotations.Deactivate;
27 -import org.apache.felix.scr.annotations.ReferenceCardinality; 27 +import org.apache.felix.scr.annotations.Service;
28 -import org.apache.felix.scr.annotations.Service; 28 +import org.onosproject.vtnrsc.TenantNetwork;
29 -import org.onlab.util.KryoNamespace; 29 +import org.onosproject.vtnrsc.TenantNetworkId;
30 -import org.onosproject.app.vtnrsc.TenantNetwork; 30 +import org.onosproject.vtnrsc.tenantnetwork.TenantNetworkService;
31 -import org.onosproject.app.vtnrsc.TenantNetworkId; 31 +import org.slf4j.Logger;
32 -import org.onosproject.app.vtnrsc.tenantnetwork.TenantNetworkService; 32 +
33 -import org.onosproject.store.service.EventuallyConsistentMap; 33 +/**
34 -import org.onosproject.store.service.MultiValuedTimestamp; 34 + * Provides implementation of the tenantNetworkService.
35 -import org.onosproject.store.service.StorageService; 35 + */
36 -import org.onosproject.store.service.WallClockTimestamp; 36 +@Component(immediate = true)
37 -import org.slf4j.Logger; 37 +@Service
38 - 38 +public class TenantNetworkManager implements TenantNetworkService {
39 -/** 39 +
40 - * Provides implementation of the tenantNetworkService. 40 + private static final String NETWORK_ID_NULL = "Network ID cannot be null";
41 - */ 41 + private static final String NETWORK_NOT_NULL = "Network ID cannot be null";
42 -@Component(immediate = true) 42 +
43 -@Service 43 + protected ConcurrentHashMap<TenantNetworkId, TenantNetwork> networkIdAsKeyStore =
44 -public class TenantNetworkManager implements TenantNetworkService { 44 + new ConcurrentHashMap<>();
45 - 45 +
46 - private static final String NETWORK_ID_NULL = "Network ID cannot be null"; 46 + private final Logger log = getLogger(getClass());
47 - private static final String NETWORK_NOT_NULL = "Network ID cannot be null"; 47 +
48 - 48 + @Activate
49 - @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) 49 + public void activate() {
50 - protected StorageService storageService; 50 + log.info("Started");
51 - private EventuallyConsistentMap<TenantNetworkId, TenantNetwork> networkIdAsKeyStore; 51 + }
52 - private final Logger log = getLogger(getClass()); 52 +
53 - 53 + @Deactivate
54 - @Activate 54 + public void deactivate() {
55 - public void activate() { 55 + networkIdAsKeyStore.clear();
56 - KryoNamespace.Builder serializer = KryoNamespace.newBuilder() 56 + log.info("Stopped");
57 - .register(MultiValuedTimestamp.class); 57 + }
58 - networkIdAsKeyStore = storageService 58 +
59 - .<TenantNetworkId, TenantNetwork>eventuallyConsistentMapBuilder() 59 + @Override
60 - .withName("all_network").withSerializer(serializer) 60 + public boolean exists(TenantNetworkId networkId) {
61 - .withTimestampProvider((k, v) -> new WallClockTimestamp()) 61 + checkNotNull(networkId, NETWORK_ID_NULL);
62 - .build(); 62 + return networkIdAsKeyStore.containsKey(networkId);
63 - log.info("Started"); 63 + }
64 - } 64 +
65 - 65 + @Override
66 - @Deactivate 66 + public int getNetworkCount() {
67 - public void deactivate() { 67 + return networkIdAsKeyStore.size();
68 - networkIdAsKeyStore.destroy(); 68 + }
69 - log.info("Stopped"); 69 +
70 - } 70 + @Override
71 - 71 + public Iterable<TenantNetwork> getNetworks() {
72 - @Override 72 + return Collections.unmodifiableCollection(networkIdAsKeyStore.values());
73 - public boolean exists(TenantNetworkId networkId) { 73 + }
74 - checkNotNull(networkId, NETWORK_ID_NULL); 74 +
75 - return networkIdAsKeyStore.containsKey(networkId); 75 + @Override
76 - } 76 + public TenantNetwork getNetwork(TenantNetworkId networkId) {
77 - 77 + checkNotNull(networkId, NETWORK_ID_NULL);
78 - @Override 78 + return networkIdAsKeyStore.get(networkId);
79 - public int getNetworkCount() { 79 + }
80 - return networkIdAsKeyStore.size(); 80 +
81 - } 81 + @Override
82 - 82 + public boolean createNetworks(Iterable<TenantNetwork> networks) {
83 - @Override 83 + checkNotNull(networks, NETWORK_NOT_NULL);
84 - public Iterable<TenantNetwork> getNetworks() { 84 + for (TenantNetwork network : networks) {
85 - return Collections.unmodifiableCollection(networkIdAsKeyStore.values()); 85 + networkIdAsKeyStore.put(network.id(), network);
86 - } 86 + if (!networkIdAsKeyStore.containsKey(network.id())) {
87 - 87 + log.debug("The tenantNetwork is created failed which identifier was {}", network.id()
88 - @Override 88 + .toString());
89 - public TenantNetwork getNetwork(TenantNetworkId networkId) { 89 + return false;
90 - checkNotNull(networkId, NETWORK_ID_NULL); 90 + }
91 - return networkIdAsKeyStore.get(networkId); 91 + }
92 - } 92 + return true;
93 - 93 + }
94 - @Override 94 +
95 - public boolean createNetworks(Iterable<TenantNetwork> networks) { 95 + @Override
96 - checkNotNull(networks, NETWORK_NOT_NULL); 96 + public boolean updateNetworks(Iterable<TenantNetwork> networks) {
97 - for (TenantNetwork network : networks) { 97 + checkNotNull(networks, NETWORK_NOT_NULL);
98 - networkIdAsKeyStore.put(network.id(), network); 98 + for (TenantNetwork network : networks) {
99 - if (!networkIdAsKeyStore.containsKey(network.id())) { 99 + if (!networkIdAsKeyStore.containsKey(network.id())) {
100 - log.debug("the network created failed which identifier was {}", network.id() 100 + log.debug("The tenantNetwork is not exist whose identifier was {} ",
101 - .toString()); 101 + network.id().toString());
102 - return false; 102 + return false;
103 - } 103 + }
104 - } 104 +
105 - return true; 105 + networkIdAsKeyStore.put(network.id(), network);
106 - } 106 +
107 - 107 + if (!network.equals(networkIdAsKeyStore.get(network.id()))) {
108 - @Override 108 + log.debug("The tenantNetwork is updated failed whose identifier was {} ",
109 - public boolean updateNetworks(Iterable<TenantNetwork> networks) { 109 + network.id().toString());
110 - checkNotNull(networks, NETWORK_NOT_NULL); 110 + return false;
111 - for (TenantNetwork network : networks) { 111 + }
112 - if (!networkIdAsKeyStore.containsKey(network.id())) { 112 +
113 - log.debug("the tenantNetwork did not exist whose identifier was {} ", 113 + }
114 - network.id().toString()); 114 + return true;
115 - return false; 115 + }
116 - } 116 +
117 - 117 + @Override
118 - networkIdAsKeyStore.put(network.id(), network); 118 + public boolean removeNetworks(Iterable<TenantNetworkId> networkIds) {
119 - 119 + checkNotNull(networkIds, NETWORK_NOT_NULL);
120 - if (network.equals(networkIdAsKeyStore.get(network.id()))) { 120 + for (TenantNetworkId networkId : networkIds) {
121 - log.debug("the network updated failed whose identifier was {} ", 121 + networkIdAsKeyStore.remove(networkId);
122 - network.id().toString()); 122 + if (networkIdAsKeyStore.containsKey(networkId)) {
123 - return false; 123 + log.debug("The tenantNetwork is removed failed whose identifier was {}",
124 - } 124 + networkId.toString());
125 - 125 + return false;
126 - } 126 + }
127 - return true; 127 + }
128 - } 128 + return true;
129 - 129 + }
130 - @Override 130 +}
131 - public boolean removeNetworks(Iterable<TenantNetworkId> networkIds) {
132 - checkNotNull(networkIds, NETWORK_NOT_NULL);
133 - for (TenantNetworkId networkId : networkIds) {
134 - networkIdAsKeyStore.remove(networkId);
135 - if (networkIdAsKeyStore.containsKey(networkId)) {
136 - log.debug("the network removed failed whose identifier was {}",
137 - networkId.toString());
138 - return false;
139 - }
140 - }
141 - return true;
142 - }
143 -}
......
1 +/*
2 + * Copyright 2015 Open Networking Laboratory
3 + *
4 + * Licensed under the Apache License, Version 2.0 (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
7 + *
8 + * http://www.apache.org/licenses/LICENSE-2.0
9 + *
10 + * Unless required by applicable law or agreed to in writing, software
11 + * distributed under the License is distributed on an "AS IS" BASIS,
12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 + * See the License for the specific language governing permissions and
14 + * limitations under the License.
15 + */
16 +package org.onosproject.vtnrsc.tunnel;
17 +
18 +import org.onosproject.vtnrsc.Subnet;
19 +import org.onosproject.vtnrsc.SubnetId;
20 +
21 +
22 +/**
23 + * Service for interacting with the inventory of subnets.
24 + */
25 +public interface TunnelConfigService {
26 + /**
27 + * Returns the subnet with the specified identifier.
28 + *
29 + * @param subnetId subnet identifier
30 + * @return true or false
31 + */
32 + boolean exists(SubnetId subnetId);
33 + /**
34 + * Returns a collection of the currently known subnets.
35 + *
36 + * @return iterable collection of subnets
37 + */
38 + Iterable<Subnet> getSubnets();
39 +
40 + /**
41 + * Returns the subnet with the specified identifier.
42 + *
43 + * @param subnetId subnet identifier
44 + * @return subnet or null if one with the given identifier is not known
45 + */
46 + Subnet getSubnet(SubnetId subnetId);
47 + /**
48 + * Creates new subnets.
49 + *
50 + * @param subnets the iterable collection of subnets
51 + * @return true if the identifier subnet has been created right
52 + */
53 + boolean createSubnets(Iterable<Subnet> subnets);
54 +
55 + /**
56 + * Updates existing subnets.
57 + *
58 + * @param subnets the iterable collection of subnets
59 + * @return true if all subnets were updated successfully
60 + */
61 + boolean updateSubnets(Iterable<Subnet> subnets);
62 +
63 + /**
64 + * Administratively removes the specified subnets from the store.
65 + *
66 + * @param subnetIds the iterable collection of subnets identifier
67 + * @return true if remove identifier subnets successfully
68 + */
69 + boolean removeSubnets(Iterable<SubnetId> subnetIds);
70 +
71 +
72 +}
1 -/* 1 +/*
2 - * Copyright 2015 Open Porting Laboratory 2 + * Copyright 2015 Open Porting 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.app.vtnrsc.virtualport; 16 +package org.onosproject.vtnrsc.virtualport;
17 - 17 +
18 -import java.util.Collection; 18 +import java.util.Collection;
19 - 19 +
20 -import org.onosproject.app.vtnrsc.TenantNetworkId; 20 +import org.onosproject.net.DeviceId;
21 -import org.onosproject.app.vtnrsc.TenantId; 21 +import org.onosproject.vtnrsc.TenantId;
22 -import org.onosproject.app.vtnrsc.VirtualPort; 22 +import org.onosproject.vtnrsc.TenantNetworkId;
23 -import org.onosproject.app.vtnrsc.VirtualPortId; 23 +import org.onosproject.vtnrsc.VirtualPort;
24 -import org.onosproject.net.DeviceId; 24 +import org.onosproject.vtnrsc.VirtualPortId;
25 - 25 +
26 -/** 26 +/**
27 - * Service for interacting with the inventory of virtualPort. 27 + * Service for interacting with the inventory of virtualPort.
28 - */ 28 + */
29 -public interface VirtualPortService { 29 +public interface VirtualPortService {
30 - /** 30 + /**
31 - * Returns if the virtualPort is existed. 31 + * Returns if the virtualPort is existed.
32 - * 32 + *
33 - * @param virtualPortId virtualPort identifier 33 + * @param virtualPortId virtualPort identifier
34 - * @return true or false if one with the given identifier is not existed. 34 + * @return true or false if one with the given identifier is not existed.
35 - */ 35 + */
36 - boolean exists(VirtualPortId virtualPortId); 36 + boolean exists(VirtualPortId virtualPortId);
37 - 37 +
38 - /** 38 + /**
39 - * Returns the virtualPort with the identifier. 39 + * Returns the virtualPort with the identifier.
40 - * 40 + *
41 - * @param virtualPortId virtualPort ID 41 + * @param virtualPortId virtualPort ID
42 - * @return VirtualPort or null if one with the given ID is not know. 42 + * @return VirtualPort or null if one with the given ID is not know.
43 - */ 43 + */
44 - VirtualPort getPort(VirtualPortId virtualPortId); 44 + VirtualPort getPort(VirtualPortId virtualPortId);
45 - 45 +
46 - /** 46 + /**
47 - * Returns the collection of the currently known virtualPort. 47 + * Returns the collection of the currently known virtualPort.
48 - */ 48 + * @return collection of VirtualPort.
49 - Collection<VirtualPort> getPorts(); 49 + */
50 - 50 + Collection<VirtualPort> getPorts();
51 - /** 51 +
52 - * Returns the collection of the virtualPorts associated with the networkId. 52 + /**
53 - * 53 + * Returns the collection of the virtualPorts associated with the networkId.
54 - * @param networkId the network identifer 54 + *
55 - * @return collection of virtualPort. 55 + * @param networkId the network identifer
56 - */ 56 + * @return collection of virtualPort.
57 - Collection<VirtualPort> getPorts(TenantNetworkId networkId); 57 + */
58 - 58 + Collection<VirtualPort> getPorts(TenantNetworkId networkId);
59 - /** 59 +
60 - * Returns the collection of the virtualPorts associated with the tenantId. 60 + /**
61 - * 61 + * Returns the collection of the virtualPorts associated with the tenantId.
62 - * @param tenantId the tenant identifier 62 + *
63 - * @return collection of virtualPorts. 63 + * @param tenantId the tenant identifier
64 - */ 64 + * @return collection of virtualPorts.
65 - Collection<VirtualPort> getPorts(TenantId tenantId); 65 + */
66 - 66 + Collection<VirtualPort> getPorts(TenantId tenantId);
67 - /** 67 +
68 - * Returns the collection of the virtualPorts associated with the deviceId. 68 + /**
69 - * 69 + * Returns the collection of the virtualPorts associated with the deviceId.
70 - * @param deviceId the device identifier 70 + *
71 - * @return collection of virtualPort. 71 + * @param deviceId the device identifier
72 - */ 72 + * @return collection of virtualPort.
73 - Collection<VirtualPort> getPorts(DeviceId deviceId); 73 + */
74 - 74 + Collection<VirtualPort> getPorts(DeviceId deviceId);
75 - /** 75 +
76 - * Creates virtualPorts by virtualPorts. 76 + /**
77 - * 77 + * Creates virtualPorts by virtualPorts.
78 - * @param virtualPorts the iterable collection of virtualPorts 78 + *
79 - * @return true if all given identifiers created successfully. 79 + * @param virtualPorts the iterable collection of virtualPorts
80 - */ 80 + * @return true if all given identifiers created successfully.
81 - boolean createPorts(Iterable<VirtualPort> virtualPorts); 81 + */
82 - 82 + boolean createPorts(Iterable<VirtualPort> virtualPorts);
83 - /** 83 +
84 - * Updates virtualPorts by virtualPorts. 84 + /**
85 - * 85 + * Updates virtualPorts by virtualPorts.
86 - * @param virtualPorts the iterable collection of virtualPorts 86 + *
87 - * @return true if all given identifiers updated successfully. 87 + * @param virtualPorts the iterable collection of virtualPorts
88 - */ 88 + * @return true if all given identifiers updated successfully.
89 - boolean updatePorts(Iterable<VirtualPort> virtualPorts); 89 + */
90 - 90 + boolean updatePorts(Iterable<VirtualPort> virtualPorts);
91 - /** 91 +
92 - * Deletes virtualPortIds by virtualPortIds. 92 + /**
93 - * 93 + * Deletes virtualPortIds by virtualPortIds.
94 - * @param virtualPortIds the iterable collection of virtualPort identifiers 94 + *
95 - * @return true or false if one with the given identifier to delete is 95 + * @param virtualPortIds the iterable collection of virtualPort identifiers
96 - * successfully. 96 + * @return true or false if one with the given identifier to delete is
97 - */ 97 + * successfully.
98 - boolean removePorts(Iterable<VirtualPortId> virtualPortIds); 98 + */
99 -} 99 + boolean removePorts(Iterable<VirtualPortId> virtualPortIds);
100 +}
......
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.app.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.app.vtnrsc.AllocationPool; 20 +import org.onosproject.codec.CodecContext;
21 -import org.onosproject.codec.CodecContext; 21 +import org.onosproject.codec.JsonCodec;
22 -import org.onosproject.codec.JsonCodec; 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.app.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.app.vtnrsc.AllowedAddressPair; 20 +import org.onosproject.codec.CodecContext;
21 -import org.onosproject.codec.CodecContext; 21 +import org.onosproject.codec.JsonCodec;
22 -import org.onosproject.codec.JsonCodec; 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.app.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.app.vtnrsc.FixedIp; 20 +import org.onosproject.codec.CodecContext;
21 -import org.onosproject.codec.CodecContext; 21 +import org.onosproject.codec.JsonCodec;
22 -import org.onosproject.codec.JsonCodec; 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.app.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.app.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.app.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.app.vtnrsc.SecurityGroup; 20 +import org.onosproject.codec.CodecContext;
21 -import org.onosproject.codec.CodecContext; 21 +import org.onosproject.codec.JsonCodec;
22 -import org.onosproject.codec.JsonCodec; 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.app.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.app.vtnrsc.Subnet; 20 +import org.onosproject.codec.CodecContext;
21 -import org.onosproject.codec.CodecContext; 21 +import org.onosproject.codec.JsonCodec;
22 -import org.onosproject.codec.JsonCodec; 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("gate_ip", subnet.gatewayIp().toString()) 35 + .put("gate_ip", subnet.gatewayIp().toString())
36 - .put("network_id", subnet.networkId().toString()) 36 + .put("network_id", subnet.networkId().toString())
37 - .put("name", subnet.subnetName().toString()) 37 + .put("name", subnet.subnetName().toString())
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 - result.set("alloction_pools", new AllocationPoolsCodec().encode(subnet 43 + result.set("alloction_pools", new AllocationPoolsCodec().encode(subnet
44 - .allocationPools(), context)); 44 + .allocationPools(), context));
45 - result.set("host_routes", 45 + result.set("host_routes",
46 - new HostRoutesCodec().encode(subnet.hostRoutes(), context)); 46 + new HostRoutesCodec().encode(subnet.hostRoutes(), context));
47 - return result; 47 + return result;
48 - } 48 + }
49 -} 49 +}
......
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.app.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.app.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().toString()) 36 + .put("name", network.name().toString())
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.app.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.app.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().toString()) 39 + .put("name", vPort.name().toString())
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().toString()) 44 + .put("device_owner", vPort.deviceOwner().toString())
45 - .put("binding:vnic_type", vPort.bindingVnicType().toString()) 45 + .put("binding:vnic_type", vPort.bindingVnicType().toString())
46 - .put("binding:Vif_type", vPort.bindingVifType().toString()) 46 + .put("binding:Vif_type", vPort.bindingVifType().toString())
47 - .put("binding:host_id", vPort.bindingHostId().mac().toString()) 47 + .put("binding:host_id", vPort.bindingHostId().toString())
48 - .put("binding:vif_details", vPort.bindingVifDetails().toString()); 48 + .put("binding:vif_details", vPort.bindingVifDetails().toString());
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 +}
......
1 -<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 -<!--
3 - ~ Copyright 2015 Open Networking Laboratory
4 - ~
5 - ~ Licensed under the Apache License, Version 2.0 (the "License");
6 - ~ you may not use this file except in compliance with the License.
7 - ~ You may obtain a copy of the License at
8 - ~
9 - ~ http://www.apache.org/licenses/LICENSE-2.0
10 - ~
11 - ~ Unless required by applicable law or agreed to in writing, software
12 - ~ distributed under the License is distributed on an "AS IS" BASIS,
13 - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 - ~ See the License for the specific language governing permissions and
15 - ~ limitations under the License.
16 - -->
17 -<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="${project.artifactId}-${project.version}">
18 - <repository>mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features</repository>
19 - <feature name="onos-app-vtnweb" version="@FEATURE-VERSION"
20 - description="ONOS app vtnweb components">
21 - <feature>onos-app-vtnrsc</feature>
22 - <bundle>mvn:org.onosproject/vtnweb/@ONOS-VERSION
23 - </bundle>
24 - </feature>
25 -</features>