blob: 69ff0c0fc62f9dd503ed733d1d93fcfbf887a363 [file] [log] [blame]
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +05301/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +05303 *
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.yangutils.datamodel;
18
19import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
20import org.onosproject.yangutils.utils.YangConstructType;
21
22/**
23 * Abstraction of YANG collision function. Abstracted to unify the collision
24 * detection functionality.
25 */
26public interface CollisionDetector {
27 /**
28 * Checks for the colliding child.
29 *
30 * @param identifierName name of identifier for which collision to be
Vinod Kumar Se4b9b0c2016-04-30 21:09:15 +053031 * checked
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +053032 * @param dataType type of the YANG construct for which collision to be
Vinod Kumar Se4b9b0c2016-04-30 21:09:15 +053033 * checked
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +053034 * @throws DataModelException if there is any collision in YANG rules in
35 * parsed data, corresponding exception should be thrown
36 */
Vinod Kumar Se4b9b0c2016-04-30 21:09:15 +053037 void detectCollidingChild(String identifierName, YangConstructType dataType)
38 throws DataModelException;
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +053039
40 /**
41 * Check for the self collision.
42 *
43 * @param identifierName name of identifier for which collision to be
Vinod Kumar Se4b9b0c2016-04-30 21:09:15 +053044 * checked
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +053045 * @param dataType type of the YANG construct for which collision to be
Vinod Kumar Se4b9b0c2016-04-30 21:09:15 +053046 * checked
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +053047 * @throws DataModelException if there is any collision in YANG rules in
Vinod Kumar Se4b9b0c2016-04-30 21:09:15 +053048 * parsed data, corresponding exception should be thrown
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +053049 */
Vinod Kumar Se4b9b0c2016-04-30 21:09:15 +053050 void detectSelfCollision(String identifierName, YangConstructType dataType)
51 throws DataModelException;
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +053052}