blob: 6ef04174a5472eb0d050dab8fa32727bfa8efc59 [file] [log] [blame]
hirokiec18d3a2018-05-16 15:27:37 -07001/*
2 * Copyright 2018-present Open Networking Foundation
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
17package org.onosproject.odtn.utils.tapi;
18
hirokif4ed5212018-05-26 22:39:38 -070019import static org.onosproject.odtn.utils.tapi.TapiGlobalClassUtil.getUuid;
hirokiec18d3a2018-05-16 15:27:37 -070020import static org.onosproject.odtn.utils.tapi.TapiGlobalClassUtil.setUuid;
21
hirokid8fd7862018-10-09 15:24:24 +090022import org.onosproject.yang.gen.v1.tapicommon.rev20181016.tapicommon.DefaultContext;
23import org.onosproject.yang.gen.v1.tapicommon.rev20181016.tapicommon.Uuid;
24import org.onosproject.yang.gen.v1.tapitopology.rev20181016.tapitopology.context.augmentedtapicommoncontext.DefaultTopologyContext;
25import org.onosproject.yang.gen.v1.tapitopology.rev20181016.tapitopology.topologycontext.DefaultTopology;
hirokiec18d3a2018-05-16 15:27:37 -070026import org.onosproject.yang.model.ModelObjectId;
27
28/**
hirokif4ed5212018-05-26 22:39:38 -070029 * Utility class to deal with TAPI Topology with DCS.
hirokiec18d3a2018-05-16 15:27:37 -070030 */
hirokif4ed5212018-05-26 22:39:38 -070031public final class TapiTopologyHandler extends TapiObjectHandler<DefaultTopology> {
hirokiec18d3a2018-05-16 15:27:37 -070032
hirokif4ed5212018-05-26 22:39:38 -070033 private TapiTopologyHandler() {
34 obj = new DefaultTopology();
35 setId();
hirokiec18d3a2018-05-16 15:27:37 -070036 }
37
hirokif4ed5212018-05-26 22:39:38 -070038 public static TapiTopologyHandler create() {
39 return new TapiTopologyHandler();
hirokiec18d3a2018-05-16 15:27:37 -070040 }
41
hirokiec18d3a2018-05-16 15:27:37 -070042 @Override
hirokif4ed5212018-05-26 22:39:38 -070043 protected Uuid getIdDetail() {
44 return getUuid(obj);
45 }
hirokiec18d3a2018-05-16 15:27:37 -070046
hirokif4ed5212018-05-26 22:39:38 -070047 @Override
48 protected void setIdDetail(Uuid uuid) {
49 setUuid(obj, uuid);
50 }
51
52 @Override
53 public ModelObjectId getParentModelObjectId() {
hirokiec18d3a2018-05-16 15:27:37 -070054
hirokid8fd7862018-10-09 15:24:24 +090055 return ModelObjectId.builder()
56 .addChild(DefaultContext.class)
57 .addChild(DefaultTopologyContext.class)
58 .build();
hirokiec18d3a2018-05-16 15:27:37 -070059 }
hirokiec18d3a2018-05-16 15:27:37 -070060}