diff options
Diffstat (limited to 'framework/src/onos/incubator')
41 files changed, 775 insertions, 30 deletions
diff --git a/framework/src/onos/incubator/api/pom.xml b/framework/src/onos/incubator/api/pom.xml index b417af53..9d7c7a6b 100644 --- a/framework/src/onos/incubator/api/pom.xml +++ b/framework/src/onos/incubator/api/pom.xml @@ -24,7 +24,7 @@ <parent> <groupId>org.onosproject</groupId> <artifactId>onos-incubator</artifactId> - <version>1.3.0-SNAPSHOT</version> + <version>1.4.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/config/basics/ConfigException.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/config/basics/ConfigException.java index 071be6a0..deeac765 100644 --- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/config/basics/ConfigException.java +++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/config/basics/ConfigException.java @@ -16,9 +16,12 @@ package org.onosproject.incubator.net.config.basics; +import com.google.common.annotations.Beta; + /** * Signals that an error was encountered while reading/writing configuration. */ +@Beta public class ConfigException extends Exception { /** diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/config/basics/ExtraSubjectFactories.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/config/basics/ExtraSubjectFactories.java index 474ef6ad..260d0af4 100644 --- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/config/basics/ExtraSubjectFactories.java +++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/config/basics/ExtraSubjectFactories.java @@ -15,12 +15,14 @@ */ package org.onosproject.incubator.net.config.basics; +import com.google.common.annotations.Beta; import org.onosproject.incubator.net.domain.IntentDomainId; import org.onosproject.net.config.SubjectFactory; /** * Set of subject factories for potential configuration subjects. */ +@Beta public final class ExtraSubjectFactories { // Construction forbidden diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/config/basics/InterfaceConfig.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/config/basics/InterfaceConfig.java index 47adf5c7..af2b47d8 100644 --- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/config/basics/InterfaceConfig.java +++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/config/basics/InterfaceConfig.java @@ -17,6 +17,7 @@ package org.onosproject.incubator.net.config.basics; import com.fasterxml.jackson.databind.JsonNode; +import com.google.common.annotations.Beta; import com.google.common.collect.Sets; import org.onlab.packet.MacAddress; import org.onlab.packet.VlanId; @@ -30,6 +31,7 @@ import java.util.Set; /** * Configuration for interfaces. */ +@Beta public class InterfaceConfig extends Config<ConnectPoint> { public static final String IPS = "ips"; public static final String MAC = "mac"; diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/domain/TunnelPrimitive.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/domain/TunnelPrimitive.java index 975708d6..2abaab5f 100644 --- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/domain/TunnelPrimitive.java +++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/domain/TunnelPrimitive.java @@ -15,12 +15,14 @@ */ package org.onosproject.incubator.net.domain; +import com.google.common.annotations.Beta; import org.onosproject.core.ApplicationId; import org.onosproject.net.ConnectPoint; /** * Provides connectivity through a domain. */ +@Beta public class TunnelPrimitive extends IntentPrimitive { private final ConnectPoint one; diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/intf/Interface.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/intf/Interface.java index 15ecf340..69d14bce 100644 --- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/intf/Interface.java +++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/intf/Interface.java @@ -15,6 +15,7 @@ */ package org.onosproject.incubator.net.intf; +import com.google.common.annotations.Beta; import com.google.common.base.MoreObjects; import com.google.common.collect.Sets; import org.onlab.packet.MacAddress; @@ -31,6 +32,7 @@ import static com.google.common.base.Preconditions.checkNotNull; * An Interface maps network configuration information (such as addresses and * vlans) to a port in the network. */ +@Beta public class Interface { private final ConnectPoint connectPoint; private final Set<InterfaceIpAddress> ipAddresses; diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/intf/InterfaceService.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/intf/InterfaceService.java index ad1bf34a..b164df93 100644 --- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/intf/InterfaceService.java +++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/intf/InterfaceService.java @@ -16,6 +16,7 @@ package org.onosproject.incubator.net.intf; +import com.google.common.annotations.Beta; import org.onlab.packet.IpAddress; import org.onlab.packet.VlanId; import org.onosproject.net.ConnectPoint; @@ -25,6 +26,7 @@ import java.util.Set; /** * Service for interacting with interfaces. */ +@Beta public interface InterfaceService { /** diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/DefaultLabelResource.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/DefaultLabelResource.java index 23663d38..1065503a 100644 --- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/DefaultLabelResource.java +++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/DefaultLabelResource.java @@ -1,3 +1,18 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onosproject.incubator.net.resource.label; import java.util.Objects; diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResource.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResource.java index bb1b3167..6d5a90be 100644 --- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResource.java +++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResource.java @@ -1,3 +1,18 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onosproject.incubator.net.resource.label; import com.google.common.annotations.Beta; diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceAdminService.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceAdminService.java index f20ab59b..a6108bb6 100644 --- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceAdminService.java +++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceAdminService.java @@ -1,3 +1,18 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onosproject.incubator.net.resource.label; import com.google.common.annotations.Beta; diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceDelegate.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceDelegate.java index ea053afc..ae88be57 100644 --- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceDelegate.java +++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceDelegate.java @@ -1,3 +1,18 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onosproject.incubator.net.resource.label; import com.google.common.annotations.Beta; diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceEvent.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceEvent.java index e77fdaf5..dd02ae21 100644 --- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceEvent.java +++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceEvent.java @@ -1,3 +1,18 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onosproject.incubator.net.resource.label; import com.google.common.annotations.Beta; diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceId.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceId.java index 8936954a..6fe7067d 100644 --- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceId.java +++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceId.java @@ -1,3 +1,18 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onosproject.incubator.net.resource.label; import com.google.common.annotations.Beta; diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceListener.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceListener.java index 72de0fb4..b7f907c6 100644 --- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceListener.java +++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceListener.java @@ -1,3 +1,18 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onosproject.incubator.net.resource.label; import com.google.common.annotations.Beta; diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourcePool.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourcePool.java index 315abe61..75916af0 100644 --- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourcePool.java +++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourcePool.java @@ -1,3 +1,18 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onosproject.incubator.net.resource.label; import static com.google.common.base.Preconditions.checkArgument; diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceProvider.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceProvider.java index 2ef966b6..821177a7 100644 --- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceProvider.java +++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceProvider.java @@ -1,3 +1,18 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onosproject.incubator.net.resource.label; import com.google.common.annotations.Beta; diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceProviderRegistry.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceProviderRegistry.java index b8e0a299..e6234974 100644 --- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceProviderRegistry.java +++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceProviderRegistry.java @@ -1,3 +1,18 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onosproject.incubator.net.resource.label; import com.google.common.annotations.Beta; diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceProviderService.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceProviderService.java index 93384c04..9a1472d6 100644 --- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceProviderService.java +++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceProviderService.java @@ -1,3 +1,18 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onosproject.incubator.net.resource.label; import com.google.common.annotations.Beta; diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceRequest.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceRequest.java index d81d7aa8..9ff6a587 100644 --- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceRequest.java +++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceRequest.java @@ -1,3 +1,18 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onosproject.incubator.net.resource.label; import java.util.Collection; diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceService.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceService.java index 02052c37..bb86d475 100644 --- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceService.java +++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceService.java @@ -1,3 +1,18 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onosproject.incubator.net.resource.label; import java.util.Collection; diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceStore.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceStore.java index 2da3e814..5322d013 100644 --- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceStore.java +++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/resource/label/LabelResourceStore.java @@ -1,3 +1,18 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onosproject.incubator.net.resource.label; import java.util.Collection; diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/DefaultTunnelStatistics.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/DefaultTunnelStatistics.java index 6358ca92..cab9ae43 100644 --- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/DefaultTunnelStatistics.java +++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/DefaultTunnelStatistics.java @@ -1,29 +1,30 @@ /* + * Copyright 2015 Open Networking Laboratory * - * * Copyright 2015 Open Networking Laboratory - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * http://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.onosproject.incubator.net.tunnel; +import com.google.common.annotations.Beta; + import java.time.Duration; import java.util.List; /** * Default implementation of immutable tunnel statistics. */ +@Beta public final class DefaultTunnelStatistics implements TunnelStatistics { private final TunnelId tunnelId; private final double bwUtilization; diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelEndPointFormatter.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelEndPointFormatter.java index 964d451a..57af670c 100644 --- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelEndPointFormatter.java +++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelEndPointFormatter.java @@ -1,6 +1,22 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onosproject.incubator.net.tunnel; +import com.google.common.annotations.Beta; import org.onosproject.ui.table.CellFormatter; import org.onosproject.ui.table.cell.AbstractCellFormatter; @@ -8,6 +24,7 @@ import org.onosproject.ui.table.cell.AbstractCellFormatter; * Formats a optical tunnel endpoint as "(type)/(element-id)/(port)". * Formats a ip tunnel endpoint as "ip". */ +@Beta public final class TunnelEndPointFormatter extends AbstractCellFormatter { //non-instantiable private TunnelEndPointFormatter() { diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelStatistics.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelStatistics.java index 650f9941..c7c9fd96 100644 --- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelStatistics.java +++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/TunnelStatistics.java @@ -1,29 +1,30 @@ /* + * Copyright 2015 Open Networking Laboratory * - * * Copyright 2015 Open Networking Laboratory - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * http://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.onosproject.incubator.net.tunnel; +import com.google.common.annotations.Beta; + import java.time.Duration; import java.util.List; /** * Statistics of a tunnel. */ +@Beta public interface TunnelStatistics { /** diff --git a/framework/src/onos/incubator/api/src/test/java/org/onosproject/incubator/net/config/basics/OpticalPortConfigTest.java b/framework/src/onos/incubator/api/src/test/java/org/onosproject/incubator/net/config/basics/OpticalPortConfigTest.java index 9d56ca23..f2b15b09 100644 --- a/framework/src/onos/incubator/api/src/test/java/org/onosproject/incubator/net/config/basics/OpticalPortConfigTest.java +++ b/framework/src/onos/incubator/api/src/test/java/org/onosproject/incubator/net/config/basics/OpticalPortConfigTest.java @@ -1,3 +1,18 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onosproject.incubator.net.config.basics; import static org.junit.Assert.assertEquals; diff --git a/framework/src/onos/incubator/api/src/test/java/org/onosproject/incubator/net/resource/label/DefaultLabelResourceTest.java b/framework/src/onos/incubator/api/src/test/java/org/onosproject/incubator/net/resource/label/DefaultLabelResourceTest.java index 5d7c02fc..1055dbad 100644 --- a/framework/src/onos/incubator/api/src/test/java/org/onosproject/incubator/net/resource/label/DefaultLabelResourceTest.java +++ b/framework/src/onos/incubator/api/src/test/java/org/onosproject/incubator/net/resource/label/DefaultLabelResourceTest.java @@ -1,3 +1,18 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onosproject.incubator.net.resource.label; import org.junit.Test; diff --git a/framework/src/onos/incubator/api/src/test/java/org/onosproject/incubator/net/resource/label/LabelResourcePoolTest.java b/framework/src/onos/incubator/api/src/test/java/org/onosproject/incubator/net/resource/label/LabelResourcePoolTest.java index 87835080..25ef57f7 100644 --- a/framework/src/onos/incubator/api/src/test/java/org/onosproject/incubator/net/resource/label/LabelResourcePoolTest.java +++ b/framework/src/onos/incubator/api/src/test/java/org/onosproject/incubator/net/resource/label/LabelResourcePoolTest.java @@ -1,3 +1,18 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onosproject.incubator.net.resource.label; import org.junit.Test; diff --git a/framework/src/onos/incubator/api/src/test/java/org/onosproject/incubator/net/resource/label/LabelResourceRequestTest.java b/framework/src/onos/incubator/api/src/test/java/org/onosproject/incubator/net/resource/label/LabelResourceRequestTest.java index 1b08f7c0..f41ad289 100644 --- a/framework/src/onos/incubator/api/src/test/java/org/onosproject/incubator/net/resource/label/LabelResourceRequestTest.java +++ b/framework/src/onos/incubator/api/src/test/java/org/onosproject/incubator/net/resource/label/LabelResourceRequestTest.java @@ -1,3 +1,18 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onosproject.incubator.net.resource.label; import java.util.Collections; diff --git a/framework/src/onos/incubator/api/src/test/java/org/onosproject/incubator/net/tunnel/DefaultTunnelTest.java b/framework/src/onos/incubator/api/src/test/java/org/onosproject/incubator/net/tunnel/DefaultTunnelTest.java index ae94991f..25ec73d4 100644 --- a/framework/src/onos/incubator/api/src/test/java/org/onosproject/incubator/net/tunnel/DefaultTunnelTest.java +++ b/framework/src/onos/incubator/api/src/test/java/org/onosproject/incubator/net/tunnel/DefaultTunnelTest.java @@ -1,3 +1,18 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onosproject.incubator.net.tunnel; import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable; diff --git a/framework/src/onos/incubator/api/src/test/java/org/onosproject/incubator/net/tunnel/TunnelEventTest.java b/framework/src/onos/incubator/api/src/test/java/org/onosproject/incubator/net/tunnel/TunnelEventTest.java index a58e10b5..28669a21 100644 --- a/framework/src/onos/incubator/api/src/test/java/org/onosproject/incubator/net/tunnel/TunnelEventTest.java +++ b/framework/src/onos/incubator/api/src/test/java/org/onosproject/incubator/net/tunnel/TunnelEventTest.java @@ -1,3 +1,18 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onosproject.incubator.net.tunnel; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/framework/src/onos/incubator/net/pom.xml b/framework/src/onos/incubator/net/pom.xml index a0b5391d..e60a2710 100644 --- a/framework/src/onos/incubator/net/pom.xml +++ b/framework/src/onos/incubator/net/pom.xml @@ -23,7 +23,7 @@ <parent> <groupId>org.onosproject</groupId> <artifactId>onos-incubator</artifactId> - <version>1.3.0-SNAPSHOT</version> + <version>1.4.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> diff --git a/framework/src/onos/incubator/net/src/main/java/org/onosproject/incubator/net/intf/impl/package-info.java b/framework/src/onos/incubator/net/src/main/java/org/onosproject/incubator/net/intf/impl/package-info.java new file mode 100644 index 00000000..abdce5a4 --- /dev/null +++ b/framework/src/onos/incubator/net/src/main/java/org/onosproject/incubator/net/intf/impl/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Implementation of service for interacting with interfaces. + */ +package org.onosproject.incubator.net.intf.impl; diff --git a/framework/src/onos/incubator/net/src/main/java/org/onosproject/incubator/net/intf/package-info.java b/framework/src/onos/incubator/net/src/main/java/org/onosproject/incubator/net/intf/package-info.java new file mode 100644 index 00000000..00f42ead --- /dev/null +++ b/framework/src/onos/incubator/net/src/main/java/org/onosproject/incubator/net/intf/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Service for interacting with interfaces. + */ +package org.onosproject.incubator.net.intf; diff --git a/framework/src/onos/incubator/net/src/main/java/org/onosproject/incubator/net/meter/impl/package-info.java b/framework/src/onos/incubator/net/src/main/java/org/onosproject/incubator/net/meter/impl/package-info.java new file mode 100644 index 00000000..5559d90b --- /dev/null +++ b/framework/src/onos/incubator/net/src/main/java/org/onosproject/incubator/net/meter/impl/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Provides implementation of the meter service APIs. + */ +package org.onosproject.incubator.net.meter.impl; diff --git a/framework/src/onos/incubator/net/src/main/java/org/onosproject/incubator/net/resource/label/impl/LabelResourceManager.java b/framework/src/onos/incubator/net/src/main/java/org/onosproject/incubator/net/resource/label/impl/LabelResourceManager.java index 56167c48..8ecf1d29 100644 --- a/framework/src/onos/incubator/net/src/main/java/org/onosproject/incubator/net/resource/label/impl/LabelResourceManager.java +++ b/framework/src/onos/incubator/net/src/main/java/org/onosproject/incubator/net/resource/label/impl/LabelResourceManager.java @@ -1,3 +1,18 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onosproject.incubator.net.resource.label.impl; import com.google.common.collect.Multimap; diff --git a/framework/src/onos/incubator/net/src/test/java/org/onosproject/incubator/net/intf/impl/InterfaceManagerTest.java b/framework/src/onos/incubator/net/src/test/java/org/onosproject/incubator/net/intf/impl/InterfaceManagerTest.java new file mode 100644 index 00000000..cc2908bc --- /dev/null +++ b/framework/src/onos/incubator/net/src/test/java/org/onosproject/incubator/net/intf/impl/InterfaceManagerTest.java @@ -0,0 +1,287 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onosproject.incubator.net.intf.impl; + +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import org.junit.Before; +import org.junit.Test; +import org.onlab.packet.Ip4Address; +import org.onlab.packet.IpAddress; +import org.onlab.packet.MacAddress; +import org.onlab.packet.VlanId; +import org.onosproject.incubator.net.config.basics.ConfigException; +import org.onosproject.incubator.net.config.basics.InterfaceConfig; +import org.onosproject.incubator.net.intf.Interface; +import org.onosproject.net.ConnectPoint; +import org.onosproject.net.config.Config; +import org.onosproject.net.config.NetworkConfigEvent; +import org.onosproject.net.config.NetworkConfigListener; +import org.onosproject.net.config.NetworkConfigServiceAdapter; +import org.onosproject.net.host.InterfaceIpAddress; + +import java.util.Collections; +import java.util.Map; +import java.util.Set; + +import static junit.framework.TestCase.assertEquals; +import static org.junit.Assert.assertNull; + +/** + * Unit tests for InterfaceManager. + */ +public class InterfaceManagerTest { + private static final Class<InterfaceConfig> CONFIG_CLASS = InterfaceConfig.class; + + private static final int NUM_INTERFACES = 4; + + private Set<ConnectPoint> subjects = Sets.newHashSet(); + private Map<ConnectPoint, InterfaceConfig> configs = Maps.newHashMap(); + + private Set<Interface> interfaces = Sets.newHashSet(); + + private NetworkConfigListener listener; + + private InterfaceManager interfaceManager; + + @Before + public void setUp() throws Exception { + for (int i = 0; i < NUM_INTERFACES; i++) { + ConnectPoint cp = createConnectPoint(i); + subjects.add(cp); + + Interface intf = createInterface(i); + + interfaces.add(intf); + + InterfaceConfig ic = new TestInterfaceConfig(cp, Sets.newHashSet(intf)); + + configs.put(cp, ic); + } + + TestNetworkConfigService configService = + new TestNetworkConfigService(subjects, configs); + + interfaceManager = new InterfaceManager(); + interfaceManager.configService = configService; + interfaceManager.activate(); + } + + private Interface createInterface(int i) { + ConnectPoint cp = createConnectPoint(i); + + InterfaceIpAddress ia = InterfaceIpAddress.valueOf("192.168." + i + ".1/24"); + + Interface intf = new Interface(cp, + Sets.newHashSet(ia), + MacAddress.valueOf(i), + VlanId.vlanId((short) i)); + + return intf; + } + + private ConnectPoint createConnectPoint(int i) { + return ConnectPoint.deviceConnectPoint("of:000000000000000" + i + "/1"); + } + + @Test + public void testGetInterfaces() throws Exception { + assertEquals(interfaces, interfaceManager.getInterfaces()); + } + + @Test + public void testGetInterfacesByPort() throws Exception { + ConnectPoint cp = ConnectPoint.deviceConnectPoint("of:0000000000000001/1"); + + Set<Interface> byPort = Collections.singleton(createInterface(1)); + + assertEquals(byPort, interfaceManager.getInterfacesByPort(cp)); + } + + @Test + public void testGetInterfacesByIp() throws Exception { + IpAddress ip = Ip4Address.valueOf("192.168.2.1"); + + Set<Interface> byIp = Collections.singleton(createInterface(2)); + + assertEquals(byIp, interfaceManager.getInterfacesByIp(ip)); + } + + @Test + public void testGetMatchingInterface() throws Exception { + IpAddress ip = Ip4Address.valueOf("192.168.1.100"); + + Interface matchingIntf = createInterface(1); + + assertEquals(matchingIntf, interfaceManager.getMatchingInterface(ip)); + + // Searching for an IP with no match should return null + ip = Ip4Address.valueOf("1.1.1.1"); + + assertNull(interfaceManager.getMatchingInterface(ip)); + } + + @Test + public void testGetInterfacesByVlan() throws Exception { + VlanId vlanId = VlanId.vlanId((short) 1); + + Set<Interface> byVlan = Collections.singleton(createInterface(1)); + + assertEquals(byVlan, interfaceManager.getInterfacesByVlan(vlanId)); + } + + @Test + public void testAddInterface() throws Exception { + // Create a new InterfaceConfig which will get added + VlanId vlanId = VlanId.vlanId((short) 1); + ConnectPoint cp = ConnectPoint.deviceConnectPoint("of:0000000000000001/2"); + Interface newIntf = new Interface(cp, + Collections.emptySet(), + MacAddress.valueOf(100), + vlanId); + + InterfaceConfig ic = new TestInterfaceConfig(cp, Collections.singleton(newIntf)); + + subjects.add(cp); + configs.put(cp, ic); + interfaces.add(newIntf); + + NetworkConfigEvent event = new NetworkConfigEvent( + NetworkConfigEvent.Type.CONFIG_ADDED, cp, CONFIG_CLASS); + + assertEquals(NUM_INTERFACES, interfaceManager.getInterfaces().size()); + + // Send in a config event containing a new interface config + listener.event(event); + + // Check the new interface exists in the InterfaceManager's inventory + assertEquals(interfaces, interfaceManager.getInterfaces()); + assertEquals(NUM_INTERFACES + 1, interfaceManager.getInterfaces().size()); + + // There are now two interfaces with vlan ID 1 + Set<Interface> byVlan = Sets.newHashSet(createInterface(1), newIntf); + assertEquals(byVlan, interfaceManager.getInterfacesByVlan(vlanId)); + } + + @Test + public void testUpdateInterface() throws Exception { + ConnectPoint cp = createConnectPoint(1); + + // Create an interface that is the same as the existing one, but adds a + // new IP address + Interface intf = createInterface(1); + Set<InterfaceIpAddress> addresses = Sets.newHashSet(intf.ipAddresses()); + addresses.add(InterfaceIpAddress.valueOf("192.168.100.1/24")); + intf = new Interface(intf.connectPoint(), addresses, intf.mac(), intf.vlan()); + + // Create a new interface on the same connect point as the existing one + InterfaceIpAddress newAddr = InterfaceIpAddress.valueOf("192.168.101.1/24"); + Interface newIntf = new Interface(cp, + Collections.singleton(newAddr), + MacAddress.valueOf(101), + VlanId.vlanId((short) 101)); + + Set<Interface> interfaces = Sets.newHashSet(intf, newIntf); + + // New interface config updates the existing interface and adds a new + // interface to the same connect point + InterfaceConfig ic = new TestInterfaceConfig(cp, interfaces); + + configs.put(cp, ic); + + NetworkConfigEvent event = new NetworkConfigEvent( + NetworkConfigEvent.Type.CONFIG_UPDATED, cp, CONFIG_CLASS); + + // Send in the event signalling the interfaces for this connect point + // have been updated + listener.event(event); + + assertEquals(NUM_INTERFACES + 1, interfaceManager.getInterfaces().size()); + assertEquals(interfaces, interfaceManager.getInterfacesByPort(cp)); + } + + @Test + public void testRemoveInterface() throws Exception { + ConnectPoint cp = createConnectPoint(1); + + NetworkConfigEvent event = new NetworkConfigEvent( + NetworkConfigEvent.Type.CONFIG_REMOVED, cp, CONFIG_CLASS); + + assertEquals(NUM_INTERFACES, interfaceManager.getInterfaces().size()); + + // Send in a config event removing an interface config + listener.event(event); + + assertEquals(NUM_INTERFACES - 1, interfaceManager.getInterfaces().size()); + } + + /** + * Test version of NetworkConfigService which allows us to pass in subjects + * and InterfaceConfigs directly. + */ + private class TestNetworkConfigService extends NetworkConfigServiceAdapter { + private final Set<ConnectPoint> subjects; + private final Map<ConnectPoint, InterfaceConfig> configs; + + public TestNetworkConfigService(Set<ConnectPoint> subjects, + Map<ConnectPoint, InterfaceConfig> configs) { + this.subjects = subjects; + this.configs = configs; + } + + @Override + public <S, C extends Config<S>> Set<S> getSubjects(Class<S> subjectClass, + Class<C> configClass) { + return (Set<S>) subjects; + } + + @Override + public <S, C extends Config<S>> C getConfig(S subject, Class<C> configClass) { + return (C) configs.get(subject); + } + + @Override + public void addListener(NetworkConfigListener listener) { + InterfaceManagerTest.this.listener = listener; + } + } + + /** + * Test version of InterfaceConfig where we can inject interfaces directly, + * rather than parsing them from JSON. + */ + private class TestInterfaceConfig extends InterfaceConfig { + private final ConnectPoint subject; + private final Set<Interface> interfaces; + + @Override + public ConnectPoint subject() { + return subject; + } + + public TestInterfaceConfig(ConnectPoint subject, Set<Interface> interfaces) { + this.subject = subject; + this.interfaces = interfaces; + } + + @Override + public Set<Interface> getInterfaces() throws ConfigException { + return interfaces; + } + } + +} diff --git a/framework/src/onos/incubator/pom.xml b/framework/src/onos/incubator/pom.xml index 6e6c229d..c94243d2 100644 --- a/framework/src/onos/incubator/pom.xml +++ b/framework/src/onos/incubator/pom.xml @@ -22,7 +22,7 @@ <parent> <groupId>org.onosproject</groupId> <artifactId>onos</artifactId> - <version>1.3.0-SNAPSHOT</version> + <version>1.4.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> diff --git a/framework/src/onos/incubator/store/pom.xml b/framework/src/onos/incubator/store/pom.xml index 54575582..797ccc0b 100644 --- a/framework/src/onos/incubator/store/pom.xml +++ b/framework/src/onos/incubator/store/pom.xml @@ -23,7 +23,7 @@ <parent> <groupId>org.onosproject</groupId> <artifactId>onos-incubator</artifactId> - <version>1.3.0-SNAPSHOT</version> + <version>1.4.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> diff --git a/framework/src/onos/incubator/store/src/main/java/org/onosproject/incubator/store/meter/impl/package-info.java b/framework/src/onos/incubator/store/src/main/java/org/onosproject/incubator/store/meter/impl/package-info.java new file mode 100644 index 00000000..c1992f07 --- /dev/null +++ b/framework/src/onos/incubator/store/src/main/java/org/onosproject/incubator/store/meter/impl/package-info.java @@ -0,0 +1,21 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A distributed meter store implementation that stores meter data consistently + * across the cluster. + */ +package org.onosproject.incubator.store.meter.impl; diff --git a/framework/src/onos/incubator/store/src/main/java/org/onosproject/incubator/store/resource/impl/DistributedLabelResourceStore.java b/framework/src/onos/incubator/store/src/main/java/org/onosproject/incubator/store/resource/impl/DistributedLabelResourceStore.java index a014504c..d129def7 100644 --- a/framework/src/onos/incubator/store/src/main/java/org/onosproject/incubator/store/resource/impl/DistributedLabelResourceStore.java +++ b/framework/src/onos/incubator/store/src/main/java/org/onosproject/incubator/store/resource/impl/DistributedLabelResourceStore.java @@ -1,3 +1,18 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onosproject.incubator.store.resource.impl; import static org.onlab.util.Tools.groupedThreads; diff --git a/framework/src/onos/incubator/store/src/main/java/org/onosproject/incubator/store/resource/impl/LabelResourceMessageSubjects.java b/framework/src/onos/incubator/store/src/main/java/org/onosproject/incubator/store/resource/impl/LabelResourceMessageSubjects.java index 0a6f1640..1b2f6515 100644 --- a/framework/src/onos/incubator/store/src/main/java/org/onosproject/incubator/store/resource/impl/LabelResourceMessageSubjects.java +++ b/framework/src/onos/incubator/store/src/main/java/org/onosproject/incubator/store/resource/impl/LabelResourceMessageSubjects.java @@ -1,3 +1,18 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onosproject.incubator.store.resource.impl; import org.onosproject.store.cluster.messaging.MessageSubject; |