blob: bd96fbec49152ce3b0115eb96503c7f1ffff7854 [file] [log] [blame]
Satish Kf6d87cb2015-11-30 19:59:22 +05301/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
Satish Kf6d87cb2015-11-30 19:59:22 +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 */
16package org.onosproject.iptopology.api.link;
17
18import org.onosproject.iptopology.api.IpLink;
19import org.onosproject.iptopology.api.TerminationPoint;
20import org.onosproject.net.DeviceId;
21import org.onosproject.net.provider.ProviderId;
22import org.onosproject.store.Store;
23
24import java.util.Set;
25
26/**
27 * Manages inventory of ip links; not intended for direct use.
28 */
29public interface IpLinkStore extends Store<IpLinkEvent, IpLinkStoreDelegate> {
30
31 /**
32 * Returns the number of ip links in the store.
33 *
34 * @return number of ip links
35 */
36 int getIpLinkCount();
37
38 /**
39 * Returns an iterable collection of all ip links in the inventory.
40 *
41 * @return collection of all ip links
42 */
43 Iterable<IpLink> getIpLinks();
44
45 /**
46 * Returns all ip links egressing from the specified device.
47 *
48 * @param deviceId device identifier
49 * @return set of ip device links
50 */
51 Set<IpLink> getIpDeviceEgressLinks(DeviceId deviceId);
52
53 /**
54 * Returns all ip links ingressing from the specified device.
55 *
56 * @param deviceId device identifier
57 * @return set of ip device links
58 */
59 Set<IpLink> getIpDeviceIngressLinks(DeviceId deviceId);
60
61 /**
62 * Returns the ip link between the two termination points.
63 *
64 * @param src source termination point
65 * @param dst destination termination point
66 * @return ip link or null if one not found between the termination points
67 */
68 IpLink getIpLink(TerminationPoint src, TerminationPoint dst);
69
70 /**
71 * Returns all ip links egressing from the specified termination point.
72 *
73 * @param src source termination point
74 * @return set of termination point ip links
75 */
76 Set<IpLink> getEgressIpLinks(TerminationPoint src);
77
78 /**
79 * Returns all ip links ingressing to the specified termination point.
80 *
81 * @param dst destination termination point
82 * @return set of termination point ip links
83 */
84 Set<IpLink> getIngressIpLinks(TerminationPoint dst);
85
86 /**
87 * Creates a new ip link, or updates an existing one, based on the given
88 * information.
89 *
90 * @param providerId provider identity
91 * @param linkDescription ip link description
92 * @return create or update ip link event, or null if no change resulted
93 */
94 IpLinkEvent createOrUpdateIpLink(ProviderId providerId,
95 IpLinkDescription linkDescription);
96
97 /**
98 * Removes ip link, based on the specified information.
99 *
100 * @param src ip link source
101 * @param dst ip link destination
102 * @return remove or update ip link event, or null if no change resulted
103 */
104 IpLinkEvent removeOrDownIpLink(TerminationPoint src, TerminationPoint dst);
105
106 /**
107 * Removes ip link based on the specified information.
108 *
109 * @param src ip link source
110 * @param dst ip link destination
111 * @return remove ip link event, or null if no change resulted
112 */
113 IpLinkEvent removeIpLink(TerminationPoint src, TerminationPoint dst);
114
115}