Madan Jampani
Committed by Gerrit Code Review

Fix files with windows line endings + Add checkstyle rule to catch this issue

Change-Id: Ic1905f2121c5c2ab66259f7f531c1e36fe58e9d4
Showing 39 changed files with 2503 additions and 2503 deletions
1 -/* 1 +/*
2 - * Copyright 2015 Open Networking Laboratory 2 + * Copyright 2015 Open Networking Laboratory
3 - * 3 + *
4 - * Licensed under the Apache License, Version 2.0 (the "License"); 4 + * Licensed under the Apache License, Version 2.0 (the "License");
5 - * you may not use this file except in compliance with the License. 5 + * you may not use this file except in compliance with the License.
6 - * You may obtain a copy of the License at 6 + * You may obtain a copy of the License at
7 - * 7 + *
8 - * http://www.apache.org/licenses/LICENSE-2.0 8 + * http://www.apache.org/licenses/LICENSE-2.0
9 - * 9 + *
10 - * Unless required by applicable law or agreed to in writing, software 10 + * Unless required by applicable law or agreed to in writing, software
11 - * distributed under the License is distributed on an "AS IS" BASIS, 11 + * distributed under the License is distributed on an "AS IS" BASIS,
12 - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 - * See the License for the specific language governing permissions and 13 + * See the License for the specific language governing permissions and
14 - * limitations under the License. 14 + * limitations under the License.
15 - */ 15 + */
16 -package org.onosproject.iptopology.api; 16 +package org.onosproject.iptopology.api;
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 -/** 22 +/**
23 - * Area identifier class (32 Bit Area-ID). 23 + * Area identifier class (32 Bit Area-ID).
24 - */ 24 + */
25 -public class AreaId { 25 +public class AreaId {
26 - private final int areaId; 26 + private final int areaId;
27 - 27 +
28 - /** 28 + /**
29 - * Constructor to set area identifier. 29 + * Constructor to set area identifier.
30 - * 30 + *
31 - * @param areaId area id 31 + * @param areaId area id
32 - */ 32 + */
33 - public AreaId(int areaId) { 33 + public AreaId(int areaId) {
34 - this.areaId = areaId; 34 + this.areaId = areaId;
35 - } 35 + }
36 - 36 +
37 - /** 37 + /**
38 - * obtain area identifier. 38 + * obtain area identifier.
39 - * 39 + *
40 - * @return area identifier 40 + * @return area identifier
41 - */ 41 + */
42 - public int areaId() { 42 + public int areaId() {
43 - return areaId; 43 + return areaId;
44 - } 44 + }
45 - 45 +
46 - @Override 46 + @Override
47 - public int hashCode() { 47 + public int hashCode() {
48 - return Objects.hash(areaId); 48 + return Objects.hash(areaId);
49 - } 49 + }
50 - 50 +
51 - @Override 51 + @Override
52 - public boolean equals(Object obj) { 52 + public boolean equals(Object obj) {
53 - if (this == obj) { 53 + if (this == obj) {
54 - return true; 54 + return true;
55 - } 55 + }
56 - 56 +
57 - if (obj instanceof AreaId) { 57 + if (obj instanceof AreaId) {
58 - AreaId other = (AreaId) obj; 58 + AreaId other = (AreaId) obj;
59 - return Objects.equals(areaId, other.areaId); 59 + return Objects.equals(areaId, other.areaId);
60 - } 60 + }
61 - return false; 61 + return false;
62 - } 62 + }
63 - 63 +
64 - @Override 64 + @Override
65 - public String toString() { 65 + public String toString() {
66 - return toStringHelper(this) 66 + return toStringHelper(this)
67 - .add("areaId", areaId) 67 + .add("areaId", areaId)
68 - .toString(); 68 + .toString();
69 - } 69 + }
70 } 70 }
...\ No newline at end of file ...\ No newline at end of file
......
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.iptopology.api; 16 +package org.onosproject.iptopology.api;
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 -/** 22 +/**
23 - * Autonomous system Number class (32 Bit ASNumber). 23 + * Autonomous system Number class (32 Bit ASNumber).
24 - */ 24 + */
25 -public class AsNumber { 25 +public class AsNumber {
26 - private final int asNum; 26 + private final int asNum;
27 - 27 +
28 - /** 28 + /**
29 - * Constructor to set As number. 29 + * Constructor to set As number.
30 - * 30 + *
31 - * @param asNum As number 31 + * @param asNum As number
32 - */ 32 + */
33 - public AsNumber(int asNum) { 33 + public AsNumber(int asNum) {
34 - this.asNum = asNum; 34 + this.asNum = asNum;
35 - } 35 + }
36 - 36 +
37 - /** 37 + /**
38 - * Obtain autonomous system number. 38 + * Obtain autonomous system number.
39 - * 39 + *
40 - * @return autonomous system number 40 + * @return autonomous system number
41 - */ 41 + */
42 - public int asNum() { 42 + public int asNum() {
43 - return asNum; 43 + return asNum;
44 - } 44 + }
45 - 45 +
46 - @Override 46 + @Override
47 - public int hashCode() { 47 + public int hashCode() {
48 - return Objects.hash(asNum); 48 + return Objects.hash(asNum);
49 - } 49 + }
50 - 50 +
51 - @Override 51 + @Override
52 - public boolean equals(Object obj) { 52 + public boolean equals(Object obj) {
53 - if (this == obj) { 53 + if (this == obj) {
54 - return true; 54 + return true;
55 - } 55 + }
56 - 56 +
57 - if (obj instanceof AsNumber) { 57 + if (obj instanceof AsNumber) {
58 - AsNumber other = (AsNumber) obj; 58 + AsNumber other = (AsNumber) obj;
59 - return Objects.equals(asNum, other.asNum); 59 + return Objects.equals(asNum, other.asNum);
60 - } 60 + }
61 - return false; 61 + return false;
62 - } 62 + }
63 - 63 +
64 - @Override 64 + @Override
65 - public String toString() { 65 + public String toString() {
66 - return toStringHelper(this) 66 + return toStringHelper(this)
67 - .add("asNum", asNum) 67 + .add("asNum", asNum)
68 - .toString(); 68 + .toString();
69 - } 69 + }
70 } 70 }
...\ No newline at end of file ...\ No newline at end of file
......
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.iptopology.api; 16 +package org.onosproject.iptopology.api;
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.onosproject.net.Element; 22 +import org.onosproject.net.Element;
23 - 23 +
24 -/** 24 +/**
25 - * Default Device interface implementation. 25 + * Default Device interface implementation.
26 - */ 26 + */
27 -public class DefaultDeviceIntf implements DeviceIntf { 27 +public class DefaultDeviceIntf implements DeviceIntf {
28 - 28 +
29 - private final Element element; 29 + private final Element element;
30 - private final DeviceInterface deviceInterface; 30 + private final DeviceInterface deviceInterface;
31 - 31 +
32 - /** 32 + /**
33 - * Constructor to initialize device interface parameters. 33 + * Constructor to initialize device interface parameters.
34 - * 34 + *
35 - * @param element parent network element 35 + * @param element parent network element
36 - * @param deviceInterface device interface 36 + * @param deviceInterface device interface
37 - */ 37 + */
38 - public DefaultDeviceIntf(Element element, DeviceInterface deviceInterface) { 38 + public DefaultDeviceIntf(Element element, DeviceInterface deviceInterface) {
39 - this.element = element; 39 + this.element = element;
40 - this.deviceInterface = deviceInterface; 40 + this.deviceInterface = deviceInterface;
41 - } 41 + }
42 - 42 +
43 - @Override 43 + @Override
44 - public Element element() { 44 + public Element element() {
45 - return element; 45 + return element;
46 - } 46 + }
47 - 47 +
48 - @Override 48 + @Override
49 - public DeviceInterface deviceInterface() { 49 + public DeviceInterface deviceInterface() {
50 - return deviceInterface; 50 + return deviceInterface;
51 - } 51 + }
52 - 52 +
53 - @Override 53 + @Override
54 - public int hashCode() { 54 + public int hashCode() {
55 - return Objects.hash(element, deviceInterface); 55 + return Objects.hash(element, deviceInterface);
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 - 63 +
64 - if (obj instanceof DefaultDeviceIntf) { 64 + if (obj instanceof DefaultDeviceIntf) {
65 - final DefaultDeviceIntf other = (DefaultDeviceIntf) obj; 65 + final DefaultDeviceIntf other = (DefaultDeviceIntf) obj;
66 - return Objects.equals(this.element.id(), other.element.id()) 66 + return Objects.equals(this.element.id(), other.element.id())
67 - && Objects.equals(this.deviceInterface, other.deviceInterface); 67 + && Objects.equals(this.deviceInterface, other.deviceInterface);
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 toStringHelper(this) 74 + return toStringHelper(this)
75 - .add("element", element.id()) 75 + .add("element", element.id())
76 - .add("deviceInterface", deviceInterface) 76 + .add("deviceInterface", deviceInterface)
77 - .toString(); 77 + .toString();
78 - } 78 + }
79 } 79 }
...\ No newline at end of file ...\ No newline at end of file
......
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.iptopology.api; 16 +package org.onosproject.iptopology.api;
17 - 17 +
18 -import org.onosproject.net.AbstractAnnotated; 18 +import org.onosproject.net.AbstractAnnotated;
19 -import org.onosproject.net.Annotations; 19 +import org.onosproject.net.Annotations;
20 -import org.onosproject.net.Element; 20 +import org.onosproject.net.Element;
21 - 21 +
22 -import java.util.Objects; 22 +import java.util.Objects;
23 - 23 +
24 -import static com.google.common.base.MoreObjects.toStringHelper; 24 +import static com.google.common.base.MoreObjects.toStringHelper;
25 - 25 +
26 -/** 26 +/**
27 - * Default Device prefix implementation. 27 + * Default Device prefix implementation.
28 - */ 28 + */
29 -public class DefaultDevicePrefix extends AbstractAnnotated implements DevicePrefix { 29 +public class DefaultDevicePrefix extends AbstractAnnotated implements DevicePrefix {
30 - 30 +
31 - private final Element element; 31 + private final Element element;
32 - private final PrefixIdentifier prefixIdentifier; 32 + private final PrefixIdentifier prefixIdentifier;
33 - private final PrefixTed prefixTed; 33 + private final PrefixTed prefixTed;
34 - 34 +
35 - /** 35 + /**
36 - * Creates a network device prefix attributed to the specified element. 36 + * Creates a network device prefix attributed to the specified element.
37 - * 37 + *
38 - * @param element parent network element 38 + * @param element parent network element
39 - * @param prefixIdentifier prefix identifier 39 + * @param prefixIdentifier prefix identifier
40 - * @param prefixTed prefid traffic engineering parameters 40 + * @param prefixTed prefid traffic engineering parameters
41 - * @param annotations optional key/value annotations 41 + * @param annotations optional key/value annotations
42 - */ 42 + */
43 - public DefaultDevicePrefix(Element element, PrefixIdentifier prefixIdentifier, 43 + public DefaultDevicePrefix(Element element, PrefixIdentifier prefixIdentifier,
44 - PrefixTed prefixTed, Annotations... annotations) { 44 + PrefixTed prefixTed, Annotations... annotations) {
45 - super(annotations); 45 + super(annotations);
46 - this.element = element; 46 + this.element = element;
47 - this.prefixIdentifier = prefixIdentifier; 47 + this.prefixIdentifier = prefixIdentifier;
48 - this.prefixTed = prefixTed; 48 + this.prefixTed = prefixTed;
49 - } 49 + }
50 - 50 +
51 - @Override 51 + @Override
52 - public Element element() { 52 + public Element element() {
53 - return element; 53 + return element;
54 - } 54 + }
55 - 55 +
56 - @Override 56 + @Override
57 - public PrefixIdentifier prefixIdentifier() { 57 + public PrefixIdentifier prefixIdentifier() {
58 - return prefixIdentifier; 58 + return prefixIdentifier;
59 - } 59 + }
60 - 60 +
61 - @Override 61 + @Override
62 - public PrefixTed prefixTed() { 62 + public PrefixTed prefixTed() {
63 - return prefixTed; 63 + return prefixTed;
64 - } 64 + }
65 - 65 +
66 - @Override 66 + @Override
67 - public int hashCode() { 67 + public int hashCode() {
68 - return Objects.hash(element, prefixIdentifier, prefixTed); 68 + return Objects.hash(element, prefixIdentifier, prefixTed);
69 - } 69 + }
70 - 70 +
71 - @Override 71 + @Override
72 - public boolean equals(Object obj) { 72 + public boolean equals(Object obj) {
73 - if (this == obj) { 73 + if (this == obj) {
74 - return true; 74 + return true;
75 - } 75 + }
76 - if (obj instanceof DefaultDevicePrefix) { 76 + if (obj instanceof DefaultDevicePrefix) {
77 - final DefaultDevicePrefix other = (DefaultDevicePrefix) obj; 77 + final DefaultDevicePrefix other = (DefaultDevicePrefix) obj;
78 - return Objects.equals(this.element.id(), other.element.id()) && 78 + return Objects.equals(this.element.id(), other.element.id()) &&
79 - Objects.equals(this.prefixIdentifier, other.prefixIdentifier) && 79 + Objects.equals(this.prefixIdentifier, other.prefixIdentifier) &&
80 - Objects.equals(this.prefixTed, other.prefixTed) && 80 + Objects.equals(this.prefixTed, other.prefixTed) &&
81 - Objects.equals(this.annotations(), other.annotations()); 81 + Objects.equals(this.annotations(), other.annotations());
82 - } 82 + }
83 - return false; 83 + return false;
84 - } 84 + }
85 - 85 +
86 - @Override 86 + @Override
87 - public String toString() { 87 + public String toString() {
88 - return toStringHelper(this) 88 + return toStringHelper(this)
89 - .omitNullValues() 89 + .omitNullValues()
90 - .add("element", element.id()) 90 + .add("element", element.id())
91 - .add("prefixIdentifier", prefixIdentifier) 91 + .add("prefixIdentifier", prefixIdentifier)
92 - .add("prefixTed", prefixTed) 92 + .add("prefixTed", prefixTed)
93 - .toString(); 93 + .toString();
94 - } 94 + }
95 } 95 }
...\ No newline at end of file ...\ No newline at end of file
......
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.iptopology.api; 16 +package org.onosproject.iptopology.api;
17 - 17 +
18 -import org.onosproject.net.AbstractElement; 18 +import org.onosproject.net.AbstractElement;
19 -import org.onosproject.net.Annotations; 19 +import org.onosproject.net.Annotations;
20 -import org.onosproject.net.DeviceId; 20 +import org.onosproject.net.DeviceId;
21 -import org.onosproject.net.provider.ProviderId; 21 +import org.onosproject.net.provider.ProviderId;
22 - 22 +
23 -import java.util.Objects; 23 +import java.util.Objects;
24 - 24 +
25 -import static com.google.common.base.MoreObjects.toStringHelper; 25 +import static com.google.common.base.MoreObjects.toStringHelper;
26 - 26 +
27 -/** 27 +/**
28 - * Default ip device model implementation. 28 + * Default ip device model implementation.
29 - */ 29 + */
30 -public class DefaultIpDevice extends AbstractElement implements IpDevice { 30 +public class DefaultIpDevice extends AbstractElement implements IpDevice {
31 - 31 +
32 - private final Type type; 32 + private final Type type;
33 - private final IpDeviceIdentifier deviceIdentifier; 33 + private final IpDeviceIdentifier deviceIdentifier;
34 - private final DeviceTed deviceTed; 34 + private final DeviceTed deviceTed;
35 - 35 +
36 - 36 +
37 - /** 37 + /**
38 - * For Serialization. 38 + * For Serialization.
39 - */ 39 + */
40 - private DefaultIpDevice() { 40 + private DefaultIpDevice() {
41 - this.type = null; 41 + this.type = null;
42 - this.deviceIdentifier = null; 42 + this.deviceIdentifier = null;
43 - this.deviceTed = null; 43 + this.deviceTed = null;
44 - } 44 + }
45 - 45 +
46 - /** 46 + /**
47 - * Creates a network element attributed to the specified provider. 47 + * Creates a network element attributed to the specified provider.
48 - * 48 + *
49 - * @param providerId identity of the provider 49 + * @param providerId identity of the provider
50 - * @param id device identifier 50 + * @param id device identifier
51 - * @param type device type 51 + * @param type device type
52 - * @param deviceIdentifier provides device identifier details 52 + * @param deviceIdentifier provides device identifier details
53 - * @param deviceTed device traffic engineering parameters 53 + * @param deviceTed device traffic engineering parameters
54 - * @param annotations optional key/value annotations 54 + * @param annotations optional key/value annotations
55 - */ 55 + */
56 - public DefaultIpDevice(ProviderId providerId, DeviceId id, Type type, 56 + public DefaultIpDevice(ProviderId providerId, DeviceId id, Type type,
57 - IpDeviceIdentifier deviceIdentifier, DeviceTed deviceTed, 57 + IpDeviceIdentifier deviceIdentifier, DeviceTed deviceTed,
58 - Annotations... annotations) { 58 + Annotations... annotations) {
59 - super(providerId, id, annotations); 59 + super(providerId, id, annotations);
60 - this.type = type; 60 + this.type = type;
61 - this.deviceIdentifier = deviceIdentifier; 61 + this.deviceIdentifier = deviceIdentifier;
62 - this.deviceTed = deviceTed; 62 + this.deviceTed = deviceTed;
63 - } 63 + }
64 - 64 +
65 - @Override 65 + @Override
66 - public DeviceId id() { 66 + public DeviceId id() {
67 - return (DeviceId) id; 67 + return (DeviceId) id;
68 - } 68 + }
69 - 69 +
70 - @Override 70 + @Override
71 - public Type type() { 71 + public Type type() {
72 - return type; 72 + return type;
73 - } 73 + }
74 - 74 +
75 - @Override 75 + @Override
76 - public IpDeviceIdentifier deviceIdentifier() { 76 + public IpDeviceIdentifier deviceIdentifier() {
77 - return deviceIdentifier; 77 + return deviceIdentifier;
78 - } 78 + }
79 - 79 +
80 - @Override 80 + @Override
81 - public DeviceTed deviceTed() { 81 + public DeviceTed deviceTed() {
82 - return deviceTed; } 82 + return deviceTed; }
83 - 83 +
84 - @Override 84 + @Override
85 - public int hashCode() { 85 + public int hashCode() {
86 - return Objects.hash(type, deviceIdentifier, deviceTed); 86 + return Objects.hash(type, deviceIdentifier, deviceTed);
87 - } 87 + }
88 - 88 +
89 - @Override 89 + @Override
90 - public boolean equals(Object obj) { 90 + public boolean equals(Object obj) {
91 - if (this == obj) { 91 + if (this == obj) {
92 - return true; 92 + return true;
93 - } 93 + }
94 - 94 +
95 - if (obj instanceof DefaultIpDevice) { 95 + if (obj instanceof DefaultIpDevice) {
96 - final DefaultIpDevice other = (DefaultIpDevice) obj; 96 + final DefaultIpDevice other = (DefaultIpDevice) obj;
97 - return Objects.equals(this.id, other.id) && 97 + return Objects.equals(this.id, other.id) &&
98 - Objects.equals(this.type, other.type) && 98 + Objects.equals(this.type, other.type) &&
99 - Objects.equals(this.deviceIdentifier, other.deviceIdentifier) && 99 + Objects.equals(this.deviceIdentifier, other.deviceIdentifier) &&
100 - Objects.equals(this.deviceTed, other.deviceTed); 100 + Objects.equals(this.deviceTed, other.deviceTed);
101 - } 101 + }
102 - return false; 102 + return false;
103 - } 103 + }
104 - @Override 104 + @Override
105 - public String toString() { 105 + public String toString() {
106 - return toStringHelper(this) 106 + return toStringHelper(this)
107 - .omitNullValues() 107 + .omitNullValues()
108 - .add("id", id) 108 + .add("id", id)
109 - .add("deviceIdentifier", deviceIdentifier) 109 + .add("deviceIdentifier", deviceIdentifier)
110 - .add("deviceTed", deviceTed) 110 + .add("deviceTed", deviceTed)
111 - .toString(); 111 + .toString();
112 - } 112 + }
113 } 113 }
...\ No newline at end of file ...\ No newline at end of file
......
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.iptopology.api; 16 +package org.onosproject.iptopology.api;
17 - 17 +
18 -import org.onosproject.net.AbstractModel; 18 +import org.onosproject.net.AbstractModel;
19 -import org.onosproject.net.Annotations; 19 +import org.onosproject.net.Annotations;
20 -import org.onosproject.net.provider.ProviderId; 20 +import org.onosproject.net.provider.ProviderId;
21 - 21 +
22 -import java.util.Objects; 22 +import java.util.Objects;
23 - 23 +
24 -import static com.google.common.base.MoreObjects.toStringHelper; 24 +import static com.google.common.base.MoreObjects.toStringHelper;
25 - 25 +
26 -/** 26 +/**
27 - * This class provides Link identifier and link ted details. 27 + * This class provides Link identifier and link ted details.
28 - */ 28 + */
29 -public class DefaultIpLink extends AbstractModel implements IpLink { 29 +public class DefaultIpLink extends AbstractModel implements IpLink {
30 - 30 +
31 - private final TerminationPoint src; 31 + private final TerminationPoint src;
32 - private final TerminationPoint dst; 32 + private final TerminationPoint dst;
33 - private final IpLinkIdentifier linkIdentifier; 33 + private final IpLinkIdentifier linkIdentifier;
34 - private final LinkTed linkTed; 34 + private final LinkTed linkTed;
35 - 35 +
36 - /** 36 + /**
37 - * Constructor to initialize its parameters. 37 + * Constructor to initialize its parameters.
38 - * 38 + *
39 - * @param providerId provider identification 39 + * @param providerId provider identification
40 - * @param src link source termination point 40 + * @param src link source termination point
41 - * @param dst link destination termination point 41 + * @param dst link destination termination point
42 - * @param linkIdentifier provides link identifier details 42 + * @param linkIdentifier provides link identifier details
43 - * @param linkTed provides link traffic engineering details 43 + * @param linkTed provides link traffic engineering details
44 - * @param annotations optional key/value annotations 44 + * @param annotations optional key/value annotations
45 - */ 45 + */
46 - public DefaultIpLink(ProviderId providerId, TerminationPoint src, TerminationPoint dst, 46 + public DefaultIpLink(ProviderId providerId, TerminationPoint src, TerminationPoint dst,
47 - IpLinkIdentifier linkIdentifier, LinkTed linkTed, 47 + IpLinkIdentifier linkIdentifier, LinkTed linkTed,
48 - Annotations... annotations) { 48 + Annotations... annotations) {
49 - super(providerId, annotations); 49 + super(providerId, annotations);
50 - this.src = src; 50 + this.src = src;
51 - this.dst = dst; 51 + this.dst = dst;
52 - this.linkIdentifier = linkIdentifier; 52 + this.linkIdentifier = linkIdentifier;
53 - this.linkTed = linkTed; 53 + this.linkTed = linkTed;
54 - } 54 + }
55 - 55 +
56 - @Override 56 + @Override
57 - public TerminationPoint src() { 57 + public TerminationPoint src() {
58 - return src; 58 + return src;
59 - } 59 + }
60 - 60 +
61 - @Override 61 + @Override
62 - public TerminationPoint dst() { 62 + public TerminationPoint dst() {
63 - return dst; 63 + return dst;
64 - } 64 + }
65 - 65 +
66 - @Override 66 + @Override
67 - public IpLinkIdentifier linkIdentifier() { 67 + public IpLinkIdentifier linkIdentifier() {
68 - return linkIdentifier; 68 + return linkIdentifier;
69 - } 69 + }
70 - 70 +
71 - @Override 71 + @Override
72 - public LinkTed linkTed() { 72 + public LinkTed linkTed() {
73 - return linkTed; 73 + return linkTed;
74 - } 74 + }
75 - 75 +
76 - @Override 76 + @Override
77 - public int hashCode() { 77 + public int hashCode() {
78 - return Objects.hash(src, dst, linkIdentifier, linkTed); 78 + return Objects.hash(src, dst, linkIdentifier, linkTed);
79 - } 79 + }
80 - 80 +
81 - @Override 81 + @Override
82 - public boolean equals(Object obj) { 82 + public boolean equals(Object obj) {
83 - if (this == obj) { 83 + if (this == obj) {
84 - return true; 84 + return true;
85 - } 85 + }
86 - if (obj instanceof DefaultIpLink) { 86 + if (obj instanceof DefaultIpLink) {
87 - final DefaultIpLink other = (DefaultIpLink) obj; 87 + final DefaultIpLink other = (DefaultIpLink) obj;
88 - return Objects.equals(this.src, other.src) && 88 + return Objects.equals(this.src, other.src) &&
89 - Objects.equals(this.dst, other.dst) && 89 + Objects.equals(this.dst, other.dst) &&
90 - Objects.equals(this.linkIdentifier, other.linkIdentifier) && 90 + Objects.equals(this.linkIdentifier, other.linkIdentifier) &&
91 - Objects.equals(this.linkTed, other.linkTed); 91 + Objects.equals(this.linkTed, other.linkTed);
92 - } 92 + }
93 - return false; 93 + return false;
94 - } 94 + }
95 - 95 +
96 - @Override 96 + @Override
97 - public String toString() { 97 + public String toString() {
98 - return toStringHelper(this) 98 + return toStringHelper(this)
99 - .omitNullValues() 99 + .omitNullValues()
100 - .add("src", src) 100 + .add("src", src)
101 - .add("dst", dst) 101 + .add("dst", dst)
102 - .add("linkIdentifier", linkIdentifier) 102 + .add("linkIdentifier", linkIdentifier)
103 - .add("linkTed", linkTed) 103 + .add("linkTed", linkTed)
104 - .toString(); 104 + .toString();
105 - } 105 + }
106 } 106 }
...\ No newline at end of file ...\ No newline at end of file
......
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.iptopology.api; 16 +package org.onosproject.iptopology.api;
17 - 17 +
18 -import java.util.Objects; 18 +import java.util.Objects;
19 - 19 +
20 -import org.onlab.packet.Ip4Address; 20 +import org.onlab.packet.Ip4Address;
21 -import org.onlab.packet.Ip6Address; 21 +import org.onlab.packet.Ip6Address;
22 - 22 +
23 -import com.google.common.base.MoreObjects; 23 +import com.google.common.base.MoreObjects;
24 - 24 +
25 -/** 25 +/**
26 - * Representation of device interface. 26 + * Representation of device interface.
27 - */ 27 + */
28 -public class DeviceInterface { 28 +public class DeviceInterface {
29 - private final Ip4Address ip4Address; 29 + private final Ip4Address ip4Address;
30 - private final Ip6Address ip6Address; 30 + private final Ip6Address ip6Address;
31 - private final InterfaceIdentifier interfaceId; 31 + private final InterfaceIdentifier interfaceId;
32 - 32 +
33 - /** 33 + /**
34 - * Constructor to initialize its parameter. 34 + * Constructor to initialize its parameter.
35 - * 35 + *
36 - * @param ip4Address ipv4 interface address 36 + * @param ip4Address ipv4 interface address
37 - * @param ip6Address ipv6 interface address 37 + * @param ip6Address ipv6 interface address
38 - * @param interfaceId interface Identifier 38 + * @param interfaceId interface Identifier
39 - */ 39 + */
40 - public DeviceInterface(Ip4Address ip4Address, Ip6Address ip6Address, InterfaceIdentifier interfaceId) { 40 + public DeviceInterface(Ip4Address ip4Address, Ip6Address ip6Address, InterfaceIdentifier interfaceId) {
41 - this.ip4Address = ip4Address; 41 + this.ip4Address = ip4Address;
42 - this.ip6Address = ip6Address; 42 + this.ip6Address = ip6Address;
43 - this.interfaceId = interfaceId; 43 + this.interfaceId = interfaceId;
44 - } 44 + }
45 - 45 +
46 - /** 46 + /**
47 - * obtains ipv4 address of an interface. 47 + * obtains ipv4 address of an interface.
48 - * 48 + *
49 - * @return ipv4 interface address 49 + * @return ipv4 interface address
50 - */ 50 + */
51 - public Ip4Address ip4Address() { 51 + public Ip4Address ip4Address() {
52 - return ip4Address; 52 + return ip4Address;
53 - } 53 + }
54 - 54 +
55 - /** 55 + /**
56 - * obtains ipv6 interface address. 56 + * obtains ipv6 interface address.
57 - * 57 + *
58 - * @return ipv6 interface address 58 + * @return ipv6 interface address
59 - */ 59 + */
60 - public Ip6Address ip6Address() { 60 + public Ip6Address ip6Address() {
61 - return ip6Address; 61 + return ip6Address;
62 - } 62 + }
63 - 63 +
64 - /** 64 + /**
65 - * obtains interface identifier. 65 + * obtains interface identifier.
66 - * 66 + *
67 - * @return interface identifier 67 + * @return interface identifier
68 - */ 68 + */
69 - public InterfaceIdentifier interfaceId() { 69 + public InterfaceIdentifier interfaceId() {
70 - return interfaceId; 70 + return interfaceId;
71 - } 71 + }
72 - 72 +
73 - @Override 73 + @Override
74 - public int hashCode() { 74 + public int hashCode() {
75 - return Objects.hash(ip4Address, ip6Address, interfaceId); 75 + return Objects.hash(ip4Address, ip6Address, interfaceId);
76 - } 76 + }
77 - 77 +
78 - @Override 78 + @Override
79 - public boolean equals(Object obj) { 79 + public boolean equals(Object obj) {
80 - if (this == obj) { 80 + if (this == obj) {
81 - return true; 81 + return true;
82 - } 82 + }
83 - if (obj instanceof DeviceInterface) { 83 + if (obj instanceof DeviceInterface) {
84 - final DeviceInterface other = (DeviceInterface) obj; 84 + final DeviceInterface other = (DeviceInterface) obj;
85 - return Objects.equals(this.ip4Address, other.ip4Address) 85 + return Objects.equals(this.ip4Address, other.ip4Address)
86 - && Objects.equals(this.ip6Address, other.ip6Address) 86 + && Objects.equals(this.ip6Address, other.ip6Address)
87 - && Objects.equals(this.interfaceId, other.interfaceId); 87 + && Objects.equals(this.interfaceId, other.interfaceId);
88 - } 88 + }
89 - return false; 89 + return false;
90 - } 90 + }
91 - 91 +
92 - @Override 92 + @Override
93 - public String toString() { 93 + public String toString() {
94 - return MoreObjects.toStringHelper(this) 94 + return MoreObjects.toStringHelper(this)
95 - .add("ip4Address", ip4Address) 95 + .add("ip4Address", ip4Address)
96 - .add("ip6Address", ip6Address) 96 + .add("ip6Address", ip6Address)
97 - .add("interfaceId", interfaceId) 97 + .add("interfaceId", interfaceId)
98 - .toString(); 98 + .toString();
99 - } 99 + }
100 } 100 }
...\ No newline at end of file ...\ No newline at end of file
......
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.iptopology.api; 16 +package org.onosproject.iptopology.api;
17 - 17 +
18 -import org.onosproject.net.Element; 18 +import org.onosproject.net.Element;
19 - 19 +
20 -/** 20 +/**
21 - * Abstraction of Device interface. 21 + * Abstraction of Device interface.
22 - */ 22 + */
23 -public interface DeviceIntf { 23 +public interface DeviceIntf {
24 - /** 24 + /**
25 - * Returns the parent network element to which this interface belongs. 25 + * Returns the parent network element to which this interface belongs.
26 - * 26 + *
27 - * @return parent network element 27 + * @return parent network element
28 - */ 28 + */
29 - Element element(); 29 + Element element();
30 - 30 +
31 - /** 31 + /**
32 - * Returns device interface details. 32 + * Returns device interface details.
33 - * 33 + *
34 - * @return device interface details 34 + * @return device interface details
35 - */ 35 + */
36 - DeviceInterface deviceInterface(); 36 + DeviceInterface deviceInterface();
37 } 37 }
...\ No newline at end of file ...\ No newline at end of file
......
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.iptopology.api; 16 +package org.onosproject.iptopology.api;
17 - 17 +
18 -import org.onosproject.net.Annotated; 18 +import org.onosproject.net.Annotated;
19 -import org.onosproject.net.Element; 19 +import org.onosproject.net.Element;
20 - 20 +
21 -/** 21 +/**
22 - * Abstraction of Device Prefix. 22 + * Abstraction of Device Prefix.
23 - */ 23 + */
24 -public interface DevicePrefix extends Annotated { 24 +public interface DevicePrefix extends Annotated {
25 - 25 +
26 - /** 26 + /**
27 - * Returns the parent network element to which this port belongs. 27 + * Returns the parent network element to which this port belongs.
28 - * 28 + *
29 - * @return parent network element 29 + * @return parent network element
30 - */ 30 + */
31 - Element element(); 31 + Element element();
32 - 32 +
33 - /** 33 + /**
34 - * Returns prefix identifier details. 34 + * Returns prefix identifier details.
35 - * 35 + *
36 - * @return prefix identifier details 36 + * @return prefix identifier details
37 - */ 37 + */
38 - PrefixIdentifier prefixIdentifier(); 38 + PrefixIdentifier prefixIdentifier();
39 - 39 +
40 - /** 40 + /**
41 - * Returns prefix Traffic engineering parameters. 41 + * Returns prefix Traffic engineering parameters.
42 - * 42 + *
43 - * @return prefix Traffic engineering parameters 43 + * @return prefix Traffic engineering parameters
44 - */ 44 + */
45 - PrefixTed prefixTed(); 45 + PrefixTed prefixTed();
46 } 46 }
...\ No newline at end of file ...\ No newline at end of file
......
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 - 16 +
17 -package org.onosproject.iptopology.api; 17 +package org.onosproject.iptopology.api;
18 - 18 +
19 -import static com.google.common.base.MoreObjects.toStringHelper; 19 +import static com.google.common.base.MoreObjects.toStringHelper;
20 - 20 +
21 -import java.util.Objects; 21 +import java.util.Objects;
22 - 22 +
23 -/** 23 +/**
24 - * Domain Identifier(32 Bit). 24 + * Domain Identifier(32 Bit).
25 - */ 25 + */
26 -public class DomainId { 26 +public class DomainId {
27 - private final int domainIdentifier; 27 + private final int domainIdentifier;
28 - 28 +
29 - /** 29 + /**
30 - * Constructor to initialize domain identifier. 30 + * Constructor to initialize domain identifier.
31 - * 31 + *
32 - * @param domainIdentifier domain identifier 32 + * @param domainIdentifier domain identifier
33 - */ 33 + */
34 - public DomainId(int domainIdentifier) { 34 + public DomainId(int domainIdentifier) {
35 - this.domainIdentifier = domainIdentifier; 35 + this.domainIdentifier = domainIdentifier;
36 - } 36 + }
37 - 37 +
38 - /** 38 + /**
39 - * Obtain domain identifier. 39 + * Obtain domain identifier.
40 - * 40 + *
41 - * @return domain identifier 41 + * @return domain identifier
42 - */ 42 + */
43 - public int domainIdentifier() { 43 + public int domainIdentifier() {
44 - return domainIdentifier; 44 + return domainIdentifier;
45 - } 45 + }
46 - 46 +
47 - @Override 47 + @Override
48 - public int hashCode() { 48 + public int hashCode() {
49 - return Objects.hash(domainIdentifier); 49 + return Objects.hash(domainIdentifier);
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 - 57 +
58 - if (obj instanceof DomainId) { 58 + if (obj instanceof DomainId) {
59 - DomainId other = (DomainId) obj; 59 + DomainId other = (DomainId) obj;
60 - return Objects.equals(domainIdentifier, other.domainIdentifier); 60 + return Objects.equals(domainIdentifier, other.domainIdentifier);
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 toStringHelper(this) 67 + return toStringHelper(this)
68 - .add("domainIdentifier", domainIdentifier) 68 + .add("domainIdentifier", domainIdentifier)
69 - .toString(); 69 + .toString();
70 - } 70 + }
71 } 71 }
...\ No newline at end of file ...\ No newline at end of file
......
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.iptopology.api; 16 +package org.onosproject.iptopology.api;
17 - 17 +
18 -import org.onosproject.net.DeviceId; 18 +import org.onosproject.net.DeviceId;
19 -import org.onosproject.net.Element; 19 +import org.onosproject.net.Element;
20 - 20 +
21 -/** 21 +/**
22 - * Abstraction of Ip Device. 22 + * Abstraction of Ip Device.
23 - */ 23 + */
24 -public interface IpDevice extends Element { 24 +public interface IpDevice extends Element {
25 - /** 25 + /**
26 - ** Enum type to store Device Type. 26 + ** Enum type to store Device Type.
27 - */ 27 + */
28 - enum Type { 28 + enum Type {
29 - /** 29 + /**
30 - * Signifies that the device is pseudo device. 30 + * Signifies that the device is pseudo device.
31 - */ 31 + */
32 - PSEUDO, 32 + PSEUDO,
33 - 33 +
34 - /** 34 + /**
35 - * Signifies that the device is non-pseudo device. 35 + * Signifies that the device is non-pseudo device.
36 - */ 36 + */
37 - NONPSEUDO; 37 + NONPSEUDO;
38 - } 38 + }
39 - 39 +
40 - /** 40 + /**
41 - * Obtains device id. 41 + * Obtains device id.
42 - * 42 + *
43 - * @return device id 43 + * @return device id
44 - */ 44 + */
45 - @Override 45 + @Override
46 - DeviceId id(); 46 + DeviceId id();
47 - 47 +
48 - /** 48 + /**
49 - * Obtains device type. 49 + * Obtains device type.
50 - * 50 + *
51 - * @return device type 51 + * @return device type
52 - */ 52 + */
53 - Type type(); 53 + Type type();
54 - 54 +
55 - /** 55 + /**
56 - * Obtains Device identifier details. 56 + * Obtains Device identifier details.
57 - * 57 + *
58 - * @return identifier of the device 58 + * @return identifier of the device
59 - */ 59 + */
60 - IpDeviceIdentifier deviceIdentifier(); 60 + IpDeviceIdentifier deviceIdentifier();
61 - 61 +
62 - /** 62 + /**
63 - * Obtains the traffic engineering parameters of the device. 63 + * Obtains the traffic engineering parameters of the device.
64 - * 64 + *
65 - * @return traffic engineering parameters of the device 65 + * @return traffic engineering parameters of the device
66 - */ 66 + */
67 - DeviceTed deviceTed(); 67 + DeviceTed deviceTed();
68 } 68 }
...\ No newline at end of file ...\ No newline at end of file
......
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.iptopology.api; 16 +package org.onosproject.iptopology.api;
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 -/** 22 +/**
23 - * Represents IP Device Identifiers. 23 + * Represents IP Device Identifiers.
24 - */ 24 + */
25 -public class IpDeviceIdentifier { 25 +public class IpDeviceIdentifier {
26 - 26 +
27 - private final RouteDistinguisher routeDish; 27 + private final RouteDistinguisher routeDish;
28 - private final RouteInstance routeInstance; 28 + private final RouteInstance routeInstance;
29 - private final AsNumber asNum; 29 + private final AsNumber asNum;
30 - private final DomainId domainIdentifier; 30 + private final DomainId domainIdentifier;
31 - private final AreaId areaId; 31 + private final AreaId areaId;
32 - private final RouteIdentifier routerIdentifier; 32 + private final RouteIdentifier routerIdentifier;
33 - 33 +
34 - /** 34 + /**
35 - * Constructor to initialize parameters. 35 + * Constructor to initialize parameters.
36 - * 36 + *
37 - * @param routeDish routing distinguisher instance 37 + * @param routeDish routing distinguisher instance
38 - * @param routeInstance routing protocol instance 38 + * @param routeInstance routing protocol instance
39 - * @param asNum AS number 39 + * @param asNum AS number
40 - * @param domainIdentifier BGP-LS domain 40 + * @param domainIdentifier BGP-LS domain
41 - * @param areaId Area ID 41 + * @param areaId Area ID
42 - * @param routerIdentifier IGP router ID 42 + * @param routerIdentifier IGP router ID
43 - */ 43 + */
44 - public IpDeviceIdentifier(RouteDistinguisher routeDish, RouteInstance routeInstance, AsNumber asNum, 44 + public IpDeviceIdentifier(RouteDistinguisher routeDish, RouteInstance routeInstance, AsNumber asNum,
45 - DomainId domainIdentifier, AreaId areaId, RouteIdentifier routerIdentifier) { 45 + DomainId domainIdentifier, AreaId areaId, RouteIdentifier routerIdentifier) {
46 - this.routeDish = routeDish; 46 + this.routeDish = routeDish;
47 - this.areaId = areaId; 47 + this.areaId = areaId;
48 - this.asNum = asNum; 48 + this.asNum = asNum;
49 - this.domainIdentifier = domainIdentifier; 49 + this.domainIdentifier = domainIdentifier;
50 - this.routeInstance = routeInstance; 50 + this.routeInstance = routeInstance;
51 - this.routerIdentifier = routerIdentifier; 51 + this.routerIdentifier = routerIdentifier;
52 - } 52 + }
53 - 53 +
54 - /** 54 + /**
55 - * Obtains Route Distinguisher of Ip Device. 55 + * Obtains Route Distinguisher of Ip Device.
56 - * 56 + *
57 - * @return Area ID 57 + * @return Area ID
58 - */ 58 + */
59 - public RouteDistinguisher routeDish() { 59 + public RouteDistinguisher routeDish() {
60 - return routeDish; 60 + return routeDish;
61 - } 61 + }
62 - 62 +
63 - /** 63 + /**
64 - * Obtains Area ID if Ip Device. 64 + * Obtains Area ID if Ip Device.
65 - * 65 + *
66 - * @return Area ID 66 + * @return Area ID
67 - */ 67 + */
68 - public AreaId areaId() { 68 + public AreaId areaId() {
69 - return areaId; 69 + return areaId;
70 - } 70 + }
71 - 71 +
72 - /** 72 + /**
73 - * Obtains AS number of Ip Device. 73 + * Obtains AS number of Ip Device.
74 - * 74 + *
75 - * @return AS number 75 + * @return AS number
76 - */ 76 + */
77 - public AsNumber asNum() { 77 + public AsNumber asNum() {
78 - return asNum; 78 + return asNum;
79 - } 79 + }
80 - 80 +
81 - /** 81 + /**
82 - * Obtains domain identifier of Ip Device. 82 + * Obtains domain identifier of Ip Device.
83 - * 83 + *
84 - * @return domain identifier 84 + * @return domain identifier
85 - */ 85 + */
86 - public DomainId domainIdentifier() { 86 + public DomainId domainIdentifier() {
87 - return domainIdentifier; 87 + return domainIdentifier;
88 - } 88 + }
89 - 89 +
90 - /** 90 + /**
91 - * Obtains Router id of Ip Device. 91 + * Obtains Router id of Ip Device.
92 - * 92 + *
93 - * @return Router id 93 + * @return Router id
94 - */ 94 + */
95 - public RouteIdentifier routerIdentifier() { 95 + public RouteIdentifier routerIdentifier() {
96 - return routerIdentifier; 96 + return routerIdentifier;
97 - } 97 + }
98 - 98 +
99 - /** 99 + /**
100 - * Obtains routing protocol instance. 100 + * Obtains routing protocol instance.
101 - * 101 + *
102 - * @return routing protocol instance 102 + * @return routing protocol instance
103 - */ 103 + */
104 - public RouteInstance routeInstance() { 104 + public RouteInstance routeInstance() {
105 - return routeInstance; 105 + return routeInstance;
106 - } 106 + }
107 - 107 +
108 - @Override 108 + @Override
109 - public int hashCode() { 109 + public int hashCode() {
110 - return Objects.hash(routeDish, areaId, asNum, domainIdentifier, routerIdentifier, routeInstance); 110 + return Objects.hash(routeDish, areaId, asNum, domainIdentifier, routerIdentifier, routeInstance);
111 - } 111 + }
112 - 112 +
113 - @Override 113 + @Override
114 - public boolean equals(Object obj) { 114 + public boolean equals(Object obj) {
115 - if (this == obj) { 115 + if (this == obj) {
116 - return true; 116 + return true;
117 - } 117 + }
118 - 118 +
119 - if (obj instanceof IpDeviceIdentifier) { 119 + if (obj instanceof IpDeviceIdentifier) {
120 - IpDeviceIdentifier other = (IpDeviceIdentifier) obj; 120 + IpDeviceIdentifier other = (IpDeviceIdentifier) obj;
121 - return Objects.equals(areaId, other.areaId) && Objects.equals(asNum, other.asNum) 121 + return Objects.equals(areaId, other.areaId) && Objects.equals(asNum, other.asNum)
122 - && Objects.equals(domainIdentifier, other.domainIdentifier) 122 + && Objects.equals(domainIdentifier, other.domainIdentifier)
123 - && Objects.equals(routerIdentifier, other.routerIdentifier) 123 + && Objects.equals(routerIdentifier, other.routerIdentifier)
124 - && Objects.equals(routeInstance, other.routeInstance) 124 + && Objects.equals(routeInstance, other.routeInstance)
125 - && Objects.equals(routeDish, other.routeDish); 125 + && Objects.equals(routeDish, other.routeDish);
126 - } 126 + }
127 - return false; 127 + return false;
128 - } 128 + }
129 - 129 +
130 - @Override 130 + @Override
131 - public String toString() { 131 + public String toString() {
132 - return toStringHelper(this) 132 + return toStringHelper(this)
133 - .omitNullValues() 133 + .omitNullValues()
134 - .add("areaId", areaId) 134 + .add("areaId", areaId)
135 - .add("asNum", asNum) 135 + .add("asNum", asNum)
136 - .add("domainIdentifier", domainIdentifier) 136 + .add("domainIdentifier", domainIdentifier)
137 - .add("routerIdentifier", routerIdentifier) 137 + .add("routerIdentifier", routerIdentifier)
138 - .add("routeInstance", routeInstance) 138 + .add("routeInstance", routeInstance)
139 - .add("routeDish", routeDish) 139 + .add("routeDish", routeDish)
140 - .toString(); 140 + .toString();
141 - } 141 + }
142 } 142 }
...\ No newline at end of file ...\ No newline at end of file
......
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.iptopology.api; 16 +package org.onosproject.iptopology.api;
17 - 17 +
18 -import org.onosproject.net.Annotated; 18 +import org.onosproject.net.Annotated;
19 -import org.onosproject.net.NetworkResource; 19 +import org.onosproject.net.NetworkResource;
20 -import org.onosproject.net.Provided; 20 +import org.onosproject.net.Provided;
21 - 21 +
22 -/** 22 +/**
23 - * Abstraction of a network ip link. 23 + * Abstraction of a network ip link.
24 - */ 24 + */
25 -public interface IpLink extends Annotated, Provided, NetworkResource { 25 +public interface IpLink extends Annotated, Provided, NetworkResource {
26 - 26 +
27 - /** 27 + /**
28 - * Returns source termination point of link. 28 + * Returns source termination point of link.
29 - * 29 + *
30 - * @return source termination point of link 30 + * @return source termination point of link
31 - */ 31 + */
32 - TerminationPoint src(); 32 + TerminationPoint src();
33 - 33 +
34 - /** 34 + /**
35 - * Returns destination termination point of link. 35 + * Returns destination termination point of link.
36 - * 36 + *
37 - * @return destination termination point of link 37 + * @return destination termination point of link
38 - */ 38 + */
39 - TerminationPoint dst(); 39 + TerminationPoint dst();
40 - 40 +
41 - /** 41 + /**
42 - * Returns link identifier details. 42 + * Returns link identifier details.
43 - * 43 + *
44 - * @return link identifier details 44 + * @return link identifier details
45 - */ 45 + */
46 - IpLinkIdentifier linkIdentifier(); 46 + IpLinkIdentifier linkIdentifier();
47 - 47 +
48 - /** 48 + /**
49 - * Returns the link traffic engineering parameters. 49 + * Returns the link traffic engineering parameters.
50 - * 50 + *
51 - * @return links traffic engineering parameters 51 + * @return links traffic engineering parameters
52 - */ 52 + */
53 - LinkTed linkTed(); 53 + LinkTed linkTed();
54 } 54 }
...\ No newline at end of file ...\ No newline at end of file
......
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.iptopology.api; 16 +package org.onosproject.iptopology.api;
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 -/** 22 +/**
23 - * This class provides Prefix Identifier details. 23 + * This class provides Prefix Identifier details.
24 - */ 24 + */
25 -public class PrefixIdentifier { 25 +public class PrefixIdentifier {
26 - private final TopologyId topologyId; 26 + private final TopologyId topologyId;
27 - private final RouteType routeType; 27 + private final RouteType routeType;
28 - private final IpReachability ipReach; 28 + private final IpReachability ipReach;
29 - 29 +
30 - /** 30 + /**
31 - * Constructor to initialize its parameters. 31 + * Constructor to initialize its parameters.
32 - * 32 + *
33 - * @param topologyId topology ID of prefix 33 + * @param topologyId topology ID of prefix
34 - * @param routeType OSPF Route type of the prefix 34 + * @param routeType OSPF Route type of the prefix
35 - * @param ipReach IP address prefix reachability information 35 + * @param ipReach IP address prefix reachability information
36 - */ 36 + */
37 - public PrefixIdentifier(TopologyId topologyId, RouteType routeType, IpReachability ipReach) { 37 + public PrefixIdentifier(TopologyId topologyId, RouteType routeType, IpReachability ipReach) {
38 - this.topologyId = topologyId; 38 + this.topologyId = topologyId;
39 - this.routeType = routeType; 39 + this.routeType = routeType;
40 - this.ipReach = ipReach; 40 + this.ipReach = ipReach;
41 - } 41 + }
42 - 42 +
43 - /** 43 + /**
44 - * Provides topology ID of prefix. 44 + * Provides topology ID of prefix.
45 - * 45 + *
46 - * @return topology id 46 + * @return topology id
47 - */ 47 + */
48 - public TopologyId topologyId() { 48 + public TopologyId topologyId() {
49 - return this.topologyId; 49 + return this.topologyId;
50 - } 50 + }
51 - 51 +
52 - /** 52 + /**
53 - * Provides IP address prefix reachability information. 53 + * Provides IP address prefix reachability information.
54 - * 54 + *
55 - * @return IP address prefix 55 + * @return IP address prefix
56 - */ 56 + */
57 - public IpReachability ipReach() { 57 + public IpReachability ipReach() {
58 - return this.ipReach; 58 + return this.ipReach;
59 - } 59 + }
60 - 60 +
61 - /** 61 + /**
62 - * Provides OSPF Route type of the prefix. 62 + * Provides OSPF Route type of the prefix.
63 - * 63 + *
64 - * @return Route type 64 + * @return Route type
65 - */ 65 + */
66 - public RouteType routeType() { 66 + public RouteType routeType() {
67 - return this.routeType; 67 + return this.routeType;
68 - } 68 + }
69 - 69 +
70 - @Override 70 + @Override
71 - public int hashCode() { 71 + public int hashCode() {
72 - return Objects.hash(topologyId, routeType, ipReach); 72 + return Objects.hash(topologyId, routeType, ipReach);
73 - } 73 + }
74 - 74 +
75 - @Override 75 + @Override
76 - public boolean equals(Object obj) { 76 + public boolean equals(Object obj) {
77 - if (this == obj) { 77 + if (this == obj) {
78 - return true; 78 + return true;
79 - } 79 + }
80 - 80 +
81 - if (obj instanceof PrefixIdentifier) { 81 + if (obj instanceof PrefixIdentifier) {
82 - PrefixIdentifier other = (PrefixIdentifier) obj; 82 + PrefixIdentifier other = (PrefixIdentifier) obj;
83 - return Objects.equals(topologyId, other.topologyId) && Objects.equals(routeType, other.routeType) 83 + return Objects.equals(topologyId, other.topologyId) && Objects.equals(routeType, other.routeType)
84 - && Objects.equals(ipReach, other.ipReach); 84 + && Objects.equals(ipReach, other.ipReach);
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) 91 + return toStringHelper(this)
92 - .omitNullValues() 92 + .omitNullValues()
93 - .add("routeType", routeType) 93 + .add("routeType", routeType)
94 - .add("ipReach", ipReach) 94 + .add("ipReach", ipReach)
95 - .add("topologyId", topologyId) 95 + .add("topologyId", topologyId)
96 - .toString(); 96 + .toString();
97 - } 97 + }
98 } 98 }
...\ No newline at end of file ...\ No newline at end of file
......
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.iptopology.api; 16 +package org.onosproject.iptopology.api;
17 - 17 +
18 -import java.util.Objects; 18 +import java.util.Objects;
19 - 19 +
20 -import org.onosproject.net.DeviceId; 20 +import org.onosproject.net.DeviceId;
21 -import org.onosproject.net.ElementId; 21 +import org.onosproject.net.ElementId;
22 - 22 +
23 -import com.google.common.base.MoreObjects; 23 +import com.google.common.base.MoreObjects;
24 - 24 +
25 -/** 25 +/**
26 - * Abstraction of a network termination point expressed as a pair of the network element identifier and device 26 + * Abstraction of a network termination point expressed as a pair of the network element identifier and device
27 - * interface. 27 + * interface.
28 - */ 28 + */
29 -public class TerminationPoint { 29 +public class TerminationPoint {
30 - private final ElementId elementId; 30 + private final ElementId elementId;
31 - private final DeviceInterface deviceInterface; 31 + private final DeviceInterface deviceInterface;
32 - 32 +
33 - /** 33 + /**
34 - * Constructor to initialize its parameters. 34 + * Constructor to initialize its parameters.
35 - * 35 + *
36 - * @param elementId network element identifier 36 + * @param elementId network element identifier
37 - * @param deviceInterface device interface 37 + * @param deviceInterface device interface
38 - */ 38 + */
39 - public TerminationPoint(ElementId elementId, DeviceInterface deviceInterface) { 39 + public TerminationPoint(ElementId elementId, DeviceInterface deviceInterface) {
40 - this.elementId = elementId; 40 + this.elementId = elementId;
41 - this.deviceInterface = deviceInterface; 41 + this.deviceInterface = deviceInterface;
42 - } 42 + }
43 - 43 +
44 - /** 44 + /**
45 - * Returns the network element identifier. 45 + * Returns the network element identifier.
46 - * 46 + *
47 - * @return element identifier 47 + * @return element identifier
48 - */ 48 + */
49 - public ElementId elementId() { 49 + public ElementId elementId() {
50 - return elementId; 50 + return elementId;
51 - } 51 + }
52 - 52 +
53 - /** 53 + /**
54 - * Returns the identifier of the infrastructure device if the termination 54 + * Returns the identifier of the infrastructure device if the termination
55 - * point belongs to a network element which is indeed an ip 55 + * point belongs to a network element which is indeed an ip
56 - * device. 56 + * device.
57 - * 57 + *
58 - * @return network element identifier as a device identifier 58 + * @return network element identifier as a device identifier
59 - * @throws java.lang.IllegalStateException if termination point is not 59 + * @throws java.lang.IllegalStateException if termination point is not
60 - * associated with a device 60 + * associated with a device
61 - */ 61 + */
62 - public DeviceId deviceId() { 62 + public DeviceId deviceId() {
63 - if (elementId instanceof DeviceId) { 63 + if (elementId instanceof DeviceId) {
64 - return (DeviceId) elementId; 64 + return (DeviceId) elementId;
65 - } 65 + }
66 - throw new IllegalStateException("Termination point not associated " + 66 + throw new IllegalStateException("Termination point not associated " +
67 - "with an ip device"); 67 + "with an ip device");
68 - } 68 + }
69 - 69 +
70 - /** 70 + /**
71 - * Returns Device interface details. 71 + * Returns Device interface details.
72 - * 72 + *
73 - * @return device interface details 73 + * @return device interface details
74 - */ 74 + */
75 - public DeviceInterface deviceInterface() { 75 + public DeviceInterface deviceInterface() {
76 - return deviceInterface; 76 + return deviceInterface;
77 - } 77 + }
78 - 78 +
79 - @Override 79 + @Override
80 - public int hashCode() { 80 + public int hashCode() {
81 - return Objects.hash(elementId, deviceInterface); 81 + return Objects.hash(elementId, deviceInterface);
82 - } 82 + }
83 - 83 +
84 - @Override 84 + @Override
85 - public boolean equals(Object obj) { 85 + public boolean equals(Object obj) {
86 - if (this == obj) { 86 + if (this == obj) {
87 - return true; 87 + return true;
88 - } 88 + }
89 - if (obj instanceof TerminationPoint) { 89 + if (obj instanceof TerminationPoint) {
90 - final TerminationPoint other = (TerminationPoint) obj; 90 + final TerminationPoint other = (TerminationPoint) obj;
91 - return Objects.equals(this.elementId, other.elementId) 91 + return Objects.equals(this.elementId, other.elementId)
92 - && Objects.equals(this.deviceInterface, other.deviceInterface); 92 + && Objects.equals(this.deviceInterface, other.deviceInterface);
93 - } 93 + }
94 - return false; 94 + return false;
95 - } 95 + }
96 - 96 +
97 - @Override 97 + @Override
98 - public String toString() { 98 + public String toString() {
99 - return MoreObjects.toStringHelper(this) 99 + return MoreObjects.toStringHelper(this)
100 - .add("elementId", elementId) 100 + .add("elementId", elementId)
101 - .add("deviceInterface", deviceInterface) 101 + .add("deviceInterface", deviceInterface)
102 - .toString(); 102 + .toString();
103 - } 103 + }
104 } 104 }
...\ No newline at end of file ...\ No newline at end of file
......
1 -/* 1 +/*
2 - * Copyright 2014-2015 Open Networking Laboratory 2 + * Copyright 2014-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.mfwd.cli; 16 +package org.onosproject.mfwd.cli;
17 - 17 +
18 -import org.apache.felix.scr.annotations.Reference; 18 +import org.apache.felix.scr.annotations.Reference;
19 -import org.apache.felix.scr.annotations.ReferenceCardinality; 19 +import org.apache.felix.scr.annotations.ReferenceCardinality;
20 -import org.apache.karaf.shell.commands.Argument; 20 +import org.apache.karaf.shell.commands.Argument;
21 -import org.apache.karaf.shell.commands.Command; 21 +import org.apache.karaf.shell.commands.Command;
22 -import org.onosproject.cli.AbstractShellCommand; 22 +import org.onosproject.cli.AbstractShellCommand;
23 -import org.onosproject.mfwd.impl.McastForwarding; 23 +import org.onosproject.mfwd.impl.McastForwarding;
24 -import org.onosproject.net.ConnectPoint; 24 +import org.onosproject.net.ConnectPoint;
25 -import org.onosproject.net.mcast.McastRoute; 25 +import org.onosproject.net.mcast.McastRoute;
26 -import org.onosproject.net.mcast.MulticastRouteService; 26 +import org.onosproject.net.mcast.MulticastRouteService;
27 - 27 +
28 -/** 28 +/**
29 - * Installs a source, multicast group flow. 29 + * Installs a source, multicast group flow.
30 - */ 30 + */
31 -@Command(scope = "onos", name = "mcast-join", 31 +@Command(scope = "onos", name = "mcast-join",
32 - description = "Installs a source, multicast group flow") 32 + description = "Installs a source, multicast group flow")
33 -public class McastJoinCommand extends AbstractShellCommand { 33 +public class McastJoinCommand extends AbstractShellCommand {
34 - 34 +
35 - @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) 35 + @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
36 - MulticastRouteService mcastRouteManager = AbstractShellCommand.get(MulticastRouteService.class); 36 + MulticastRouteService mcastRouteManager = AbstractShellCommand.get(MulticastRouteService.class);
37 - 37 +
38 - @Argument(index = 0, name = "sAddr", 38 + @Argument(index = 0, name = "sAddr",
39 - description = "IP Address of the multicast source. '*' can be used for any source (*, G) entry", 39 + description = "IP Address of the multicast source. '*' can be used for any source (*, G) entry",
40 - required = true, multiValued = false) 40 + required = true, multiValued = false)
41 - String sAddr = null; 41 + String sAddr = null;
42 - 42 +
43 - @Argument(index = 1, name = "gAddr", 43 + @Argument(index = 1, name = "gAddr",
44 - description = "IP Address of the multicast group", 44 + description = "IP Address of the multicast group",
45 - required = true, multiValued = false) 45 + required = true, multiValued = false)
46 - String gAddr = null; 46 + String gAddr = null;
47 - 47 +
48 - @Argument(index = 2, name = "ingressPort", 48 + @Argument(index = 2, name = "ingressPort",
49 - description = "Ingress port of:XXXXXXXXXX/XX", 49 + description = "Ingress port of:XXXXXXXXXX/XX",
50 - required = false, multiValued = false) 50 + required = false, multiValued = false)
51 - String ingressPort = null; 51 + String ingressPort = null;
52 - 52 +
53 - @Argument(index = 3, name = "ports", 53 + @Argument(index = 3, name = "ports",
54 - description = "Egress ports of:XXXXXXXXXX/XX...", 54 + description = "Egress ports of:XXXXXXXXXX/XX...",
55 - required = false, multiValued = true) 55 + required = false, multiValued = true)
56 - String[] ports = null; 56 + String[] ports = null;
57 - 57 +
58 - @Override 58 + @Override
59 - protected void execute() { 59 + protected void execute() {
60 - 60 +
61 - McastRoute mRoute = McastForwarding.createStaticRoute(sAddr, gAddr); 61 + McastRoute mRoute = McastForwarding.createStaticRoute(sAddr, gAddr);
62 - mcastRouteManager.add(mRoute); 62 + mcastRouteManager.add(mRoute);
63 - 63 +
64 - ConnectPoint ingress = ConnectPoint.deviceConnectPoint(ingressPort); 64 + ConnectPoint ingress = ConnectPoint.deviceConnectPoint(ingressPort);
65 - mcastRouteManager.addSource(mRoute, ingress); 65 + mcastRouteManager.addSource(mRoute, ingress);
66 - 66 +
67 - for (String egCP : ports) { 67 + for (String egCP : ports) {
68 - log.debug("Egress port provided: " + egCP); 68 + log.debug("Egress port provided: " + egCP);
69 - ConnectPoint egress = ConnectPoint.deviceConnectPoint(egCP); 69 + ConnectPoint egress = ConnectPoint.deviceConnectPoint(egCP);
70 - mcastRouteManager.addSink(mRoute, egress); 70 + mcastRouteManager.addSink(mRoute, egress);
71 - 71 +
72 - } 72 + }
73 - print("Added the mcast route"); 73 + print("Added the mcast route");
74 - } 74 + }
75 -} 75 +}
......
1 -/** 1 +/**
2 - * Sample Multicast forwarding framework using intents. 2 + * Sample Multicast forwarding framework using intents.
3 - */ 3 + */
4 -package org.onosproject.mfwd.cli; 4 +package org.onosproject.mfwd.cli;
5 - 5 +
......
1 -/* 1 +/*
2 - * Copyright 2015 Open Networking Laboratory 2 + * Copyright 2015 Open Networking Laboratory
3 - * 3 + *
4 - * Licensed under the Apache License, Version 2.0 (the "License"); 4 + * Licensed under the Apache License, Version 2.0 (the "License");
5 - * you may not use this file except in compliance with the License. 5 + * you may not use this file except in compliance with the License.
6 - * You may obtain a copy of the License at 6 + * You may obtain a copy of the License at
7 - * 7 + *
8 - * http://www.apache.org/licenses/LICENSE-2.0 8 + * http://www.apache.org/licenses/LICENSE-2.0
9 - * 9 + *
10 - * Unless required by applicable law or agreed to in writing, software 10 + * Unless required by applicable law or agreed to in writing, software
11 - * distributed under the License is distributed on an "AS IS" BASIS, 11 + * distributed under the License is distributed on an "AS IS" BASIS,
12 - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 - * See the License for the specific language governing permissions and 13 + * See the License for the specific language governing permissions and
14 - * limitations under the License. 14 + * limitations under the License.
15 - */ 15 + */
16 -package org.onosproject.vtnrsc; 16 +package org.onosproject.vtnrsc;
17 - 17 +
18 -import java.util.List; 18 +import java.util.List;
19 - 19 +
20 -/** 20 +/**
21 - * Representation of a Router. 21 + * Representation of a Router.
22 - */ 22 + */
23 -public interface Router { 23 +public interface Router {
24 - 24 +
25 - /** 25 + /**
26 - * Coarse classification of the type of the Router. 26 + * Coarse classification of the type of the Router.
27 - */ 27 + */
28 - public enum Status { 28 + public enum Status {
29 - /** 29 + /**
30 - * Signifies that a router is currently active. 30 + * Signifies that a router is currently active.
31 - */ 31 + */
32 - ACTIVE, 32 + ACTIVE,
33 - /** 33 + /**
34 - * Signifies that a router is currently inactive. 34 + * Signifies that a router is currently inactive.
35 - */ 35 + */
36 - INACTIVE 36 + INACTIVE
37 - } 37 + }
38 - 38 +
39 - /** 39 + /**
40 - * Returns the router identifier. 40 + * Returns the router identifier.
41 - * 41 + *
42 - * @return identifier 42 + * @return identifier
43 - */ 43 + */
44 - RouterId id(); 44 + RouterId id();
45 - 45 +
46 - /** 46 + /**
47 - * Returns the router Name. 47 + * Returns the router Name.
48 - * 48 + *
49 - * @return routerName 49 + * @return routerName
50 - */ 50 + */
51 - String name(); 51 + String name();
52 - 52 +
53 - /** 53 + /**
54 - * Returns the router admin state. 54 + * Returns the router admin state.
55 - * 55 + *
56 - * @return true or false 56 + * @return true or false
57 - */ 57 + */
58 - boolean adminStateUp(); 58 + boolean adminStateUp();
59 - 59 +
60 - /** 60 + /**
61 - * Returns the status of router. 61 + * Returns the status of router.
62 - * 62 + *
63 - * @return RouterStatus 63 + * @return RouterStatus
64 - */ 64 + */
65 - Status status(); 65 + Status status();
66 - 66 +
67 - /** 67 + /**
68 - * Returns the distributed status of this router. 68 + * Returns the distributed status of this router.
69 - * If true, indicates a distributed router. 69 + * If true, indicates a distributed router.
70 - * 70 + *
71 - * @return true or false 71 + * @return true or false
72 - */ 72 + */
73 - boolean distributed(); 73 + boolean distributed();
74 - 74 +
75 - /** 75 + /**
76 - * Returns the RouterGateway of router. 76 + * Returns the RouterGateway of router.
77 - * 77 + *
78 - * @return routerGateway 78 + * @return routerGateway
79 - */ 79 + */
80 - RouterGateway externalGatewayInfo(); 80 + RouterGateway externalGatewayInfo();
81 - 81 +
82 - /** 82 + /**
83 - * Returns the gatewayPortid of router. 83 + * Returns the gatewayPortid of router.
84 - * 84 + *
85 - * @return virtualPortId 85 + * @return virtualPortId
86 - */ 86 + */
87 - VirtualPortId gatewayPortid(); 87 + VirtualPortId gatewayPortid();
88 - 88 +
89 - /** 89 + /**
90 - * Returns the owner(tenant) of this router. 90 + * Returns the owner(tenant) of this router.
91 - * 91 + *
92 - * @return tenantId 92 + * @return tenantId
93 - */ 93 + */
94 - TenantId tenantId(); 94 + TenantId tenantId();
95 - 95 +
96 - /** 96 + /**
97 - * Returns the router list of router. 97 + * Returns the router list of router.
98 - * 98 + *
99 - * @return routes 99 + * @return routes
100 - */ 100 + */
101 - List<String> routes(); 101 + List<String> routes();
102 -} 102 +}
......
1 -/* 1 +/*
2 - * Copyright 2015 Open Networking Laboratory 2 + * Copyright 2015 Open Networking Laboratory
3 - * 3 + *
4 - * Licensed under the Apache License, Version 2.0 (the "License"); 4 + * Licensed under the Apache License, Version 2.0 (the "License");
5 - * you may not use this file except in compliance with the License. 5 + * you may not use this file except in compliance with the License.
6 - * You may obtain a copy of the License at 6 + * You may obtain a copy of the License at
7 - * 7 + *
8 - * http://www.apache.org/licenses/LICENSE-2.0 8 + * http://www.apache.org/licenses/LICENSE-2.0
9 - * 9 + *
10 - * Unless required by applicable law or agreed to in writing, software 10 + * Unless required by applicable law or agreed to in writing, software
11 - * distributed under the License is distributed on an "AS IS" BASIS, 11 + * distributed under the License is distributed on an "AS IS" BASIS,
12 - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 - * See the License for the specific language governing permissions and 13 + * See the License for the specific language governing permissions and
14 - * limitations under the License. 14 + * limitations under the License.
15 - */ 15 + */
16 -package org.onosproject.vtnrsc; 16 +package org.onosproject.vtnrsc;
17 - 17 +
18 -import static com.google.common.base.MoreObjects.toStringHelper; 18 +import static com.google.common.base.MoreObjects.toStringHelper;
19 -import static com.google.common.base.Preconditions.checkNotNull; 19 +import static com.google.common.base.Preconditions.checkNotNull;
20 - 20 +
21 -import java.util.Collection; 21 +import java.util.Collection;
22 -import java.util.Objects; 22 +import java.util.Objects;
23 - 23 +
24 -/** 24 +/**
25 - * Representation of a Router gateway. 25 + * Representation of a Router gateway.
26 - */ 26 + */
27 -public final class RouterGateway { 27 +public final class RouterGateway {
28 - 28 +
29 - private final TenantNetworkId networkId; 29 + private final TenantNetworkId networkId;
30 - private final boolean enableSnat; 30 + private final boolean enableSnat;
31 - private final Collection<FixedIp> externalFixedIps; 31 + private final Collection<FixedIp> externalFixedIps;
32 - 32 +
33 - // Public construction is prohibited 33 + // Public construction is prohibited
34 - private RouterGateway(TenantNetworkId networkId, boolean enableSnat, 34 + private RouterGateway(TenantNetworkId networkId, boolean enableSnat,
35 - Collection<FixedIp> externalFixedIps) { 35 + Collection<FixedIp> externalFixedIps) {
36 - this.networkId = checkNotNull(networkId, "networkId cannot be null"); 36 + this.networkId = checkNotNull(networkId, "networkId cannot be null");
37 - this.enableSnat = checkNotNull(enableSnat, "enableSnat cannot be null"); 37 + this.enableSnat = checkNotNull(enableSnat, "enableSnat cannot be null");
38 - this.externalFixedIps = checkNotNull(externalFixedIps, "externalFixedIps cannot be null"); 38 + this.externalFixedIps = checkNotNull(externalFixedIps, "externalFixedIps cannot be null");
39 - } 39 + }
40 - 40 +
41 - /** 41 + /**
42 - * Creates router gateway object. 42 + * Creates router gateway object.
43 - * 43 + *
44 - * @param networkId network identifier 44 + * @param networkId network identifier
45 - * @param enableSnat SNAT enable or not 45 + * @param enableSnat SNAT enable or not
46 - * @param externalFixedIps external fixed IP 46 + * @param externalFixedIps external fixed IP
47 - * @return RouterGateway 47 + * @return RouterGateway
48 - */ 48 + */
49 - public static RouterGateway routerGateway(TenantNetworkId networkId, boolean enableSnat, 49 + public static RouterGateway routerGateway(TenantNetworkId networkId, boolean enableSnat,
50 - Collection<FixedIp> externalFixedIps) { 50 + Collection<FixedIp> externalFixedIps) {
51 - return new RouterGateway(networkId, enableSnat, externalFixedIps); 51 + return new RouterGateway(networkId, enableSnat, externalFixedIps);
52 - } 52 + }
53 - 53 +
54 - /** 54 + /**
55 - * Returns network identifier. 55 + * Returns network identifier.
56 - * 56 + *
57 - * @return networkId 57 + * @return networkId
58 - */ 58 + */
59 - public TenantNetworkId networkId() { 59 + public TenantNetworkId networkId() {
60 - return networkId; 60 + return networkId;
61 - } 61 + }
62 - 62 +
63 - /** 63 + /**
64 - * Return SNAT enable or not. 64 + * Return SNAT enable or not.
65 - * 65 + *
66 - * @return enableSnat 66 + * @return enableSnat
67 - */ 67 + */
68 - public boolean enableSnat() { 68 + public boolean enableSnat() {
69 - return enableSnat; 69 + return enableSnat;
70 - } 70 + }
71 - 71 +
72 - /** 72 + /**
73 - * Return external fixed Ip. 73 + * Return external fixed Ip.
74 - * 74 + *
75 - * @return externalFixedIps 75 + * @return externalFixedIps
76 - */ 76 + */
77 - public Collection<FixedIp> externalFixedIps() { 77 + public Collection<FixedIp> externalFixedIps() {
78 - return externalFixedIps; 78 + return externalFixedIps;
79 - } 79 + }
80 - 80 +
81 - @Override 81 + @Override
82 - public int hashCode() { 82 + public int hashCode() {
83 - return Objects.hash(networkId, enableSnat, externalFixedIps); 83 + return Objects.hash(networkId, enableSnat, externalFixedIps);
84 - } 84 + }
85 - 85 +
86 - @Override 86 + @Override
87 - public boolean equals(Object obj) { 87 + public boolean equals(Object obj) {
88 - if (this == obj) { 88 + if (this == obj) {
89 - return true; 89 + return true;
90 - } 90 + }
91 - if (obj instanceof RouterGateway) { 91 + if (obj instanceof RouterGateway) {
92 - final RouterGateway that = (RouterGateway) obj; 92 + final RouterGateway that = (RouterGateway) obj;
93 - return Objects.equals(this.networkId, that.networkId) 93 + return Objects.equals(this.networkId, that.networkId)
94 - && Objects.equals(this.enableSnat, that.enableSnat) 94 + && Objects.equals(this.enableSnat, that.enableSnat)
95 - && Objects.equals(this.externalFixedIps, that.externalFixedIps); 95 + && Objects.equals(this.externalFixedIps, that.externalFixedIps);
96 - } 96 + }
97 - return false; 97 + return false;
98 - } 98 + }
99 - 99 +
100 - @Override 100 + @Override
101 - public String toString() { 101 + public String toString() {
102 - return toStringHelper(this) 102 + return toStringHelper(this)
103 - .add("networkId", networkId) 103 + .add("networkId", networkId)
104 - .add("enableSnat", enableSnat) 104 + .add("enableSnat", enableSnat)
105 - .add("externalFixedIps", externalFixedIps) 105 + .add("externalFixedIps", externalFixedIps)
106 - .toString(); 106 + .toString();
107 - } 107 + }
108 -} 108 +}
......
1 -/* 1 +/*
2 - * Copyright 2015 Open Networking Laboratory 2 + * Copyright 2015 Open Networking Laboratory
3 - * 3 + *
4 - * Licensed under the Apache License, Version 2.0 (the "License"); 4 + * Licensed under the Apache License, Version 2.0 (the "License");
5 - * you may not use this file except in compliance with the License. 5 + * you may not use this file except in compliance with the License.
6 - * You may obtain a copy of the License at 6 + * You may obtain a copy of the License at
7 - * 7 + *
8 - * http://www.apache.org/licenses/LICENSE-2.0 8 + * http://www.apache.org/licenses/LICENSE-2.0
9 - * 9 + *
10 - * Unless required by applicable law or agreed to in writing, software 10 + * Unless required by applicable law or agreed to in writing, software
11 - * distributed under the License is distributed on an "AS IS" BASIS, 11 + * distributed under the License is distributed on an "AS IS" BASIS,
12 - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 - * See the License for the specific language governing permissions and 13 + * See the License for the specific language governing permissions and
14 - * limitations under the License. 14 + * limitations under the License.
15 - */ 15 + */
16 -package org.onosproject.vtnrsc.util; 16 +package org.onosproject.vtnrsc.util;
17 - 17 +
18 -import org.onosproject.store.service.EventuallyConsistentMapBuilder; 18 +import org.onosproject.store.service.EventuallyConsistentMapBuilder;
19 -import org.onosproject.store.service.ConsistentMapBuilder; 19 +import org.onosproject.store.service.ConsistentMapBuilder;
20 -import org.onosproject.store.service.DistributedSetBuilder; 20 +import org.onosproject.store.service.DistributedSetBuilder;
21 -import org.onosproject.store.service.DistributedQueueBuilder; 21 +import org.onosproject.store.service.DistributedQueueBuilder;
22 -import org.onosproject.store.service.AtomicCounterBuilder; 22 +import org.onosproject.store.service.AtomicCounterBuilder;
23 -import org.onosproject.store.service.AtomicValueBuilder; 23 +import org.onosproject.store.service.AtomicValueBuilder;
24 -import org.onosproject.store.service.TransactionContextBuilder; 24 +import org.onosproject.store.service.TransactionContextBuilder;
25 -import org.onosproject.store.service.StorageService; 25 +import org.onosproject.store.service.StorageService;
26 - 26 +
27 -/** 27 +/**
28 - * Adapter for the storage service. 28 + * Adapter for the storage service.
29 - */ 29 + */
30 -public class VtnStorageServiceAdapter implements StorageService { 30 +public class VtnStorageServiceAdapter implements StorageService {
31 - @Override 31 + @Override
32 - public <K, V> EventuallyConsistentMapBuilder<K, V> eventuallyConsistentMapBuilder() { 32 + public <K, V> EventuallyConsistentMapBuilder<K, V> eventuallyConsistentMapBuilder() {
33 - return null; 33 + return null;
34 - } 34 + }
35 - 35 +
36 - @Override 36 + @Override
37 - public <K, V> ConsistentMapBuilder<K, V> consistentMapBuilder() { 37 + public <K, V> ConsistentMapBuilder<K, V> consistentMapBuilder() {
38 - return null; 38 + return null;
39 - } 39 + }
40 - 40 +
41 - @Override 41 + @Override
42 - public <E> DistributedSetBuilder<E> setBuilder() { 42 + public <E> DistributedSetBuilder<E> setBuilder() {
43 - return null; 43 + return null;
44 - } 44 + }
45 - 45 +
46 - @Override 46 + @Override
47 - public <E> DistributedQueueBuilder<E> queueBuilder() { 47 + public <E> DistributedQueueBuilder<E> queueBuilder() {
48 - return null; 48 + return null;
49 - } 49 + }
50 - 50 +
51 - @Override 51 + @Override
52 - public AtomicCounterBuilder atomicCounterBuilder() { 52 + public AtomicCounterBuilder atomicCounterBuilder() {
53 - return null; 53 + return null;
54 - } 54 + }
55 - 55 +
56 - @Override 56 + @Override
57 - public <V> AtomicValueBuilder<V> atomicValueBuilder() { 57 + public <V> AtomicValueBuilder<V> atomicValueBuilder() {
58 - return null; 58 + return null;
59 - } 59 + }
60 - 60 +
61 - @Override 61 + @Override
62 - public TransactionContextBuilder transactionContextBuilder() { 62 + public TransactionContextBuilder transactionContextBuilder() {
63 - return null; 63 + return null;
64 - } 64 + }
65 -} 65 +}
......
1 -/* 1 +/*
2 - * Copyright 2015 Open Networking Laboratory 2 + * Copyright 2015 Open Networking Laboratory
3 - * 3 + *
4 - * Licensed under the Apache License, Version 2.0 (the "License"); 4 + * Licensed under the Apache License, Version 2.0 (the "License");
5 - * you may not use this file except in compliance with the License. 5 + * you may not use this file except in compliance with the License.
6 - * You may obtain a copy of the License at 6 + * You may obtain a copy of the License at
7 - * 7 + *
8 - * http://www.apache.org/licenses/LICENSE-2.0 8 + * http://www.apache.org/licenses/LICENSE-2.0
9 - * 9 + *
10 - * Unless required by applicable law or agreed to in writing, software 10 + * Unless required by applicable law or agreed to in writing, software
11 - * distributed under the License is distributed on an "AS IS" BASIS, 11 + * distributed under the License is distributed on an "AS IS" BASIS,
12 - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 - * See the License for the specific language governing permissions and 13 + * See the License for the specific language governing permissions and
14 - * limitations under the License. 14 + * limitations under the License.
15 - */ 15 + */
16 -package org.onosproject.vtnrsc.util; 16 +package org.onosproject.vtnrsc.util;
17 - 17 +
18 -import org.onosproject.store.service.EventuallyConsistentMapBuilder; 18 +import org.onosproject.store.service.EventuallyConsistentMapBuilder;
19 - 19 +
20 -public class VtnStorageServiceTest extends VtnStorageServiceAdapter { 20 +public class VtnStorageServiceTest extends VtnStorageServiceAdapter {
21 - @Override 21 + @Override
22 - public <K, V> EventuallyConsistentMapBuilder<K, V> eventuallyConsistentMapBuilder() { 22 + public <K, V> EventuallyConsistentMapBuilder<K, V> eventuallyConsistentMapBuilder() {
23 - return VtnEventuallyConsistentMapTest.builder(); 23 + return VtnEventuallyConsistentMapTest.builder();
24 - } 24 + }
25 -} 25 +}
......
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 - 16 +
17 -package org.onosproject.net.flow; 17 +package org.onosproject.net.flow;
18 - 18 +
19 -import static com.google.common.base.MoreObjects.toStringHelper; 19 +import static com.google.common.base.MoreObjects.toStringHelper;
20 - 20 +
21 -/** 21 +/**
22 - * Default flow entry class with FlowLiveType value, IMMEDIATE_FLOW, SHORT_FLOW, MID_FLOW, LONG_FLOW. 22 + * Default flow entry class with FlowLiveType value, IMMEDIATE_FLOW, SHORT_FLOW, MID_FLOW, LONG_FLOW.
23 - */ 23 + */
24 -public class DefaultTypedFlowEntry extends DefaultFlowEntry 24 +public class DefaultTypedFlowEntry extends DefaultFlowEntry
25 - implements TypedStoredFlowEntry { 25 + implements TypedStoredFlowEntry {
26 - private FlowLiveType liveType; 26 + private FlowLiveType liveType;
27 - 27 +
28 - /** 28 + /**
29 - * Creates a typed flow entry from flow rule and its statistics, with default flow live type(IMMEDIATE_FLOW). 29 + * Creates a typed flow entry from flow rule and its statistics, with default flow live type(IMMEDIATE_FLOW).
30 - * 30 + *
31 - * @param rule the flow rule 31 + * @param rule the flow rule
32 - * @param state the flow state 32 + * @param state the flow state
33 - * @param life the flow duration since creation 33 + * @param life the flow duration since creation
34 - * @param packets the flow packets count 34 + * @param packets the flow packets count
35 - * @param bytes the flow bytes count 35 + * @param bytes the flow bytes count
36 - * 36 + *
37 - */ 37 + */
38 - public DefaultTypedFlowEntry(FlowRule rule, FlowEntryState state, 38 + public DefaultTypedFlowEntry(FlowRule rule, FlowEntryState state,
39 - long life, long packets, long bytes) { 39 + long life, long packets, long bytes) {
40 - super(rule, state, life, packets, bytes); 40 + super(rule, state, life, packets, bytes);
41 - this.liveType = FlowLiveType.IMMEDIATE_FLOW; 41 + this.liveType = FlowLiveType.IMMEDIATE_FLOW;
42 - } 42 + }
43 - 43 +
44 - /** 44 + /**
45 - * Creates a typed flow entry from flow rule, with default flow live type(IMMEDIATE_FLOW). 45 + * Creates a typed flow entry from flow rule, with default flow live type(IMMEDIATE_FLOW).
46 - * 46 + *
47 - * @param rule the flow rule 47 + * @param rule the flow rule
48 - * 48 + *
49 - */ 49 + */
50 - public DefaultTypedFlowEntry(FlowRule rule) { 50 + public DefaultTypedFlowEntry(FlowRule rule) {
51 - super(rule); 51 + super(rule);
52 - this.liveType = FlowLiveType.IMMEDIATE_FLOW; 52 + this.liveType = FlowLiveType.IMMEDIATE_FLOW;
53 - } 53 + }
54 - 54 +
55 - /** 55 + /**
56 - * Creates a typed flow entry from flow entry, with default flow live type(IMMEDIATE_FLOW). 56 + * Creates a typed flow entry from flow entry, with default flow live type(IMMEDIATE_FLOW).
57 - * 57 + *
58 - * @param fe the flow entry 58 + * @param fe the flow entry
59 - * 59 + *
60 - */ 60 + */
61 - public DefaultTypedFlowEntry(FlowEntry fe) { 61 + public DefaultTypedFlowEntry(FlowEntry fe) {
62 - super(fe, fe.state(), fe.life(), fe.packets(), fe.bytes()); 62 + super(fe, fe.state(), fe.life(), fe.packets(), fe.bytes());
63 - this.liveType = FlowLiveType.IMMEDIATE_FLOW; 63 + this.liveType = FlowLiveType.IMMEDIATE_FLOW;
64 - } 64 + }
65 - 65 +
66 - /** 66 + /**
67 - * Creates a typed flow entry from flow rule and flow live type. 67 + * Creates a typed flow entry from flow rule and flow live type.
68 - * 68 + *
69 - * @param rule the flow rule 69 + * @param rule the flow rule
70 - * @param liveType the flow live type 70 + * @param liveType the flow live type
71 - * 71 + *
72 - */ 72 + */
73 - public DefaultTypedFlowEntry(FlowRule rule, FlowLiveType liveType) { 73 + public DefaultTypedFlowEntry(FlowRule rule, FlowLiveType liveType) {
74 - super(rule); 74 + super(rule);
75 - this.liveType = liveType; 75 + this.liveType = liveType;
76 - } 76 + }
77 - 77 +
78 - /** 78 + /**
79 - * Creates a typed flow entry from flow entry and flow live type. 79 + * Creates a typed flow entry from flow entry and flow live type.
80 - * 80 + *
81 - * @param fe the flow rule 81 + * @param fe the flow rule
82 - * @param liveType the flow live type 82 + * @param liveType the flow live type
83 - * 83 + *
84 - */ 84 + */
85 - public DefaultTypedFlowEntry(FlowEntry fe, FlowLiveType liveType) { 85 + public DefaultTypedFlowEntry(FlowEntry fe, FlowLiveType liveType) {
86 - super(fe, fe.state(), fe.life(), fe.packets(), fe.bytes()); 86 + super(fe, fe.state(), fe.life(), fe.packets(), fe.bytes());
87 - this.liveType = liveType; 87 + this.liveType = liveType;
88 - } 88 + }
89 - 89 +
90 - /** 90 + /**
91 - * Creates a typed flow entry from flow rule, error code and flow live type. 91 + * Creates a typed flow entry from flow rule, error code and flow live type.
92 - * 92 + *
93 - * @param rule the flow rule 93 + * @param rule the flow rule
94 - * @param errType the flow error type 94 + * @param errType the flow error type
95 - * @param errCode the flow error code 95 + * @param errCode the flow error code
96 - * @param liveType the flow live type 96 + * @param liveType the flow live type
97 - * 97 + *
98 - */ 98 + */
99 - public DefaultTypedFlowEntry(FlowRule rule, int errType, int errCode, FlowLiveType liveType) { 99 + public DefaultTypedFlowEntry(FlowRule rule, int errType, int errCode, FlowLiveType liveType) {
100 - super(rule, errType, errCode); 100 + super(rule, errType, errCode);
101 - this.liveType = liveType; 101 + this.liveType = liveType;
102 - } 102 + }
103 - 103 +
104 - @Override 104 + @Override
105 - public FlowLiveType flowLiveType() { 105 + public FlowLiveType flowLiveType() {
106 - return this.liveType; 106 + return this.liveType;
107 - } 107 + }
108 - 108 +
109 - @Override 109 + @Override
110 - public void setFlowLiveType(FlowLiveType liveType) { 110 + public void setFlowLiveType(FlowLiveType liveType) {
111 - this.liveType = liveType; 111 + this.liveType = liveType;
112 - } 112 + }
113 - 113 +
114 - @Override 114 + @Override
115 - public String toString() { 115 + public String toString() {
116 - return toStringHelper(this) 116 + return toStringHelper(this)
117 - .add("entry", super.toString()) 117 + .add("entry", super.toString())
118 - .add("type", liveType) 118 + .add("type", liveType)
119 - .toString(); 119 + .toString();
120 - } 120 + }
121 -} 121 +}
122 - 122 +
......
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 - 16 +
17 -package org.onosproject.net.flow; 17 +package org.onosproject.net.flow;
18 - 18 +
19 -/** 19 +/**
20 - * Represents a flow live type for a given flow entry. 20 + * Represents a flow live type for a given flow entry.
21 - */ 21 + */
22 -public interface TypedStoredFlowEntry extends StoredFlowEntry { 22 +public interface TypedStoredFlowEntry extends StoredFlowEntry {
23 - enum FlowLiveType { 23 + enum FlowLiveType {
24 - /** 24 + /**
25 - * Indicates that this rule has been submitted for addition immediately. 25 + * Indicates that this rule has been submitted for addition immediately.
26 - * Not necessarily collecting flow stats. 26 + * Not necessarily collecting flow stats.
27 - */ 27 + */
28 - IMMEDIATE_FLOW, 28 + IMMEDIATE_FLOW,
29 - 29 +
30 - /** 30 + /**
31 - * Indicates that this rule has been submitted for a short time. 31 + * Indicates that this rule has been submitted for a short time.
32 - * Necessarily collecting flow stats every calAndPollInterval. 32 + * Necessarily collecting flow stats every calAndPollInterval.
33 - */ 33 + */
34 - SHORT_FLOW, 34 + SHORT_FLOW,
35 - 35 +
36 - /** 36 + /**
37 - * Indicates that this rule has been submitted for a mid time. 37 + * Indicates that this rule has been submitted for a mid time.
38 - * Necessarily collecting flow stats every midPollInterval. 38 + * Necessarily collecting flow stats every midPollInterval.
39 - */ 39 + */
40 - MID_FLOW, 40 + MID_FLOW,
41 - 41 +
42 - /** 42 + /**
43 - * Indicates that this rule has been submitted for a long time. 43 + * Indicates that this rule has been submitted for a long time.
44 - * Necessarily collecting flow stats every longPollInterval. 44 + * Necessarily collecting flow stats every longPollInterval.
45 - */ 45 + */
46 - LONG_FLOW, 46 + LONG_FLOW,
47 - 47 +
48 - /** 48 + /**
49 - * Indicates that this rule has been submitted for UNKNOWN or ERROR. 49 + * Indicates that this rule has been submitted for UNKNOWN or ERROR.
50 - * Not necessarily collecting flow stats. 50 + * Not necessarily collecting flow stats.
51 - */ 51 + */
52 - UNKNOWN_FLOW 52 + UNKNOWN_FLOW
53 - } 53 + }
54 - 54 +
55 - /** 55 + /**
56 - * Gets the flow live type for this entry. 56 + * Gets the flow live type for this entry.
57 - * 57 + *
58 - * @return flow live type 58 + * @return flow live type
59 - */ 59 + */
60 - FlowLiveType flowLiveType(); 60 + FlowLiveType flowLiveType();
61 - 61 +
62 - /** 62 + /**
63 - * Sets the new flow live type for this entry. 63 + * Sets the new flow live type for this entry.
64 - * @param liveType new flow live type. 64 + * @param liveType new flow live type.
65 - */ 65 + */
66 - void setFlowLiveType(FlowLiveType liveType); 66 + void setFlowLiveType(FlowLiveType liveType);
67 -} 67 +}
......
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 - 16 +
17 -package org.onosproject.net.statistic; 17 +package org.onosproject.net.statistic;
18 - 18 +
19 -import org.onosproject.net.ConnectPoint; 19 +import org.onosproject.net.ConnectPoint;
20 -import org.onosproject.net.Device; 20 +import org.onosproject.net.Device;
21 -import org.onosproject.net.PortNumber; 21 +import org.onosproject.net.PortNumber;
22 -import org.onosproject.net.flow.TypedStoredFlowEntry; 22 +import org.onosproject.net.flow.TypedStoredFlowEntry;
23 -import org.onosproject.net.flow.instructions.Instruction; 23 +import org.onosproject.net.flow.instructions.Instruction;
24 - 24 +
25 -import java.util.List; 25 +import java.util.List;
26 -import java.util.Map; 26 +import java.util.Map;
27 - 27 +
28 -/** 28 +/**
29 - * Service for obtaining individual flow statistic information about device and link in the system. 29 + * Service for obtaining individual flow statistic information about device and link in the system.
30 - * Basic statistics are obtained from the StatisticService 30 + * Basic statistics are obtained from the StatisticService
31 - */ 31 + */
32 -public interface FlowStatisticService { 32 +public interface FlowStatisticService {
33 - 33 +
34 - /** 34 + /**
35 - * Obtain the summary load list for the device with the given link. 35 + * Obtain the summary load list for the device with the given link.
36 - * 36 + *
37 - * @param device the Device to query. 37 + * @param device the Device to query.
38 - * @return map of summary flow entry load 38 + * @return map of summary flow entry load
39 - */ 39 + */
40 - Map<ConnectPoint, SummaryFlowEntryWithLoad> loadSummary(Device device); 40 + Map<ConnectPoint, SummaryFlowEntryWithLoad> loadSummary(Device device);
41 - 41 +
42 - /** 42 + /**
43 - * Obtain the summary load for the device with the given link or port. 43 + * Obtain the summary load for the device with the given link or port.
44 - * 44 + *
45 - * @param device the Device to query. 45 + * @param device the Device to query.
46 - * @param pNumber the port number to query. 46 + * @param pNumber the port number to query.
47 - * @return summary flow entry load 47 + * @return summary flow entry load
48 - */ 48 + */
49 - SummaryFlowEntryWithLoad loadSummary(Device device, PortNumber pNumber); 49 + SummaryFlowEntryWithLoad loadSummary(Device device, PortNumber pNumber);
50 - 50 +
51 - /** 51 + /**
52 - * Obtain the set of the flow type and load list for the device with the given link. 52 + * Obtain the set of the flow type and load list for the device with the given link.
53 - * 53 + *
54 - * @param device the Device to query. 54 + * @param device the Device to query.
55 - * @param liveType the FlowLiveType to filter, null means no filtering . 55 + * @param liveType the FlowLiveType to filter, null means no filtering .
56 - * @param instType the InstructionType to filter, null means no filtering. 56 + * @param instType the InstructionType to filter, null means no filtering.
57 - * @return map of flow entry load 57 + * @return map of flow entry load
58 - */ 58 + */
59 - Map<ConnectPoint, List<TypedFlowEntryWithLoad>> loadAllByType(Device device, 59 + Map<ConnectPoint, List<TypedFlowEntryWithLoad>> loadAllByType(Device device,
60 - TypedStoredFlowEntry.FlowLiveType liveType, 60 + TypedStoredFlowEntry.FlowLiveType liveType,
61 - Instruction.Type instType); 61 + Instruction.Type instType);
62 - 62 +
63 - /** 63 + /**
64 - * Obtain the flow type and load list for the device with the given link or port. 64 + * Obtain the flow type and load list for the device with the given link or port.
65 - * 65 + *
66 - * @param device the Device to query. 66 + * @param device the Device to query.
67 - * @param pNumber the port number of the Device to query 67 + * @param pNumber the port number of the Device to query
68 - * @param liveType the FlowLiveType to filter, null means no filtering . 68 + * @param liveType the FlowLiveType to filter, null means no filtering .
69 - * @param instType the InstructionType to filter, null means no filtering. 69 + * @param instType the InstructionType to filter, null means no filtering.
70 - * @return list of flow entry load 70 + * @return list of flow entry load
71 - */ 71 + */
72 - List<TypedFlowEntryWithLoad> loadAllByType(Device device, PortNumber pNumber, 72 + List<TypedFlowEntryWithLoad> loadAllByType(Device device, PortNumber pNumber,
73 - TypedStoredFlowEntry.FlowLiveType liveType, 73 + TypedStoredFlowEntry.FlowLiveType liveType,
74 - Instruction.Type instType); 74 + Instruction.Type instType);
75 - 75 +
76 - /** 76 + /**
77 - * Obtain the set of the flow type and load topn list for the device with the given link. 77 + * Obtain the set of the flow type and load topn list for the device with the given link.
78 - * 78 + *
79 - * @param device the Device to query. 79 + * @param device the Device to query.
80 - * @param liveType the FlowLiveType to filter, null means no filtering . 80 + * @param liveType the FlowLiveType to filter, null means no filtering .
81 - * @param instType the InstructionType to filter, null means no filtering. 81 + * @param instType the InstructionType to filter, null means no filtering.
82 - * @param topn the top number to filter, null means no filtering. 82 + * @param topn the top number to filter, null means no filtering.
83 - * @return map of flow entry load 83 + * @return map of flow entry load
84 - */ 84 + */
85 - Map<ConnectPoint, List<TypedFlowEntryWithLoad>> loadTopnByType(Device device, 85 + Map<ConnectPoint, List<TypedFlowEntryWithLoad>> loadTopnByType(Device device,
86 - TypedStoredFlowEntry.FlowLiveType liveType, 86 + TypedStoredFlowEntry.FlowLiveType liveType,
87 - Instruction.Type instType, 87 + Instruction.Type instType,
88 - int topn); 88 + int topn);
89 - 89 +
90 - /** 90 + /**
91 - * Obtain the flow type and load topn list for the device with the given link or port. 91 + * Obtain the flow type and load topn list for the device with the given link or port.
92 - * 92 + *
93 - * @param device the Device to query. 93 + * @param device the Device to query.
94 - * @param pNumber the port number of the Device to query 94 + * @param pNumber the port number of the Device to query
95 - * @param liveType the FlowLiveType to filter, null means no filtering . 95 + * @param liveType the FlowLiveType to filter, null means no filtering .
96 - * @param instType the InstructionType to filter, null means no filtering. 96 + * @param instType the InstructionType to filter, null means no filtering.
97 - * @param topn topn //FIXME what? 97 + * @param topn topn //FIXME what?
98 - * @return list of flow entry load 98 + * @return list of flow entry load
99 - */ 99 + */
100 - List<TypedFlowEntryWithLoad> loadTopnByType(Device device, PortNumber pNumber, 100 + List<TypedFlowEntryWithLoad> loadTopnByType(Device device, PortNumber pNumber,
101 - TypedStoredFlowEntry.FlowLiveType liveType, 101 + TypedStoredFlowEntry.FlowLiveType liveType,
102 - Instruction.Type instType, 102 + Instruction.Type instType,
103 - int topn); 103 + int topn);
104 -} 104 +}
105 - 105 +
106 - 106 +
......
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 - 16 +
17 -package org.onosproject.net.statistic; 17 +package org.onosproject.net.statistic;
18 - 18 +
19 -import org.onosproject.net.ConnectPoint; 19 +import org.onosproject.net.ConnectPoint;
20 -import org.onosproject.net.flow.FlowEntry; 20 +import org.onosproject.net.flow.FlowEntry;
21 -import org.onosproject.net.flow.FlowRule; 21 +import org.onosproject.net.flow.FlowRule;
22 - 22 +
23 -import java.util.Set; 23 +import java.util.Set;
24 - 24 +
25 -/** 25 +/**
26 - * Flow Store to house the computed statistics. 26 + * Flow Store to house the computed statistics.
27 - */ 27 + */
28 -public interface FlowStatisticStore { 28 +public interface FlowStatisticStore {
29 - /** 29 + /**
30 - * Remove entries associated with this rule. 30 + * Remove entries associated with this rule.
31 - * 31 + *
32 - * @param rule {@link org.onosproject.net.flow.FlowRule} 32 + * @param rule {@link org.onosproject.net.flow.FlowRule}
33 - */ 33 + */
34 - void removeFlowStatistic(FlowRule rule); 34 + void removeFlowStatistic(FlowRule rule);
35 - 35 +
36 - /** 36 + /**
37 - * Adds a flow stats observation for a flow rule. The previous flow will be removed. 37 + * Adds a flow stats observation for a flow rule. The previous flow will be removed.
38 - * 38 + *
39 - * @param rule a {@link org.onosproject.net.flow.FlowEntry} 39 + * @param rule a {@link org.onosproject.net.flow.FlowEntry}
40 - */ 40 + */
41 - void addFlowStatistic(FlowEntry rule); 41 + void addFlowStatistic(FlowEntry rule);
42 - 42 +
43 - /** 43 + /**
44 - * Updates a stats observation for a flow rule. The old flow stats will be moved to previous stats. 44 + * Updates a stats observation for a flow rule. The old flow stats will be moved to previous stats.
45 - * 45 + *
46 - * @param rule a {@link org.onosproject.net.flow.FlowEntry} 46 + * @param rule a {@link org.onosproject.net.flow.FlowEntry}
47 - */ 47 + */
48 - void updateFlowStatistic(FlowEntry rule); 48 + void updateFlowStatistic(FlowEntry rule);
49 - 49 +
50 - /** 50 + /**
51 - * Fetches the current observed flow stats values. 51 + * Fetches the current observed flow stats values.
52 - * 52 + *
53 - * @param connectPoint the port to fetch information for 53 + * @param connectPoint the port to fetch information for
54 - * @return set of current flow rules 54 + * @return set of current flow rules
55 - */ 55 + */
56 - Set<FlowEntry> getCurrentFlowStatistic(ConnectPoint connectPoint); 56 + Set<FlowEntry> getCurrentFlowStatistic(ConnectPoint connectPoint);
57 - 57 +
58 - /** 58 + /**
59 - * Fetches the current observed flow stats values. 59 + * Fetches the current observed flow stats values.
60 - * 60 + *
61 - * @param connectPoint the port to fetch information for 61 + * @param connectPoint the port to fetch information for
62 - * @return set of current values 62 + * @return set of current values
63 - */ 63 + */
64 - Set<FlowEntry> getPreviousFlowStatistic(ConnectPoint connectPoint); 64 + Set<FlowEntry> getPreviousFlowStatistic(ConnectPoint connectPoint);
65 -} 65 +}
......
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 - 16 +
17 -package org.onosproject.net.statistic; 17 +package org.onosproject.net.statistic;
18 - 18 +
19 -import org.onosproject.net.ConnectPoint; 19 +import org.onosproject.net.ConnectPoint;
20 - 20 +
21 -/** 21 +/**
22 - * Summary Load classified by flow live type. 22 + * Summary Load classified by flow live type.
23 - */ 23 + */
24 -public class SummaryFlowEntryWithLoad { 24 +public class SummaryFlowEntryWithLoad {
25 - private ConnectPoint cp; 25 + private ConnectPoint cp;
26 - private Load totalLoad; 26 + private Load totalLoad;
27 - private Load immediateLoad; 27 + private Load immediateLoad;
28 - private Load shortLoad; 28 + private Load shortLoad;
29 - private Load midLoad; 29 + private Load midLoad;
30 - private Load longLoad; 30 + private Load longLoad;
31 - private Load unknownLoad; 31 + private Load unknownLoad;
32 - 32 +
33 - /** 33 + /**
34 - * Creates a new summary flow entry having load for the given connect point and total load. 34 + * Creates a new summary flow entry having load for the given connect point and total load.
35 - * 35 + *
36 - * @param cp connect point 36 + * @param cp connect point
37 - * @param totalLoad total load 37 + * @param totalLoad total load
38 - */ 38 + */
39 - public SummaryFlowEntryWithLoad(ConnectPoint cp, Load totalLoad) { 39 + public SummaryFlowEntryWithLoad(ConnectPoint cp, Load totalLoad) {
40 - this.cp = cp; 40 + this.cp = cp;
41 - this.totalLoad = totalLoad; 41 + this.totalLoad = totalLoad;
42 - this.immediateLoad = new DefaultLoad(); 42 + this.immediateLoad = new DefaultLoad();
43 - this.shortLoad = new DefaultLoad(); 43 + this.shortLoad = new DefaultLoad();
44 - this.midLoad = new DefaultLoad(); 44 + this.midLoad = new DefaultLoad();
45 - this.longLoad = new DefaultLoad(); 45 + this.longLoad = new DefaultLoad();
46 - this.unknownLoad = new DefaultLoad(); 46 + this.unknownLoad = new DefaultLoad();
47 - } 47 + }
48 - 48 +
49 - /** 49 + /**
50 - * Creates a new summary flow entry having load for the given connect point 50 + * Creates a new summary flow entry having load for the given connect point
51 - * and total, immediate, short, mid, and long load. 51 + * and total, immediate, short, mid, and long load.
52 - * 52 + *
53 - * @param cp connect point 53 + * @param cp connect point
54 - * @param totalLoad total load 54 + * @param totalLoad total load
55 - * @param immediateLoad immediate load 55 + * @param immediateLoad immediate load
56 - * @param shortLoad short load 56 + * @param shortLoad short load
57 - * @param midLoad mid load 57 + * @param midLoad mid load
58 - * @param longLoad long load 58 + * @param longLoad long load
59 - */ 59 + */
60 - public SummaryFlowEntryWithLoad(ConnectPoint cp, 60 + public SummaryFlowEntryWithLoad(ConnectPoint cp,
61 - Load totalLoad, Load immediateLoad, Load shortLoad, Load midLoad, Load longLoad) { 61 + Load totalLoad, Load immediateLoad, Load shortLoad, Load midLoad, Load longLoad) {
62 - this.cp = cp; 62 + this.cp = cp;
63 - this.totalLoad = totalLoad; 63 + this.totalLoad = totalLoad;
64 - this.immediateLoad = immediateLoad; 64 + this.immediateLoad = immediateLoad;
65 - this.shortLoad = shortLoad; 65 + this.shortLoad = shortLoad;
66 - this.midLoad = midLoad; 66 + this.midLoad = midLoad;
67 - this.longLoad = longLoad; 67 + this.longLoad = longLoad;
68 - this.unknownLoad = new DefaultLoad(); 68 + this.unknownLoad = new DefaultLoad();
69 - } 69 + }
70 - 70 +
71 - /** 71 + /**
72 - * Creates a new summary flow entry having load for the given connect point 72 + * Creates a new summary flow entry having load for the given connect point
73 - * and total, immediate, short, mid, long, and unknown load. 73 + * and total, immediate, short, mid, long, and unknown load.
74 - * 74 + *
75 - * @param cp connect point 75 + * @param cp connect point
76 - * @param totalLoad total load 76 + * @param totalLoad total load
77 - * @param immediateLoad immediate load 77 + * @param immediateLoad immediate load
78 - * @param shortLoad short load 78 + * @param shortLoad short load
79 - * @param midLoad mid load 79 + * @param midLoad mid load
80 - * @param longLoad long load 80 + * @param longLoad long load
81 - * @param unknownLoad long load 81 + * @param unknownLoad long load
82 - */ 82 + */
83 - public SummaryFlowEntryWithLoad(ConnectPoint cp, 83 + public SummaryFlowEntryWithLoad(ConnectPoint cp,
84 - Load totalLoad, Load immediateLoad, 84 + Load totalLoad, Load immediateLoad,
85 - Load shortLoad, Load midLoad, Load longLoad, Load unknownLoad) { 85 + Load shortLoad, Load midLoad, Load longLoad, Load unknownLoad) {
86 - this.cp = cp; 86 + this.cp = cp;
87 - this.totalLoad = totalLoad; 87 + this.totalLoad = totalLoad;
88 - this.immediateLoad = immediateLoad; 88 + this.immediateLoad = immediateLoad;
89 - this.shortLoad = shortLoad; 89 + this.shortLoad = shortLoad;
90 - this.midLoad = midLoad; 90 + this.midLoad = midLoad;
91 - this.longLoad = longLoad; 91 + this.longLoad = longLoad;
92 - this.unknownLoad = unknownLoad; 92 + this.unknownLoad = unknownLoad;
93 - } 93 + }
94 - 94 +
95 - /** 95 + /**
96 - * Returns connect point. 96 + * Returns connect point.
97 - * 97 + *
98 - * @return connect point 98 + * @return connect point
99 - */ 99 + */
100 - public ConnectPoint connectPoint() { 100 + public ConnectPoint connectPoint() {
101 - return cp; 101 + return cp;
102 - } 102 + }
103 - 103 +
104 - /** 104 + /**
105 - * Returns total load of connect point. 105 + * Returns total load of connect point.
106 - * 106 + *
107 - * @return total load 107 + * @return total load
108 - */ 108 + */
109 - public Load totalLoad() { 109 + public Load totalLoad() {
110 - return totalLoad; 110 + return totalLoad;
111 - } 111 + }
112 - 112 +
113 - /** 113 + /**
114 - * Returns immediate load of connect point. 114 + * Returns immediate load of connect point.
115 - * 115 + *
116 - * @return immediate load 116 + * @return immediate load
117 - */ 117 + */
118 - public Load immediateLoad() { 118 + public Load immediateLoad() {
119 - return immediateLoad; 119 + return immediateLoad;
120 - } 120 + }
121 - 121 +
122 - /** 122 + /**
123 - * Returns short load of connect point. 123 + * Returns short load of connect point.
124 - * 124 + *
125 - * @return short load 125 + * @return short load
126 - */ 126 + */
127 - public Load shortLoad() { 127 + public Load shortLoad() {
128 - return shortLoad; 128 + return shortLoad;
129 - } 129 + }
130 - 130 +
131 - /** 131 + /**
132 - * Returns mid load of connect point. 132 + * Returns mid load of connect point.
133 - * 133 + *
134 - * @return mid load 134 + * @return mid load
135 - */ 135 + */
136 - public Load midLoad() { 136 + public Load midLoad() {
137 - return midLoad; 137 + return midLoad;
138 - } 138 + }
139 - 139 +
140 - /** 140 + /**
141 - * Returns long load of connect point. 141 + * Returns long load of connect point.
142 - * 142 + *
143 - * @return long load 143 + * @return long load
144 - */ 144 + */
145 - public Load longLoad() { 145 + public Load longLoad() {
146 - return longLoad; 146 + return longLoad;
147 - } 147 + }
148 - 148 +
149 - /** 149 + /**
150 - * Returns unknown load of connect point. 150 + * Returns unknown load of connect point.
151 - * 151 + *
152 - * @return unknown load 152 + * @return unknown load
153 - */ 153 + */
154 - public Load unknownLoad() { 154 + public Load unknownLoad() {
155 - return unknownLoad; 155 + return unknownLoad;
156 - } 156 + }
157 -} 157 +}
......
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 - 16 +
17 -package org.onosproject.bgpio.protocol; 17 +package org.onosproject.bgpio.protocol;
18 - 18 +
19 -import org.jboss.netty.buffer.ChannelBuffer; 19 +import org.jboss.netty.buffer.ChannelBuffer;
20 -import org.onosproject.bgpio.exceptions.BgpParseException; 20 +import org.onosproject.bgpio.exceptions.BgpParseException;
21 -import org.onosproject.bgpio.protocol.ver4.BgpFactoryVer4; 21 +import org.onosproject.bgpio.protocol.ver4.BgpFactoryVer4;
22 -import org.onosproject.bgpio.types.BgpHeader; 22 +import org.onosproject.bgpio.types.BgpHeader;
23 -import org.slf4j.Logger; 23 +import org.slf4j.Logger;
24 -import org.slf4j.LoggerFactory; 24 +import org.slf4j.LoggerFactory;
25 - 25 +
26 -/** 26 +/**
27 - * Abstraction to provide the version for BGP. 27 + * Abstraction to provide the version for BGP.
28 - */ 28 + */
29 -public final class BgpFactories { 29 +public final class BgpFactories {
30 - 30 +
31 - protected static final Logger log = LoggerFactory.getLogger(BgpFactories.class); 31 + protected static final Logger log = LoggerFactory.getLogger(BgpFactories.class);
32 - 32 +
33 - private static final GenericReader GENERIC_READER = new GenericReader(); 33 + private static final GenericReader GENERIC_READER = new GenericReader();
34 - 34 +
35 - private BgpFactories() { 35 + private BgpFactories() {
36 - } 36 + }
37 - 37 +
38 - /** 38 + /**
39 - * Returns the instance of BGP Version. 39 + * Returns the instance of BGP Version.
40 - * 40 + *
41 - * @param version BGP version 41 + * @param version BGP version
42 - * @return BGP version 42 + * @return BGP version
43 - */ 43 + */
44 - public static BgpFactory getFactory(BgpVersion version) { 44 + public static BgpFactory getFactory(BgpVersion version) {
45 - switch (version) { 45 + switch (version) {
46 - case BGP_4: 46 + case BGP_4:
47 - return BgpFactoryVer4.INSTANCE; 47 + return BgpFactoryVer4.INSTANCE;
48 - default: 48 + default:
49 - throw new IllegalArgumentException("[BgpFactory:]Unknown version: " + version); 49 + throw new IllegalArgumentException("[BgpFactory:]Unknown version: " + version);
50 - } 50 + }
51 - } 51 + }
52 - 52 +
53 - /** 53 + /**
54 - * Reader class for reading BGP messages from channel buffer. 54 + * Reader class for reading BGP messages from channel buffer.
55 - * 55 + *
56 - */ 56 + */
57 - private static class GenericReader implements BgpMessageReader<BgpMessage> { 57 + private static class GenericReader implements BgpMessageReader<BgpMessage> {
58 - 58 +
59 - @Override 59 + @Override
60 - public BgpMessage readFrom(ChannelBuffer bb, BgpHeader bgpHeader) 60 + public BgpMessage readFrom(ChannelBuffer bb, BgpHeader bgpHeader)
61 - throws BgpParseException { 61 + throws BgpParseException {
62 - BgpFactory factory; 62 + BgpFactory factory;
63 - 63 +
64 - if (!bb.readable()) { 64 + if (!bb.readable()) {
65 - log.error("Empty message received"); 65 + log.error("Empty message received");
66 - throw new BgpParseException("Empty message received"); 66 + throw new BgpParseException("Empty message received");
67 - } 67 + }
68 - // TODO: Currently only BGP version 4 is supported 68 + // TODO: Currently only BGP version 4 is supported
69 - factory = org.onosproject.bgpio.protocol.ver4.BgpFactoryVer4.INSTANCE; 69 + factory = org.onosproject.bgpio.protocol.ver4.BgpFactoryVer4.INSTANCE;
70 - return factory.getReader().readFrom(bb, bgpHeader); 70 + return factory.getReader().readFrom(bb, bgpHeader);
71 - } 71 + }
72 - } 72 + }
73 - 73 +
74 - /** 74 + /**
75 - * Returns BGP messsage generic reader. 75 + * Returns BGP messsage generic reader.
76 - * 76 + *
77 - * @return bgp message generic reader 77 + * @return bgp message generic reader
78 - */ 78 + */
79 - public static BgpMessageReader<BgpMessage> getGenericReader() { 79 + public static BgpMessageReader<BgpMessage> getGenericReader() {
80 - return GENERIC_READER; 80 + return GENERIC_READER;
81 - } 81 + }
82 -} 82 +}
......
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.bgpio.types; 16 +package org.onosproject.bgpio.types;
17 - 17 +
18 -import java.util.Objects; 18 +import java.util.Objects;
19 - 19 +
20 -import org.jboss.netty.buffer.ChannelBuffer; 20 +import org.jboss.netty.buffer.ChannelBuffer;
21 -import org.slf4j.Logger; 21 +import org.slf4j.Logger;
22 -import org.slf4j.LoggerFactory; 22 +import org.slf4j.LoggerFactory;
23 - 23 +
24 -import com.google.common.base.MoreObjects; 24 +import com.google.common.base.MoreObjects;
25 - 25 +
26 -/** 26 +/**
27 - * Provides FourOctetAsNumCapabilityTlv Capability Tlv. 27 + * Provides FourOctetAsNumCapabilityTlv Capability Tlv.
28 - */ 28 + */
29 -public class FourOctetAsNumCapabilityTlv implements BgpValueType { 29 +public class FourOctetAsNumCapabilityTlv implements BgpValueType {
30 - 30 +
31 - /** 31 + /**
32 - * support to indicate its support for four-octet AS numbers -CAPABILITY TLV format. 32 + * support to indicate its support for four-octet AS numbers -CAPABILITY TLV format.
33 - */ 33 + */
34 - protected static final Logger log = LoggerFactory 34 + protected static final Logger log = LoggerFactory
35 - .getLogger(FourOctetAsNumCapabilityTlv.class); 35 + .getLogger(FourOctetAsNumCapabilityTlv.class);
36 - 36 +
37 - public static final byte TYPE = 65; 37 + public static final byte TYPE = 65;
38 - public static final byte LENGTH = 4; 38 + public static final byte LENGTH = 4;
39 - 39 +
40 - private final int rawValue; 40 + private final int rawValue;
41 - 41 +
42 - /** 42 + /**
43 - * constructor to initialize rawValue. 43 + * constructor to initialize rawValue.
44 - * @param rawValue FourOctetAsNumCapabilityTlv 44 + * @param rawValue FourOctetAsNumCapabilityTlv
45 - */ 45 + */
46 - public FourOctetAsNumCapabilityTlv(int rawValue) { 46 + public FourOctetAsNumCapabilityTlv(int rawValue) {
47 - this.rawValue = rawValue; 47 + this.rawValue = rawValue;
48 - } 48 + }
49 - 49 +
50 - /** 50 + /**
51 - * constructor to initialize raw. 51 + * constructor to initialize raw.
52 - * @param raw AS number 52 + * @param raw AS number
53 - * @return object of FourOctetAsNumCapabilityTlv 53 + * @return object of FourOctetAsNumCapabilityTlv
54 - */ 54 + */
55 - public static FourOctetAsNumCapabilityTlv of(final int raw) { 55 + public static FourOctetAsNumCapabilityTlv of(final int raw) {
56 - return new FourOctetAsNumCapabilityTlv(raw); 56 + return new FourOctetAsNumCapabilityTlv(raw);
57 - } 57 + }
58 - 58 +
59 - /** 59 + /**
60 - * Returns value of TLV. 60 + * Returns value of TLV.
61 - * @return int value of rawValue 61 + * @return int value of rawValue
62 - */ 62 + */
63 - public int getInt() { 63 + public int getInt() {
64 - return rawValue; 64 + return rawValue;
65 - } 65 + }
66 - 66 +
67 - @Override 67 + @Override
68 - public short getType() { 68 + public short getType() {
69 - return TYPE; 69 + return TYPE;
70 - } 70 + }
71 - 71 +
72 - @Override 72 + @Override
73 - public int hashCode() { 73 + public int hashCode() {
74 - return Objects.hash(rawValue); 74 + return Objects.hash(rawValue);
75 - } 75 + }
76 - 76 +
77 - @Override 77 + @Override
78 - public boolean equals(Object obj) { 78 + public boolean equals(Object obj) {
79 - if (this == obj) { 79 + if (this == obj) {
80 - return true; 80 + return true;
81 - } 81 + }
82 - if (obj instanceof FourOctetAsNumCapabilityTlv) { 82 + if (obj instanceof FourOctetAsNumCapabilityTlv) {
83 - FourOctetAsNumCapabilityTlv other = (FourOctetAsNumCapabilityTlv) obj; 83 + FourOctetAsNumCapabilityTlv other = (FourOctetAsNumCapabilityTlv) obj;
84 - return Objects.equals(rawValue, other.rawValue); 84 + return Objects.equals(rawValue, other.rawValue);
85 - } 85 + }
86 - return false; 86 + return false;
87 - } 87 + }
88 - 88 +
89 - @Override 89 + @Override
90 - public int write(ChannelBuffer cb) { 90 + public int write(ChannelBuffer cb) {
91 - int iLenStartIndex = cb.writerIndex(); 91 + int iLenStartIndex = cb.writerIndex();
92 - cb.writeByte(TYPE); 92 + cb.writeByte(TYPE);
93 - cb.writeByte(LENGTH); 93 + cb.writeByte(LENGTH);
94 - cb.writeInt(rawValue); 94 + cb.writeInt(rawValue);
95 - return cb.writerIndex() - iLenStartIndex; 95 + return cb.writerIndex() - iLenStartIndex;
96 - } 96 + }
97 - 97 +
98 - /** 98 + /**
99 - * Reads the channel buffer and returns object of FourOctetAsNumCapabilityTlv. 99 + * Reads the channel buffer and returns object of FourOctetAsNumCapabilityTlv.
100 - * @param cb type of channel buffer 100 + * @param cb type of channel buffer
101 - * @return object of FourOctetAsNumCapabilityTlv 101 + * @return object of FourOctetAsNumCapabilityTlv
102 - */ 102 + */
103 - public static FourOctetAsNumCapabilityTlv read(ChannelBuffer cb) { 103 + public static FourOctetAsNumCapabilityTlv read(ChannelBuffer cb) {
104 - return FourOctetAsNumCapabilityTlv.of(cb.readInt()); 104 + return FourOctetAsNumCapabilityTlv.of(cb.readInt());
105 - } 105 + }
106 - 106 +
107 - @Override 107 + @Override
108 - public String toString() { 108 + public String toString() {
109 - return MoreObjects.toStringHelper(getClass()) 109 + return MoreObjects.toStringHelper(getClass())
110 - .add("Type", TYPE) 110 + .add("Type", TYPE)
111 - .add("Length", LENGTH) 111 + .add("Length", LENGTH)
112 - .add("Value", rawValue).toString(); 112 + .add("Value", rawValue).toString();
113 - } 113 + }
114 - 114 +
115 - @Override 115 + @Override
116 - public int compareTo(Object o) { 116 + public int compareTo(Object o) {
117 - // TODO Auto-generated method stub 117 + // TODO Auto-generated method stub
118 - return 0; 118 + return 0;
119 - } 119 + }
120 -} 120 +}
......
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.bgpio.types; 16 +package org.onosproject.bgpio.types;
17 - 17 +
18 -import com.google.common.base.MoreObjects; 18 +import com.google.common.base.MoreObjects;
19 -import org.jboss.netty.buffer.ChannelBuffer; 19 +import org.jboss.netty.buffer.ChannelBuffer;
20 -import org.slf4j.Logger; 20 +import org.slf4j.Logger;
21 -import org.slf4j.LoggerFactory; 21 +import org.slf4j.LoggerFactory;
22 - 22 +
23 -import java.util.Objects; 23 +import java.util.Objects;
24 - 24 +
25 -/** 25 +/**
26 - * Provides MultiProtocolExtnCapabilityTlv. 26 + * Provides MultiProtocolExtnCapabilityTlv.
27 - */ 27 + */
28 -public class MultiProtocolExtnCapabilityTlv implements BgpValueType { 28 +public class MultiProtocolExtnCapabilityTlv implements BgpValueType {
29 - 29 +
30 - /* 30 + /*
31 - 0 7 15 23 31 31 + 0 7 15 23 31
32 - +-------+-------+-------+-------+ 32 + +-------+-------+-------+-------+
33 - | AFI | Res | SAFI | 33 + | AFI | Res | SAFI |
34 - +-------+-------+-------+-------+ 34 + +-------+-------+-------+-------+
35 - 35 +
36 - Multiprotocol Extensions CAPABILITY TLV format 36 + Multiprotocol Extensions CAPABILITY TLV format
37 - REFERENCE : RFC 4760 37 + REFERENCE : RFC 4760
38 - */ 38 + */
39 - protected static final Logger log = LoggerFactory 39 + protected static final Logger log = LoggerFactory
40 - .getLogger(MultiProtocolExtnCapabilityTlv.class); 40 + .getLogger(MultiProtocolExtnCapabilityTlv.class);
41 - 41 +
42 - public static final byte TYPE = 1; 42 + public static final byte TYPE = 1;
43 - public static final byte LENGTH = 4; 43 + public static final byte LENGTH = 4;
44 - 44 +
45 - private final short afi; 45 + private final short afi;
46 - private final byte res; 46 + private final byte res;
47 - private final byte safi; 47 + private final byte safi;
48 - 48 +
49 - /** 49 + /**
50 - * Constructor to initialize variables. 50 + * Constructor to initialize variables.
51 - * @param afi Address Family Identifiers 51 + * @param afi Address Family Identifiers
52 - * @param res reserved field 52 + * @param res reserved field
53 - * @param safi Subsequent Address Family Identifier 53 + * @param safi Subsequent Address Family Identifier
54 - */ 54 + */
55 - public MultiProtocolExtnCapabilityTlv(short afi, byte res, byte safi) { 55 + public MultiProtocolExtnCapabilityTlv(short afi, byte res, byte safi) {
56 - this.afi = afi; 56 + this.afi = afi;
57 - this.res = res; 57 + this.res = res;
58 - this.safi = safi; 58 + this.safi = safi;
59 - } 59 + }
60 - 60 +
61 - /** 61 + /**
62 - * Returns object of MultiProtocolExtnCapabilityTlv. 62 + * Returns object of MultiProtocolExtnCapabilityTlv.
63 - * @param afi Address Family Identifiers 63 + * @param afi Address Family Identifiers
64 - * @param res reserved field 64 + * @param res reserved field
65 - * @param safi Subsequent Address Family Identifier 65 + * @param safi Subsequent Address Family Identifier
66 - * @return object of MultiProtocolExtnCapabilityTlv 66 + * @return object of MultiProtocolExtnCapabilityTlv
67 - */ 67 + */
68 - public static MultiProtocolExtnCapabilityTlv of(short afi, byte res, 68 + public static MultiProtocolExtnCapabilityTlv of(short afi, byte res,
69 - byte safi) { 69 + byte safi) {
70 - return new MultiProtocolExtnCapabilityTlv(afi, res, safi); 70 + return new MultiProtocolExtnCapabilityTlv(afi, res, safi);
71 - } 71 + }
72 - 72 +
73 - /** 73 + /**
74 - * Returns afi Address Family Identifiers value. 74 + * Returns afi Address Family Identifiers value.
75 - * @return afi Address Family Identifiers value 75 + * @return afi Address Family Identifiers value
76 - */ 76 + */
77 - public short getAfi() { 77 + public short getAfi() {
78 - return afi; 78 + return afi;
79 - } 79 + }
80 - 80 +
81 - /** 81 + /**
82 - * Returns res reserved field value. 82 + * Returns res reserved field value.
83 - * @return res reserved field value 83 + * @return res reserved field value
84 - */ 84 + */
85 - public byte getRes() { 85 + public byte getRes() {
86 - return res; 86 + return res;
87 - } 87 + }
88 - 88 +
89 - /** 89 + /**
90 - * Returns safi Subsequent Address Family Identifier value. 90 + * Returns safi Subsequent Address Family Identifier value.
91 - * @return safi Subsequent Address Family Identifier value 91 + * @return safi Subsequent Address Family Identifier value
92 - */ 92 + */
93 - public byte getSafi() { 93 + public byte getSafi() {
94 - return safi; 94 + return safi;
95 - } 95 + }
96 - 96 +
97 - @Override 97 + @Override
98 - public short getType() { 98 + public short getType() {
99 - return TYPE; 99 + return TYPE;
100 - } 100 + }
101 - 101 +
102 - @Override 102 + @Override
103 - public int hashCode() { 103 + public int hashCode() {
104 - return Objects.hash(afi, res, safi); 104 + return Objects.hash(afi, res, safi);
105 - } 105 + }
106 - 106 +
107 - @Override 107 + @Override
108 - public boolean equals(Object obj) { 108 + public boolean equals(Object obj) {
109 - if (this == obj) { 109 + if (this == obj) {
110 - return true; 110 + return true;
111 - } 111 + }
112 - if (obj instanceof MultiProtocolExtnCapabilityTlv) { 112 + if (obj instanceof MultiProtocolExtnCapabilityTlv) {
113 - MultiProtocolExtnCapabilityTlv other = (MultiProtocolExtnCapabilityTlv) obj; 113 + MultiProtocolExtnCapabilityTlv other = (MultiProtocolExtnCapabilityTlv) obj;
114 - return Objects.equals(this.afi, other.afi) 114 + return Objects.equals(this.afi, other.afi)
115 - && Objects.equals(this.res, other.res) 115 + && Objects.equals(this.res, other.res)
116 - && Objects.equals(this.safi, other.safi); 116 + && Objects.equals(this.safi, other.safi);
117 - } 117 + }
118 - return false; 118 + return false;
119 - } 119 + }
120 - 120 +
121 - @Override 121 + @Override
122 - public int write(ChannelBuffer cb) { 122 + public int write(ChannelBuffer cb) {
123 - int iLenStartIndex = cb.writerIndex(); 123 + int iLenStartIndex = cb.writerIndex();
124 - cb.writeByte(TYPE); 124 + cb.writeByte(TYPE);
125 - cb.writeByte(LENGTH); 125 + cb.writeByte(LENGTH);
126 - 126 +
127 - // write afi 127 + // write afi
128 - cb.writeShort(afi); 128 + cb.writeShort(afi);
129 - 129 +
130 - // write res 130 + // write res
131 - cb.writeByte(res); 131 + cb.writeByte(res);
132 - 132 +
133 - // write safi 133 + // write safi
134 - cb.writeByte(safi); 134 + cb.writeByte(safi);
135 - 135 +
136 - return cb.writerIndex() - iLenStartIndex; 136 + return cb.writerIndex() - iLenStartIndex;
137 - } 137 + }
138 - 138 +
139 - /** 139 + /**
140 - * Reads from channel buffer and returns object of MultiprotocolCapabilityTlv. 140 + * Reads from channel buffer and returns object of MultiprotocolCapabilityTlv.
141 - * @param cb of type channel buffer 141 + * @param cb of type channel buffer
142 - * @return object of MultiProtocolExtnCapabilityTlv 142 + * @return object of MultiProtocolExtnCapabilityTlv
143 - */ 143 + */
144 - public static BgpValueType read(ChannelBuffer cb) { 144 + public static BgpValueType read(ChannelBuffer cb) {
145 - short afi = cb.readShort(); 145 + short afi = cb.readShort();
146 - byte res = cb.readByte(); 146 + byte res = cb.readByte();
147 - byte safi = cb.readByte(); 147 + byte safi = cb.readByte();
148 - return new MultiProtocolExtnCapabilityTlv(afi, res, safi); 148 + return new MultiProtocolExtnCapabilityTlv(afi, res, safi);
149 - } 149 + }
150 - 150 +
151 - @Override 151 + @Override
152 - public String toString() { 152 + public String toString() {
153 - return MoreObjects.toStringHelper(getClass()) 153 + return MoreObjects.toStringHelper(getClass())
154 - .add("Type", TYPE) 154 + .add("Type", TYPE)
155 - .add("Length", LENGTH) 155 + .add("Length", LENGTH)
156 - .add("AFI", afi) 156 + .add("AFI", afi)
157 - .add("Reserved", res) 157 + .add("Reserved", res)
158 - .add("SAFI", safi).toString(); 158 + .add("SAFI", safi).toString();
159 - } 159 + }
160 - 160 +
161 - @Override 161 + @Override
162 - public int compareTo(Object o) { 162 + public int compareTo(Object o) {
163 - // TODO Auto-generated method stub 163 + // TODO Auto-generated method stub
164 - return 0; 164 + return 0;
165 - } 165 + }
166 -} 166 +}
......