ONOS-2488 Finished moving network config stuff out of the incubator area.
Change-Id: I62c511938fdf8f33def99ce43f0d4417b4ba1918
Showing
32 changed files
with
199 additions
and
64 deletions
... | @@ -32,7 +32,7 @@ import org.onlab.packet.IpPrefix; | ... | @@ -32,7 +32,7 @@ import org.onlab.packet.IpPrefix; |
32 | import org.onlab.packet.MacAddress; | 32 | import org.onlab.packet.MacAddress; |
33 | import org.onosproject.net.config.ConfigFactory; | 33 | import org.onosproject.net.config.ConfigFactory; |
34 | import org.onosproject.net.config.NetworkConfigRegistry; | 34 | import org.onosproject.net.config.NetworkConfigRegistry; |
35 | -import org.onosproject.incubator.net.config.basics.SubjectFactories; | 35 | +import org.onosproject.net.config.basics.SubjectFactories; |
36 | import org.onosproject.net.ConnectPoint; | 36 | import org.onosproject.net.ConnectPoint; |
37 | import org.onosproject.net.host.HostService; | 37 | import org.onosproject.net.host.HostService; |
38 | import org.onosproject.routing.config.BgpPeer; | 38 | import org.onosproject.routing.config.BgpPeer; | ... | ... |
... | @@ -13,7 +13,7 @@ | ... | @@ -13,7 +13,7 @@ |
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.incubator.net.config.basics; | 16 | +package org.onosproject.net.config.basics; |
17 | 17 | ||
18 | import org.onosproject.net.config.Config; | 18 | import org.onosproject.net.config.Config; |
19 | 19 | ... | ... |
... | @@ -13,7 +13,7 @@ | ... | @@ -13,7 +13,7 @@ |
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.incubator.net.config.basics; | 16 | +package org.onosproject.net.config.basics; |
17 | 17 | ||
18 | import org.onosproject.net.Device; | 18 | import org.onosproject.net.Device; |
19 | import org.onosproject.net.DeviceId; | 19 | import org.onosproject.net.DeviceId; | ... | ... |
... | @@ -13,7 +13,7 @@ | ... | @@ -13,7 +13,7 @@ |
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.incubator.net.config.basics; | 16 | +package org.onosproject.net.config.basics; |
17 | 17 | ||
18 | /** | 18 | /** |
19 | * Basic configuration for network elements, e.g. devices, hosts. Such elements | 19 | * Basic configuration for network elements, e.g. devices, hosts. Such elements | ... | ... |
... | @@ -13,7 +13,7 @@ | ... | @@ -13,7 +13,7 @@ |
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.incubator.net.config.basics; | 16 | +package org.onosproject.net.config.basics; |
17 | 17 | ||
18 | import org.onosproject.net.HostId; | 18 | import org.onosproject.net.HostId; |
19 | 19 | ... | ... |
... | @@ -13,7 +13,7 @@ | ... | @@ -13,7 +13,7 @@ |
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.incubator.net.config.basics; | 16 | +package org.onosproject.net.config.basics; |
17 | 17 | ||
18 | import org.onosproject.net.Link; | 18 | import org.onosproject.net.Link; |
19 | import org.onosproject.net.LinkKey; | 19 | import org.onosproject.net.LinkKey; | ... | ... |
... | @@ -13,16 +13,15 @@ | ... | @@ -13,16 +13,15 @@ |
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.incubator.net.config.basics; | 16 | +package org.onosproject.net.config.basics; |
17 | 17 | ||
18 | import org.onosproject.core.ApplicationId; | 18 | import org.onosproject.core.ApplicationId; |
19 | import org.onosproject.core.CoreService; | 19 | import org.onosproject.core.CoreService; |
20 | -import org.onosproject.net.config.SubjectFactory; | ||
21 | -import org.onosproject.incubator.net.domain.IntentDomainId; | ||
22 | import org.onosproject.net.ConnectPoint; | 20 | import org.onosproject.net.ConnectPoint; |
23 | import org.onosproject.net.DeviceId; | 21 | import org.onosproject.net.DeviceId; |
24 | import org.onosproject.net.HostId; | 22 | import org.onosproject.net.HostId; |
25 | import org.onosproject.net.LinkKey; | 23 | import org.onosproject.net.LinkKey; |
24 | +import org.onosproject.net.config.SubjectFactory; | ||
26 | 25 | ||
27 | import static com.google.common.base.Preconditions.checkArgument; | 26 | import static com.google.common.base.Preconditions.checkArgument; |
28 | 27 | ||
... | @@ -81,14 +80,6 @@ public final class SubjectFactories { | ... | @@ -81,14 +80,6 @@ public final class SubjectFactories { |
81 | } | 80 | } |
82 | }; | 81 | }; |
83 | 82 | ||
84 | - public static final SubjectFactory<IntentDomainId> INTENT_DOMAIN_SUBJECT_FACTORY = | ||
85 | - new SubjectFactory<IntentDomainId>(IntentDomainId.class, "domains") { | ||
86 | - @Override | ||
87 | - public IntentDomainId createSubject(String key) { | ||
88 | - return IntentDomainId.valueOf(key); | ||
89 | - } | ||
90 | - }; | ||
91 | - | ||
92 | /** | 83 | /** |
93 | * Provides reference to the core service, which is required for | 84 | * Provides reference to the core service, which is required for |
94 | * application subject factory. | 85 | * application subject factory. | ... | ... |
1 | +/* | ||
2 | + * Copyright 2015 Open Networking Laboratory | ||
3 | + * | ||
4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | + * you may not use this file except in compliance with the License. | ||
6 | + * You may obtain a copy of the License at | ||
7 | + * | ||
8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | + * | ||
10 | + * Unless required by applicable law or agreed to in writing, software | ||
11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | + * See the License for the specific language governing permissions and | ||
14 | + * limitations under the License. | ||
15 | + */ | ||
16 | + | ||
17 | +/** | ||
18 | + * Various basic builtin network configurations. | ||
19 | + */ | ||
20 | +package org.onosproject.net.config.basics; | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
... | @@ -60,6 +60,13 @@ | ... | @@ -60,6 +60,13 @@ |
60 | 60 | ||
61 | <dependency> | 61 | <dependency> |
62 | <groupId>org.onosproject</groupId> | 62 | <groupId>org.onosproject</groupId> |
63 | + <artifactId>onos-core-dist</artifactId> | ||
64 | + <version>${project.version}</version> | ||
65 | + <scope>test</scope> | ||
66 | + </dependency> | ||
67 | + | ||
68 | + <dependency> | ||
69 | + <groupId>org.onosproject</groupId> | ||
63 | <artifactId>onos-incubator-api</artifactId> | 70 | <artifactId>onos-incubator-api</artifactId> |
64 | <scope>test</scope> | 71 | <scope>test</scope> |
65 | <classifier>tests</classifier> | 72 | <classifier>tests</classifier> | ... | ... |
... | @@ -13,36 +13,33 @@ | ... | @@ -13,36 +13,33 @@ |
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.incubator.net.config.impl; | 16 | +package org.onosproject.net.config.impl; |
17 | 17 | ||
18 | import com.google.common.collect.ImmutableSet; | 18 | import com.google.common.collect.ImmutableSet; |
19 | - | ||
20 | import org.apache.felix.scr.annotations.Activate; | 19 | import org.apache.felix.scr.annotations.Activate; |
21 | import org.apache.felix.scr.annotations.Component; | 20 | import org.apache.felix.scr.annotations.Component; |
22 | import org.apache.felix.scr.annotations.Deactivate; | 21 | import org.apache.felix.scr.annotations.Deactivate; |
23 | import org.apache.felix.scr.annotations.Reference; | 22 | import org.apache.felix.scr.annotations.Reference; |
24 | import org.apache.felix.scr.annotations.ReferenceCardinality; | 23 | import org.apache.felix.scr.annotations.ReferenceCardinality; |
25 | import org.onosproject.core.CoreService; | 24 | import org.onosproject.core.CoreService; |
26 | -import org.onosproject.net.config.ConfigFactory; | ||
27 | -import org.onosproject.net.config.NetworkConfigRegistry; | ||
28 | -import org.onosproject.incubator.net.config.basics.BasicDeviceConfig; | ||
29 | -import org.onosproject.incubator.net.config.basics.BasicHostConfig; | ||
30 | -import org.onosproject.incubator.net.config.basics.BasicLinkConfig; | ||
31 | import org.onosproject.incubator.net.config.basics.InterfaceConfig; | 25 | import org.onosproject.incubator.net.config.basics.InterfaceConfig; |
32 | -import org.onosproject.incubator.net.config.basics.OpticalPortConfig; | ||
33 | -import org.onosproject.incubator.net.config.basics.SubjectFactories; | ||
34 | -import org.onosproject.incubator.net.domain.IntentDomainConfig; | ||
35 | -import org.onosproject.incubator.net.domain.IntentDomainId; | ||
36 | import org.onosproject.net.ConnectPoint; | 26 | import org.onosproject.net.ConnectPoint; |
37 | import org.onosproject.net.DeviceId; | 27 | import org.onosproject.net.DeviceId; |
38 | import org.onosproject.net.HostId; | 28 | import org.onosproject.net.HostId; |
39 | import org.onosproject.net.LinkKey; | 29 | import org.onosproject.net.LinkKey; |
30 | +import org.onosproject.net.config.ConfigFactory; | ||
31 | +import org.onosproject.net.config.NetworkConfigRegistry; | ||
32 | +import org.onosproject.net.config.basics.BasicDeviceConfig; | ||
33 | +import org.onosproject.net.config.basics.BasicHostConfig; | ||
34 | +import org.onosproject.net.config.basics.BasicLinkConfig; | ||
35 | +import org.onosproject.net.config.basics.OpticalPortConfig; | ||
36 | +import org.onosproject.net.config.basics.SubjectFactories; | ||
40 | import org.slf4j.Logger; | 37 | import org.slf4j.Logger; |
41 | import org.slf4j.LoggerFactory; | 38 | import org.slf4j.LoggerFactory; |
42 | 39 | ||
43 | import java.util.Set; | 40 | import java.util.Set; |
44 | 41 | ||
45 | -import static org.onosproject.incubator.net.config.basics.SubjectFactories.*; | 42 | +import static org.onosproject.net.config.basics.SubjectFactories.*; |
46 | 43 | ||
47 | /** | 44 | /** |
48 | * Component for registration of builtin basic network configurations. | 45 | * Component for registration of builtin basic network configurations. |
... | @@ -85,17 +82,9 @@ public class BasicNetworkConfigs { | ... | @@ -85,17 +82,9 @@ public class BasicNetworkConfigs { |
85 | return new BasicLinkConfig(); | 82 | return new BasicLinkConfig(); |
86 | } | 83 | } |
87 | }, | 84 | }, |
88 | - new ConfigFactory<IntentDomainId, IntentDomainConfig>(INTENT_DOMAIN_SUBJECT_FACTORY, | ||
89 | - IntentDomainConfig.class, | ||
90 | - "basic") { | ||
91 | - @Override | ||
92 | - public IntentDomainConfig createConfig() { | ||
93 | - return new IntentDomainConfig(); | ||
94 | - } | ||
95 | - }, | ||
96 | new ConfigFactory<ConnectPoint, OpticalPortConfig>(CONNECT_POINT_SUBJECT_FACTORY, | 85 | new ConfigFactory<ConnectPoint, OpticalPortConfig>(CONNECT_POINT_SUBJECT_FACTORY, |
97 | - OpticalPortConfig.class, | 86 | + OpticalPortConfig.class, |
98 | - "basic") { | 87 | + "basic") { |
99 | @Override | 88 | @Override |
100 | public OpticalPortConfig createConfig() { | 89 | public OpticalPortConfig createConfig() { |
101 | return new OpticalPortConfig(); | 90 | return new OpticalPortConfig(); | ... | ... |
... | @@ -13,7 +13,7 @@ | ... | @@ -13,7 +13,7 @@ |
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.incubator.net.config.impl; | 16 | +package org.onosproject.net.config.impl; |
17 | 17 | ||
18 | import com.fasterxml.jackson.databind.ObjectMapper; | 18 | import com.fasterxml.jackson.databind.ObjectMapper; |
19 | import com.fasterxml.jackson.databind.node.ObjectNode; | 19 | import com.fasterxml.jackson.databind.node.ObjectNode; | ... | ... |
... | @@ -13,7 +13,7 @@ | ... | @@ -13,7 +13,7 @@ |
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.incubator.net.config.impl; | 16 | +package org.onosproject.net.config.impl; |
17 | 17 | ||
18 | import com.fasterxml.jackson.databind.node.ObjectNode; | 18 | import com.fasterxml.jackson.databind.node.ObjectNode; |
19 | import com.google.common.collect.ImmutableSet; | 19 | import com.google.common.collect.ImmutableSet; |
... | @@ -258,7 +258,7 @@ public class NetworkConfigManager | ... | @@ -258,7 +258,7 @@ public class NetworkConfigManager |
258 | return new ConfigIdentifier(factory.subjectFactory().subjectKey(), factory.configKey()); | 258 | return new ConfigIdentifier(factory.subjectFactory().subjectKey(), factory.configKey()); |
259 | } | 259 | } |
260 | 260 | ||
261 | - protected static final class ConfigIdentifier { | 261 | + static final class ConfigIdentifier { |
262 | final String subjectKey; | 262 | final String subjectKey; |
263 | final String configKey; | 263 | final String configKey; |
264 | 264 | ... | ... |
1 | +/* | ||
2 | + * Copyright 2015 Open Networking Laboratory | ||
3 | + * | ||
4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | + * you may not use this file except in compliance with the License. | ||
6 | + * You may obtain a copy of the License at | ||
7 | + * | ||
8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | + * | ||
10 | + * Unless required by applicable law or agreed to in writing, software | ||
11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | + * See the License for the specific language governing permissions and | ||
14 | + * limitations under the License. | ||
15 | + */ | ||
16 | + | ||
17 | +/** | ||
18 | + * Implementation of the network configuration subsystem. | ||
19 | + */ | ||
20 | +package org.onosproject.net.config.impl; | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
... | @@ -18,7 +18,7 @@ package org.onosproject.net.device.impl; | ... | @@ -18,7 +18,7 @@ package org.onosproject.net.device.impl; |
18 | import static org.slf4j.LoggerFactory.getLogger; | 18 | import static org.slf4j.LoggerFactory.getLogger; |
19 | 19 | ||
20 | import org.onosproject.net.config.ConfigOperator; | 20 | import org.onosproject.net.config.ConfigOperator; |
21 | -import org.onosproject.incubator.net.config.basics.BasicDeviceConfig; | 21 | +import org.onosproject.net.config.basics.BasicDeviceConfig; |
22 | import org.onosproject.net.AnnotationKeys; | 22 | import org.onosproject.net.AnnotationKeys; |
23 | import org.onosproject.net.DefaultAnnotations; | 23 | import org.onosproject.net.DefaultAnnotations; |
24 | import org.onosproject.net.Device; | 24 | import org.onosproject.net.Device; | ... | ... |
... | @@ -31,7 +31,7 @@ import org.onosproject.core.Permission; | ... | @@ -31,7 +31,7 @@ import org.onosproject.core.Permission; |
31 | import org.onosproject.net.config.NetworkConfigEvent; | 31 | import org.onosproject.net.config.NetworkConfigEvent; |
32 | import org.onosproject.net.config.NetworkConfigListener; | 32 | import org.onosproject.net.config.NetworkConfigListener; |
33 | import org.onosproject.net.config.NetworkConfigService; | 33 | import org.onosproject.net.config.NetworkConfigService; |
34 | -import org.onosproject.incubator.net.config.basics.BasicDeviceConfig; | 34 | +import org.onosproject.net.config.basics.BasicDeviceConfig; |
35 | import org.onosproject.mastership.MastershipEvent; | 35 | import org.onosproject.mastership.MastershipEvent; |
36 | import org.onosproject.mastership.MastershipListener; | 36 | import org.onosproject.mastership.MastershipListener; |
37 | import org.onosproject.mastership.MastershipService; | 37 | import org.onosproject.mastership.MastershipService; | ... | ... |
... | @@ -18,7 +18,7 @@ package org.onosproject.net.device.impl; | ... | @@ -18,7 +18,7 @@ package org.onosproject.net.device.impl; |
18 | import static org.slf4j.LoggerFactory.getLogger; | 18 | import static org.slf4j.LoggerFactory.getLogger; |
19 | 19 | ||
20 | import org.onosproject.net.config.ConfigOperator; | 20 | import org.onosproject.net.config.ConfigOperator; |
21 | -import org.onosproject.incubator.net.config.basics.OpticalPortConfig; | 21 | +import org.onosproject.net.config.basics.OpticalPortConfig; |
22 | import org.onosproject.net.AnnotationKeys; | 22 | import org.onosproject.net.AnnotationKeys; |
23 | import org.onosproject.net.DefaultAnnotations; | 23 | import org.onosproject.net.DefaultAnnotations; |
24 | import org.onosproject.net.PortNumber; | 24 | import org.onosproject.net.PortNumber; | ... | ... |
... | @@ -19,7 +19,7 @@ import static org.slf4j.LoggerFactory.getLogger; | ... | @@ -19,7 +19,7 @@ import static org.slf4j.LoggerFactory.getLogger; |
19 | 19 | ||
20 | import org.slf4j.Logger; | 20 | import org.slf4j.Logger; |
21 | import org.onosproject.net.config.ConfigOperator; | 21 | import org.onosproject.net.config.ConfigOperator; |
22 | -import org.onosproject.incubator.net.config.basics.BasicHostConfig; | 22 | +import org.onosproject.net.config.basics.BasicHostConfig; |
23 | import org.onosproject.net.AnnotationKeys; | 23 | import org.onosproject.net.AnnotationKeys; |
24 | import org.onosproject.net.DefaultAnnotations; | 24 | import org.onosproject.net.DefaultAnnotations; |
25 | import org.onosproject.net.SparseAnnotations; | 25 | import org.onosproject.net.SparseAnnotations; | ... | ... |
... | @@ -29,7 +29,7 @@ import org.onosproject.core.Permission; | ... | @@ -29,7 +29,7 @@ import org.onosproject.core.Permission; |
29 | import org.onosproject.net.config.NetworkConfigEvent; | 29 | import org.onosproject.net.config.NetworkConfigEvent; |
30 | import org.onosproject.net.config.NetworkConfigListener; | 30 | import org.onosproject.net.config.NetworkConfigListener; |
31 | import org.onosproject.net.config.NetworkConfigService; | 31 | import org.onosproject.net.config.NetworkConfigService; |
32 | -import org.onosproject.incubator.net.config.basics.BasicHostConfig; | 32 | +import org.onosproject.net.config.basics.BasicHostConfig; |
33 | import org.onosproject.net.ConnectPoint; | 33 | import org.onosproject.net.ConnectPoint; |
34 | import org.onosproject.net.DeviceId; | 34 | import org.onosproject.net.DeviceId; |
35 | import org.onosproject.net.Host; | 35 | import org.onosproject.net.Host; | ... | ... |
... | @@ -21,7 +21,7 @@ import java.time.Duration; | ... | @@ -21,7 +21,7 @@ import java.time.Duration; |
21 | 21 | ||
22 | import org.onosproject.net.AnnotationKeys; | 22 | import org.onosproject.net.AnnotationKeys; |
23 | import org.onosproject.net.config.ConfigOperator; | 23 | import org.onosproject.net.config.ConfigOperator; |
24 | -import org.onosproject.incubator.net.config.basics.BasicLinkConfig; | 24 | +import org.onosproject.net.config.basics.BasicLinkConfig; |
25 | import org.onosproject.net.DefaultAnnotations; | 25 | import org.onosproject.net.DefaultAnnotations; |
26 | import org.onosproject.net.Link; | 26 | import org.onosproject.net.Link; |
27 | import org.onosproject.net.SparseAnnotations; | 27 | import org.onosproject.net.SparseAnnotations; | ... | ... |
... | @@ -29,7 +29,7 @@ import org.onosproject.core.Permission; | ... | @@ -29,7 +29,7 @@ import org.onosproject.core.Permission; |
29 | import org.onosproject.net.config.NetworkConfigEvent; | 29 | import org.onosproject.net.config.NetworkConfigEvent; |
30 | import org.onosproject.net.config.NetworkConfigListener; | 30 | import org.onosproject.net.config.NetworkConfigListener; |
31 | import org.onosproject.net.config.NetworkConfigService; | 31 | import org.onosproject.net.config.NetworkConfigService; |
32 | -import org.onosproject.incubator.net.config.basics.BasicLinkConfig; | 32 | +import org.onosproject.net.config.basics.BasicLinkConfig; |
33 | import org.onosproject.net.ConnectPoint; | 33 | import org.onosproject.net.ConnectPoint; |
34 | import org.onosproject.net.DeviceId; | 34 | import org.onosproject.net.DeviceId; |
35 | import org.onosproject.net.Link; | 35 | import org.onosproject.net.Link; | ... | ... |
... | @@ -13,7 +13,7 @@ | ... | @@ -13,7 +13,7 @@ |
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.incubator.net.config.impl; | 16 | +package org.onosproject.net.config.impl; |
17 | 17 | ||
18 | import java.util.Set; | 18 | import java.util.Set; |
19 | 19 | ||
... | @@ -27,8 +27,8 @@ import org.onosproject.net.config.ConfigFactory; | ... | @@ -27,8 +27,8 @@ import org.onosproject.net.config.ConfigFactory; |
27 | import org.onosproject.net.config.NetworkConfigRegistry; | 27 | import org.onosproject.net.config.NetworkConfigRegistry; |
28 | import org.onosproject.net.config.NetworkConfigService; | 28 | import org.onosproject.net.config.NetworkConfigService; |
29 | import org.onosproject.net.config.SubjectFactory; | 29 | import org.onosproject.net.config.SubjectFactory; |
30 | -import org.onosproject.incubator.store.config.impl.DistributedNetworkConfigStore; | ||
31 | import org.onosproject.net.NetTestTools; | 30 | import org.onosproject.net.NetTestTools; |
31 | +import org.onosproject.store.config.impl.DistributedNetworkConfigStore; | ||
32 | import org.onosproject.store.service.TestStorageService; | 32 | import org.onosproject.store.service.TestStorageService; |
33 | 33 | ||
34 | import static org.hamcrest.Matchers.hasSize; | 34 | import static org.hamcrest.Matchers.hasSize; | ... | ... |
... | @@ -26,7 +26,7 @@ import org.junit.Test; | ... | @@ -26,7 +26,7 @@ import org.junit.Test; |
26 | import org.onlab.packet.ChassisId; | 26 | import org.onlab.packet.ChassisId; |
27 | import org.onosproject.net.config.Config; | 27 | import org.onosproject.net.config.Config; |
28 | import org.onosproject.net.config.ConfigApplyDelegate; | 28 | import org.onosproject.net.config.ConfigApplyDelegate; |
29 | -import org.onosproject.incubator.net.config.basics.BasicDeviceConfig; | 29 | +import org.onosproject.net.config.basics.BasicDeviceConfig; |
30 | import org.onosproject.net.AnnotationKeys; | 30 | import org.onosproject.net.AnnotationKeys; |
31 | import org.onosproject.net.DefaultAnnotations; | 31 | import org.onosproject.net.DefaultAnnotations; |
32 | import org.onosproject.net.DeviceId; | 32 | import org.onosproject.net.DeviceId; | ... | ... |
... | @@ -4,7 +4,7 @@ import org.junit.Before; | ... | @@ -4,7 +4,7 @@ import org.junit.Before; |
4 | import org.junit.Test; | 4 | import org.junit.Test; |
5 | import org.onosproject.net.config.Config; | 5 | import org.onosproject.net.config.Config; |
6 | import org.onosproject.net.config.ConfigApplyDelegate; | 6 | import org.onosproject.net.config.ConfigApplyDelegate; |
7 | -import org.onosproject.incubator.net.config.basics.OpticalPortConfig; | 7 | +import org.onosproject.net.config.basics.OpticalPortConfig; |
8 | import org.onosproject.net.AnnotationKeys; | 8 | import org.onosproject.net.AnnotationKeys; |
9 | import org.onosproject.net.ConnectPoint; | 9 | import org.onosproject.net.ConnectPoint; |
10 | import org.onosproject.net.DefaultAnnotations; | 10 | import org.onosproject.net.DefaultAnnotations; | ... | ... |
... | @@ -24,7 +24,7 @@ import org.onlab.packet.MacAddress; | ... | @@ -24,7 +24,7 @@ import org.onlab.packet.MacAddress; |
24 | import org.onlab.packet.VlanId; | 24 | import org.onlab.packet.VlanId; |
25 | import org.onosproject.net.config.Config; | 25 | import org.onosproject.net.config.Config; |
26 | import org.onosproject.net.config.ConfigApplyDelegate; | 26 | import org.onosproject.net.config.ConfigApplyDelegate; |
27 | -import org.onosproject.incubator.net.config.basics.BasicHostConfig; | 27 | +import org.onosproject.net.config.basics.BasicHostConfig; |
28 | import org.onosproject.net.AnnotationKeys; | 28 | import org.onosproject.net.AnnotationKeys; |
29 | import org.onosproject.net.DeviceId; | 29 | import org.onosproject.net.DeviceId; |
30 | import org.onosproject.net.HostId; | 30 | import org.onosproject.net.HostId; | ... | ... |
... | @@ -24,7 +24,7 @@ import org.junit.Before; | ... | @@ -24,7 +24,7 @@ import org.junit.Before; |
24 | import org.junit.Test; | 24 | import org.junit.Test; |
25 | import org.onosproject.net.config.Config; | 25 | import org.onosproject.net.config.Config; |
26 | import org.onosproject.net.config.ConfigApplyDelegate; | 26 | import org.onosproject.net.config.ConfigApplyDelegate; |
27 | -import org.onosproject.incubator.net.config.basics.BasicLinkConfig; | 27 | +import org.onosproject.net.config.basics.BasicLinkConfig; |
28 | import org.onosproject.net.AnnotationKeys; | 28 | import org.onosproject.net.AnnotationKeys; |
29 | import org.onosproject.net.ConnectPoint; | 29 | import org.onosproject.net.ConnectPoint; |
30 | import org.onosproject.net.DefaultAnnotations; | 30 | import org.onosproject.net.DefaultAnnotations; | ... | ... |
... | @@ -13,7 +13,7 @@ | ... | @@ -13,7 +13,7 @@ |
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.incubator.store.config.impl; | 16 | +package org.onosproject.store.config.impl; |
17 | 17 | ||
18 | import com.fasterxml.jackson.databind.ObjectMapper; | 18 | import com.fasterxml.jackson.databind.ObjectMapper; |
19 | import com.fasterxml.jackson.databind.node.ArrayNode; | 19 | import com.fasterxml.jackson.databind.node.ArrayNode; | ... | ... |
... | @@ -17,4 +17,4 @@ | ... | @@ -17,4 +17,4 @@ |
17 | /** | 17 | /** |
18 | * Implementation of the network configuration distributed store. | 18 | * Implementation of the network configuration distributed store. |
19 | */ | 19 | */ |
20 | -package org.onosproject.incubator.store.config.impl; | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
20 | +package org.onosproject.store.config.impl; | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -13,7 +13,7 @@ | ... | @@ -13,7 +13,7 @@ |
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.incubator.store.config.impl; | 16 | +package org.onosproject.store.config.impl; |
17 | 17 | ||
18 | import org.junit.After; | 18 | import org.junit.After; |
19 | import org.junit.Before; | 19 | import org.junit.Before; | ... | ... |
incubator/api/src/main/java/org/onosproject/incubator/net/config/basics/ExtraSubjectFactories.java
0 → 100644
1 | +/* | ||
2 | + * Copyright 2015 Open Networking Laboratory | ||
3 | + * | ||
4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | + * you may not use this file except in compliance with the License. | ||
6 | + * You may obtain a copy of the License at | ||
7 | + * | ||
8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | + * | ||
10 | + * Unless required by applicable law or agreed to in writing, software | ||
11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | + * See the License for the specific language governing permissions and | ||
14 | + * limitations under the License. | ||
15 | + */ | ||
16 | +package org.onosproject.incubator.net.config.basics; | ||
17 | + | ||
18 | +import org.onosproject.incubator.net.domain.IntentDomainId; | ||
19 | +import org.onosproject.net.config.SubjectFactory; | ||
20 | + | ||
21 | +/** | ||
22 | + * Set of subject factories for potential configuration subjects. | ||
23 | + */ | ||
24 | +public final class ExtraSubjectFactories { | ||
25 | + | ||
26 | + // Construction forbidden | ||
27 | + private ExtraSubjectFactories() { | ||
28 | + } | ||
29 | + | ||
30 | + public static final SubjectFactory<IntentDomainId> INTENT_DOMAIN_SUBJECT_FACTORY = | ||
31 | + new SubjectFactory<IntentDomainId>(IntentDomainId.class, "domains") { | ||
32 | + @Override | ||
33 | + public IntentDomainId createSubject(String key) { | ||
34 | + return IntentDomainId.valueOf(key); | ||
35 | + } | ||
36 | + }; | ||
37 | + | ||
38 | +} |
... | @@ -2,11 +2,11 @@ package org.onosproject.incubator.net.config.basics; | ... | @@ -2,11 +2,11 @@ package org.onosproject.incubator.net.config.basics; |
2 | 2 | ||
3 | import static org.junit.Assert.assertEquals; | 3 | import static org.junit.Assert.assertEquals; |
4 | import static org.junit.Assert.assertFalse; | 4 | import static org.junit.Assert.assertFalse; |
5 | -import static org.onosproject.incubator.net.config.basics.OpticalPortConfig.TYPE; | 5 | +import static org.onosproject.net.config.basics.OpticalPortConfig.TYPE; |
6 | -import static org.onosproject.incubator.net.config.basics.OpticalPortConfig.NAME; | 6 | +import static org.onosproject.net.config.basics.OpticalPortConfig.NAME; |
7 | -import static org.onosproject.incubator.net.config.basics.OpticalPortConfig.PORT; | 7 | +import static org.onosproject.net.config.basics.OpticalPortConfig.PORT; |
8 | -import static org.onosproject.incubator.net.config.basics.OpticalPortConfig.STATIC_LAMBDA; | 8 | +import static org.onosproject.net.config.basics.OpticalPortConfig.STATIC_LAMBDA; |
9 | -import static org.onosproject.incubator.net.config.basics.OpticalPortConfig.STATIC_PORT; | 9 | +import static org.onosproject.net.config.basics.OpticalPortConfig.STATIC_PORT; |
10 | 10 | ||
11 | import java.io.IOException; | 11 | import java.io.IOException; |
12 | import java.util.Iterator; | 12 | import java.util.Iterator; |
... | @@ -26,6 +26,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; | ... | @@ -26,6 +26,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; |
26 | import com.fasterxml.jackson.databind.node.JsonNodeFactory; | 26 | import com.fasterxml.jackson.databind.node.JsonNodeFactory; |
27 | import com.fasterxml.jackson.databind.node.ObjectNode; | 27 | import com.fasterxml.jackson.databind.node.ObjectNode; |
28 | import com.google.common.collect.Lists; | 28 | import com.google.common.collect.Lists; |
29 | +import org.onosproject.net.config.basics.OpticalPortConfig; | ||
29 | 30 | ||
30 | public class OpticalPortConfigTest { | 31 | public class OpticalPortConfigTest { |
31 | private static final String FIELD = "ports"; | 32 | private static final String FIELD = "ports"; | ... | ... |
incubator/net/src/main/java/org/onosproject/incubator/net/config/impl/ExtraNetworkConfigs.java
0 → 100644
1 | +/* | ||
2 | + * Copyright 2015 Open Networking Laboratory | ||
3 | + * | ||
4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | + * you may not use this file except in compliance with the License. | ||
6 | + * You may obtain a copy of the License at | ||
7 | + * | ||
8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | + * | ||
10 | + * Unless required by applicable law or agreed to in writing, software | ||
11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | + * See the License for the specific language governing permissions and | ||
14 | + * limitations under the License. | ||
15 | + */ | ||
16 | +package org.onosproject.incubator.net.config.impl; | ||
17 | + | ||
18 | +import com.google.common.collect.ImmutableSet; | ||
19 | +import org.apache.felix.scr.annotations.Activate; | ||
20 | +import org.apache.felix.scr.annotations.Component; | ||
21 | +import org.apache.felix.scr.annotations.Deactivate; | ||
22 | +import org.apache.felix.scr.annotations.Reference; | ||
23 | +import org.apache.felix.scr.annotations.ReferenceCardinality; | ||
24 | +import org.onosproject.incubator.net.domain.IntentDomainConfig; | ||
25 | +import org.onosproject.incubator.net.domain.IntentDomainId; | ||
26 | +import org.onosproject.net.config.ConfigFactory; | ||
27 | +import org.onosproject.net.config.NetworkConfigRegistry; | ||
28 | +import org.slf4j.Logger; | ||
29 | +import org.slf4j.LoggerFactory; | ||
30 | + | ||
31 | +import java.util.Set; | ||
32 | + | ||
33 | +import static org.onosproject.incubator.net.config.basics.ExtraSubjectFactories.INTENT_DOMAIN_SUBJECT_FACTORY; | ||
34 | + | ||
35 | +/** | ||
36 | + * Component for registration of builtin basic network configurations. | ||
37 | + */ | ||
38 | +@Component(immediate = true) | ||
39 | +public class ExtraNetworkConfigs { | ||
40 | + | ||
41 | + private final Logger log = LoggerFactory.getLogger(getClass()); | ||
42 | + | ||
43 | + private final Set<ConfigFactory> factories = ImmutableSet.of( | ||
44 | + new ConfigFactory<IntentDomainId, IntentDomainConfig>(INTENT_DOMAIN_SUBJECT_FACTORY, | ||
45 | + IntentDomainConfig.class, | ||
46 | + "basic") { | ||
47 | + @Override | ||
48 | + public IntentDomainConfig createConfig() { | ||
49 | + return new IntentDomainConfig(); | ||
50 | + } | ||
51 | + } | ||
52 | + ); | ||
53 | + | ||
54 | + @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | ||
55 | + protected NetworkConfigRegistry registry; | ||
56 | + | ||
57 | + @Activate | ||
58 | + public void activate() { | ||
59 | + factories.forEach(registry::registerConfigFactory); | ||
60 | + log.info("Started"); | ||
61 | + } | ||
62 | + | ||
63 | + @Deactivate | ||
64 | + public void deactivate() { | ||
65 | + factories.forEach(registry::unregisterConfigFactory); | ||
66 | + log.info("Stopped"); | ||
67 | + } | ||
68 | + | ||
69 | +} |
-
Please register or login to post a comment