Aihua Guo
Committed by Gerrit Code Review

ACTN TE Topology APP Implementation. Function of the implementation:

- receives multiple TE topologies from SB provider, and merge into one native TE topology
- store both original, received TE topologies and the native topology in TE topology data store
- provide APIs for NB APP to retreive and display the TE topologies.

Change-Id: Id0b2f3433966694fcf197cc0b8ad19a063e92f36
1 COMPILE_DEPS = [ 1 COMPILE_DEPS = [
2 '//lib:CORE_DEPS', 2 '//lib:CORE_DEPS',
3 + '//incubator/api:onos-incubator-api',
4 + '//core/store/serializers:onos-core-serializers',
3 ] 5 ]
4 6
5 osgi_jar_with_tests ( 7 osgi_jar_with_tests (
......
1 +/*
2 + * Copyright 2016 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.tetopology.management.impl;
17 +
18 +import org.onosproject.core.ApplicationId;
19 +import org.onosproject.incubator.net.config.basics.ConfigException;
20 +import org.onosproject.net.config.Config;
21 +import org.onosproject.tetopology.management.api.TeTopologyId;
22 +
23 +/**
24 + * Configuration for TE Topology Identifiers.
25 + */
26 +public class TeTopologyIdConfig extends Config<ApplicationId> {
27 + public static final String CONFIG_VALUE_ERROR = "Error parsing config value";
28 + private static final String PROVIDER_ID = "provider-id";
29 + private static final String CLIENT_ID = "client-id";
30 + private static final String TOPOLOGY_ID = "topology-id";
31 +
32 + /**
33 + * Generates TE topology identifier.
34 + *
35 + * @return encoded TE topology identifier
36 + * @throws ConfigException if the parameters are not correctly configured
37 + * or conversion of the parameters fails
38 + */
39 + public TeTopologyId getTeTopologyId() throws ConfigException {
40 + try {
41 + long providerId = object.path(PROVIDER_ID).asLong();
42 + long clientId = object.path(CLIENT_ID).asLong();
43 + String topologyId = object.path(TOPOLOGY_ID).asText();
44 +
45 + return new TeTopologyId(providerId, clientId, topologyId);
46 +
47 + } catch (IllegalArgumentException e) {
48 + throw new ConfigException(CONFIG_VALUE_ERROR, e);
49 + }
50 + }
51 +}
1 +/**
2 + * Copyright 2016 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 + * TE Topology Management implementation.
19 + */
20 +package org.onosproject.tetopology.management.impl;