blob: 287cc432968fe8dc1d28e3270d12bed83c5a0d3a [file] [log] [blame]
Simon Huntf679c4e2016-04-01 17:02:24 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Simon Huntf679c4e2016-04-01 17:02:24 -07003 *
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 */
16package org.onosproject.ui;
17
18import org.onosproject.ui.model.topo.UiTopoLayout;
Thomas Vachuska4d66d0a2016-04-15 15:48:13 -070019import org.onosproject.ui.model.topo.UiTopoLayoutId;
Simon Huntf679c4e2016-04-01 17:02:24 -070020
Thomas Vachuska4d66d0a2016-04-15 15:48:13 -070021import java.util.Set;
Simon Huntf679c4e2016-04-01 17:02:24 -070022
23/**
24 * Service for managing {@link UiTopoLayout} instances.
25 */
26public interface UiTopoLayoutService {
27
28 /**
Thomas Vachuska92b016b2016-05-20 11:37:57 -070029 * Returns the top-level root layout, which always exists and cannot
30 * be removed or associated directly with a region.
31 *
32 * @return root topology layout
33 */
34 UiTopoLayout getRootLayout();
35
36 /**
Thomas Vachuska4d66d0a2016-04-15 15:48:13 -070037 * Returns the set of available layouts.
Simon Huntf679c4e2016-04-01 17:02:24 -070038 *
Thomas Vachuska4d66d0a2016-04-15 15:48:13 -070039 * @return set of available layouts
Simon Huntf679c4e2016-04-01 17:02:24 -070040 */
Thomas Vachuska4d66d0a2016-04-15 15:48:13 -070041 Set<UiTopoLayout> getLayouts();
Simon Huntf679c4e2016-04-01 17:02:24 -070042
43 /**
Thomas Vachuska4d66d0a2016-04-15 15:48:13 -070044 * Adds a layout to the system or updates an existing one.
Simon Huntf679c4e2016-04-01 17:02:24 -070045 *
Thomas Vachuska4d66d0a2016-04-15 15:48:13 -070046 * @param layout the layout to add or update
Simon Huntf679c4e2016-04-01 17:02:24 -070047 * @return an indication of success
48 */
49 boolean addLayout(UiTopoLayout layout);
50
Thomas Vachuska4d66d0a2016-04-15 15:48:13 -070051 /**
52 * Returns the layout with the specified identifier.
Thomas Vachuska92b016b2016-05-20 11:37:57 -070053 *
Thomas Vachuska4d66d0a2016-04-15 15:48:13 -070054 * @param layoutId layout identifier
55 * @return layout or null if no such layout is found
56 */
57 UiTopoLayout getLayout(UiTopoLayoutId layoutId);
58
Simon Huntf679c4e2016-04-01 17:02:24 -070059 /**
Simon Huntb1ce2602016-07-23 14:04:31 -070060 * Returns the set of peer layouts of the specified layout. That is,
61 * those layouts that share the same parent.
62 *
63 * @param layoutId layout identifier
64 * @return set of peer layouts; empty set if layout has no peers
65 */
66 Set<UiTopoLayout> getPeers(UiTopoLayoutId layoutId);
67
68 /**
Thomas Vachuska92b016b2016-05-20 11:37:57 -070069 * Returns the set of the child layouts of the specified layout.
70 *
71 * @param layoutId layout identifier
72 * @return set of child layouts; empty set if layout has no children
73 */
74 Set<UiTopoLayout> getChildren(UiTopoLayoutId layoutId);
75
76 /**
Simon Huntf679c4e2016-04-01 17:02:24 -070077 * Removes a layout from the system.
78 *
79 * @param layout the layout to remove
80 * @return an indication of success
81 */
82 boolean removeLayout(UiTopoLayout layout);
83
84}